Files
financial-assistant/03. Phase 1 - MVP Detailed Plan.md
2025-04-14 13:09:02 +00:00

102 lines
4.3 KiB
Markdown

# Phase 1 - MVP Detailed Plan (Concise)
Step-by-step breakdown for MVP development.
---
### Task 1.1: Project Setup
**Goal:** Establish the foundational Android project.
1. **Create Project:** New Android Studio project (Empty Compose Activity, Kotlin, Min SDK).
2. **Version Control:** `git init`, create `.gitignore`, initial commit.
3. **Project Structure:** Create standard packages (`ui`, `data`, `domain`, `di`, `util`).
4. **Dependencies:** Add and sync core dependencies (Compose, Navigation, Lifecycle, Room, Coroutines, Hilt/KSP) in `build.gradle.kts`.
---
### Task 1.2: Local Database (Room)
**Goal:** Set up local SQLite storage using Room.
1. **Entities:** Define `@Entity` data classes (`BillEntity`, `PaymentEntity`, `GoalEntity`) with primary keys, columns. Add TypeConverters if needed.
2. **DAOs:** Define `@Dao` interfaces (`BillDao`, `PaymentDao`, `GoalDao`) with suspend/Flow CRUD methods (`@Insert`, `@Query`, etc.).
3. **Database Class:** Define `@Database` abstract class extending `RoomDatabase`, listing entities and DAOs. Increment version.
4. **Database Instance:** Provide singleton DB instance (Hilt module recommended).
---
### Task 1.3: Basic UI Shell & Navigation
**Goal:** Create main navigation structure and placeholders.
1. **Navigation Routes:** Define sealed class/enum for screen routes (`Screen.BillList`, etc.).
2. **NavHost:** Set up `NavHostController` and `NavHost` in main Activity/App Composable with placeholder screen Composables.
3. **Bottom Navigation:** Implement Material 3 `NavigationBar` integrated with `NavHostController` and `Scaffold`.
---
### Task 1.4: Manual Bill Tracking
**Goal:** Implement core bill management functionality.
1. **Repository:** Create `BillRepository` (interface/impl) using `BillDao`.
2. **ViewModel:** Create `BillViewModel` using Repository. Expose `StateFlow<List<BillEntity>>`. Implement add/update/delete functions using `viewModelScope`.
3. **Bill List Screen:** Create `BillListScreen` Composable. Collect `StateFlow`, display in `LazyColumn` using `BillItem`. Add FAB navigating to Add/Edit screen.
4. **Add/Edit Bill Screen:** Create `AddEditBillScreen` Composable. Use `TextField`s, Date Picker. Manage state. Save button calls ViewModel and navigates back. Handle edit case (pass ID).
---
### Task 1.5: Manual Payment Tracking
**Goal:** Allow marking bills as paid and viewing history.
1. **Mark as Paid Action:** Add button/action in `BillListScreen`/`BillItem`.
2. **ViewModel Logic:** Function updates Bill `isPaid` status and inserts corresponding `PaymentEntity` (use transaction if needed).
3. **Payment History Screen:** Create `PaymentHistoryViewModel` (using `PaymentDao`/Repo) & `PaymentHistoryScreen` Composable displaying payments list.
---
### Task 1.6: Basic Manual Goal Setting
**Goal:** Implement simple goal creation and viewing.
1. **Repository & ViewModel:** Create `GoalRepository` & `GoalViewModel` (similar pattern to Bills).
2. **Goal List Screen:** Create `GoalListScreen` Composable displaying goals with FAB.
3. **Add/Edit Goal Screen:** Create `AddEditGoalScreen` Composable with input fields and Save button.
---
### Task 1.7: Essential Notifications
**Goal:** Notify users about upcoming bills.
1. **Worker:** Create `BillReminderWorker` extending `CoroutineWorker`. Inject Dao.
2. **Worker Logic (`doWork`)**: Query upcoming unpaid bills, build & show notification (`NotificationCompat.Builder`, `NotificationManagerCompat`).
3. **Scheduling:** Schedule `PeriodicWorkRequest` in Application/Activity using `WorkManager.enqueueUniquePeriodicWork`.
---
### Task 1.8: MVP Testing
**Goal:** Ensure MVP stability.
1. **Unit Tests:** ViewModels (JUnit, MockK/Mockito), Repositories.
2. **Database Tests:** DAOs (Instrumented tests, in-memory DB).
3. **Manual Testing:** Cover all MVP user stories/flows on various devices/emulators.
4. **UI Tests (Basic):** Navigation, simple interactions (Compose testing).
---
### Task 1.9: MVP Deployment Prep
**Goal:** Prepare MVP for potential initial release.
1. **Code Cleanup:** Lint, remove unused code/logs, ensure consistent style.
2. **Documentation:** Update `README.md` (scope, setup instructions).
3. **App Assets:** Create adaptive icons, basic store screenshots.
4. **Release Build:** Enable R8/Proguard, configure signing (generate/secure keystore).
5. **Build Signed App:** Generate signed App Bundle/APK.
---