A modern Android task management application built with Jetpack Compose, following Clean Architecture principles and the MVI (Model-View-Intent) pattern.
This project implements the MVI (Model-View-Intent) architectural pattern, which provides a unidirectional data flow and predictable state management.
1. Intent (HomepageViewIntent)
- Represents user actions and system events
- Examples:
CreateTask,EditTask,DeleteTask,ChangeFilter,ChangeSort
2. Model/State (HomepageViewState)
- Single source of truth for UI state
- Immutable data class
- Contains: tasks list, filters, loading state, bottom sheet state, etc.
3. Side Effects (HomepageSideEffect)
- One-time events (not state)
- Examples: showing snackbar, navigation events
- Consumed by the view
4. View (HomepageScreen)
- Observes state and renders UI
- Emits intents in response to user interactions
- No business logic
5. ViewModel (HomepageViewModel)
- Handles all business logic
- Processes intents and updates state
- Manages data layer interactions
- Emits side effects (e.g., showing snackbars)
The project follows Clean Architecture with clear separation of concerns across three layers:
Purpose: Contains business logic, use cases, and domain models
- Models:
Task,TaskStatus,TaskFilter,TaskSortBy - Repository Interface:
TaskRepository(abstraction) - ViewModel:
HomepageViewModel(orchestrates business logic) - MVI Contract:
HomepageViewIntent,HomepageViewState,HomepageSideEffect
Key Features:
- Framework-independent business logic
- Defines contracts for data access
- No Android framework dependencies (except ViewModel and lifecycle)
- Highly testable with MockK
Purpose: Handles data operations and persistence
- Database: Room Database with
TaskEntity - DAO:
TaskDaofor database operations - Repository Implementation:
TaskRepositoryImpl - Mappers: Convert between
Task(domain) ↔TaskEntity(data) - Dependency Injection:
DatabaseModule(Hilt)
Key Features:
- Offline-first with Room database
- Reactive data streams with Flow
- Clean separation from domain models
Purpose: Handles UI rendering and user interactions
- Screens:
HomepageScreen(main screen) - Components:
TaskBottomSheet,TaskList,TaskItem,FilterAndSortSection - No Business Logic: Pure presentation components
Key Features:
- Declarative UI with Jetpack Compose
1. CRUD Operations
- Create: Add new task with title, description, and initial status
- Read: Load all tasks from local database
- Update: Modify task properties or change status
- Delete: Remove task from database
2. Filtering
- Filter by status: ALL, TODO, PROGRESS, DONE
- Real-time filtering without network calls
3. Sorting
- Sort by newest date
- Sort by oldest date
- Sort by status
4. State Management
- Loading states during data operations
- Error handling with snackbar messages
- Bottom sheet for create/edit operations
- Kotlin - Modern programming language for Android
- Jetpack Compose - Declarative UI framework
- Material Design 3 - Latest Material Design components
- Coroutines - Asynchronous programming
- Flow - Reactive streams
- Hilt - Dependency injection
- ViewModel - Lifecycle-aware state management
- Room - Local database
- Clean Architecture - Separation of concerns
- JUnit - Unit testing framework
- MockK - Mocking library
- Turbine - Flow testing
- Coroutines Test - Testing coroutines
- Compose Test - UI testing