Add offline merchant category suggestions

This commit is contained in:
2026-03-23 13:28:00 -04:00
parent 12c72ddcad
commit 696d393fca
11 changed files with 352 additions and 31 deletions

View File

@@ -1,12 +1,13 @@
## Why
The project currently has a product plan but no runnable application, spec artifacts, or implementation scaffold. Formalizing the first version now creates a clear contract for building a local-first expense tracker with reliable monthly summaries and AI-generated guidance.
The project currently has a product plan but no runnable application, spec artifacts, or implementation scaffold. Formalizing the first version now creates a clear contract for building a local-first expense tracker with reliable monthly summaries, private offline AI assistance, and no dependency on hosted model providers.
## What Changes
- Add a local-first web app for tracking expenses and biweekly paychecks without authentication.
- Add dashboard capabilities for month-to-date totals, category breakdowns, cash flow, and spending comparisons.
- Add manual AI insight generation for a selected month using structured aggregates and transaction samples.
- Add fully offline AI insight generation for a selected month using structured aggregates and transaction samples.
- Add merchant-name-based category suggestion using deterministic rules plus local-model fallback.
- Add local persistence, validation, and API routes for expenses, paychecks, dashboard data, and insight generation.
## Capabilities
@@ -15,7 +16,8 @@ The project currently has a product plan but no runnable application, spec artif
- `expense-tracking`: Record, list, and delete categorized expenses for a given date.
- `paycheck-tracking`: Record, list, and delete paycheck entries based on actual pay dates.
- `monthly-dashboard`: View month-specific spending, income, and derived financial summaries.
- `monthly-insights`: Generate read-only AI insights from monthly financial activity.
- `monthly-insights`: Generate private offline AI insights from monthly financial activity.
- `category-suggestion`: Suggest expense categories from merchant/shop names without cloud calls.
### Modified Capabilities
- None.
@@ -24,5 +26,5 @@ The project currently has a product plan but no runnable application, spec artif
- Affected code: new `Next.js` application, server routes, UI views, Prisma schema, and AI integration service.
- APIs: `POST/GET/DELETE` routes for expenses and paychecks, `GET /dashboard`, and `POST /insights/generate`.
- Dependencies: `Next.js`, `Prisma`, `SQLite`, and `OpenAI` SDK.
- Dependencies: `Next.js`, `Prisma`, `SQLite`, `Ollama`, and a local Qwen-class instruct model.
- Systems: local machine timezone handling for month boundaries and persisted local database storage.