## 1. Project setup - [x] 1.1 Scaffold the `Next.js` app with TypeScript, linting, and baseline project configuration. - [x] 1.2 Add runtime dependencies for Prisma, SQLite, validation, charts, and `OpenAI` integration. - [x] 1.3 Add development dependencies and scripts for testing, Prisma generation, and local development. - [x] 1.4 Add base environment and ignore-file setup for local database and API key configuration. ## 2. Persistence and shared services - [x] 2.1 Define Prisma models for `Expense`, `Paycheck`, and `MonthlyInsight` and create the initial SQLite migration. - [x] 2.2 Implement shared validation schemas for expenses, paychecks, and month query parameters. - [x] 2.3 Implement shared money and local-date utilities for month boundary calculations. ## 3. Expense and paycheck workflows - [x] 3.1 Implement expense API routes for create, list, and delete operations. - [x] 3.2 Implement paycheck API routes for create, list, and delete operations. - [x] 3.3 Build the `Add Expense` view with form submission, validation feedback, and expense listing. - [x] 3.4 Build the `Income/Paychecks` view with form submission, validation feedback, and paycheck listing. ## 4. Dashboard and insights - [x] 4.1 Implement monthly dashboard aggregation services for totals, category breakdowns, and derived comparisons. - [x] 4.2 Implement the dashboard API route and render dashboard sections for month-to-date metrics and comparisons. - [x] 4.3 Implement the offline `Ollama` insight service with structured monthly snapshot input and sparse-month fallback logic. - [x] 4.4 Implement insight generation and display in the dashboard, including persisted monthly insight records and offline-runtime fallback messaging. ## 5. Offline categorization - [x] 5.1 Implement deterministic merchant-to-category mapping for known merchants. - [x] 5.2 Implement a local-model category suggestion endpoint for unknown merchants. - [x] 5.3 Update the expense entry flow to auto-fill known merchants and require confirmation for model-generated suggestions. - [x] 5.4 Add local runtime availability handling so category suggestion falls back to manual selection without cloud calls. ## 6. Verification - [ ] 6.1 Add automated tests for validation, persistence, dashboard aggregates, offline insight fallback behavior, and category suggestion rules. - [x] 6.2 Verify the primary user flows in the browser, including expense entry, paycheck entry, dashboard updates, category suggestion, and insight generation.