-
UI Layer (Compose screens: Home, Calendar, Dashboard, CreateTask)
- Displays tasks and handles user interactions.
- Communicates with the ViewModel.
-
ViewModel (
TaskViewModel)- Holds LiveData for tasks.
- Calls Repository methods to perform database operations.
- Ensures operations run on background threads with
viewModelScope.
-
Repository (
TaskService)- Abstracts data access.
- Provides CRUD operations and search functionality.
- Communicates with DAO.
-
DAO (
DAO)- Defines SQL queries and database operations.
- Returns
Flow<List<Task>>for reactive updates.
-
Database (
TaskDataBase)- Room database that stores
Taskentities. - Provides DAO instance.
- Room database that stores
-
Dependency Injection
- Hilt modules (
TaskDatabaseModule) provide singleton instances of Database and DAO. @HiltAndroidAppannotatedAppclass enables DI throughout the app.
- Hilt modules (
<img src