Note: For frontend documentation, see TimeHacker.UI/README.md
Clean Architecture with 4 layers:
Domain → Application → Infrastructure → API
Projects:
TimeHacker.Domain- Core entities, interfaces, domain modelsTimeHacker.Domain.Services- Business logic & algorithmsTimeHacker.Application.Api(.Contracts)- Service implementations & DTOsTimeHacker.Infrastructure(.Identity)- EF Core, repositories, authTimeHacker.Api- REST controllersTimeHacker.Migrations(.Identity)- Database migrationsTimeHacker.Helpers.*- Shared utilities
Request Flow:
HTTP Request → Controller → AppService → Repository/Service/Processor → Response
Tasks:
FixedTask- Time-specific tasks (start/end times)DynamicTask- Flexible tasks (min/max/optimal duration)
Organization:
Category&Tag- Many-to-many with both task types
User Scoping:
- All entities inherit from
UserScopedEntityBase - Automatic filtering by
userIdat repository level (multi-tenant)
Handles recurring tasks and categories.
Key Entities:
-
ScheduleEntity - Defines recurring schedule
- Links to parent
FixedTaskorCategory - Contains
RepeatingEntityDto(daily/weekly/monthly/yearly patterns) - Tracks creation history and optional end date
- Links to parent
-
ScheduleSnapshot - Parent entity for a specific date
- Created when "RefreshTasksForDay" is called
- Contains all scheduled entities for that day
- Links to
ScheduledTasksandScheduledCategories
-
ScheduledTask / ScheduledCategory - Generated instances
- Created from parent +
ScheduleEntity - Stores snapshot of data for specific occurrence
- Links back to parent and
ScheduleSnapshot
- Created from parent +
Relationships:
ScheduleEntity (recurring definition)
└─ Parent: FixedTask or Category
When day is generated:
↓
ScheduleSnapshot (for specific date)
├─ ScheduledTasks (generated task instances)
└─ ScheduledCategories (generated category instances)
Generation Flow:
- User requests tasks for a date
- System checks if
ScheduleSnapshotexists - If not, generates it:
- Fetches regular tasks
- Finds
ScheduleEntitiesmatching date - Generates
ScheduledTask/ScheduledCategoryinstances - Runs
TaskTimelineProcessorto optimize schedule - Saves everything under
ScheduleSnapshot
- Returns results
Services:
TaskService- Orchestrates task retrieval & generationScheduleEntityService- Manages recurring schedulesFixedTaskService/DynamicTaskService- CRUD operations
Processors:
TaskTimelineProcessor- Schedules fixed tasks in slots, fills gaps with dynamic tasks
Database:
- PostgreSQL with EF Core
- ASP.NET Identity for auth
- Automatic UTC conversion for DateTimes