feat: initial finance SPA — phases 1 & 2

Next.js 16 personal finance dashboard connected to postgres-personal.

Phase 1 (Foundation):
- API routes: GET /api/transactions (paginated, filterable, sortable),
  GET /api/statements, GET /api/merchants
- Transactions data table with date/category/bank/search filters, pagination, sort
- Statements card grid with period, due date, amount, transaction count
- Sidebar layout with nav for all planned sections

Phase 2 (Normalisation):
- PATCH /api/transactions/[id] — upsert transaction_overrides
- POST /api/transactions/bulk — bulk categorize/normalize
- Inline click-to-edit category (22 options) and merchant name
- Blue dot override indicator, bulk action bar
- Effective values via COALESCE(override, llm_value) pattern

Stack: Next.js 16 (App Router, standalone), Prisma 7.x + @prisma/adapter-pg,
TanStack Query, Tailwind CSS. Auth via Traefik chain-oauth@file.
This commit is contained in:
2026-03-07 23:31:40 +11:00
parent 28207b42b5
commit 35a5be97b0
31 changed files with 2243 additions and 99 deletions
+33
View File
@@ -0,0 +1,33 @@
export const CATEGORIES = [
"groceries",
"dining",
"transport",
"fuel",
"shopping",
"utilities",
"entertainment",
"travel",
"health",
"insurance",
"subscriptions",
"cash_advance",
"government",
"education",
"rent",
"transfers",
"income",
"personal_care",
"pets",
"gifts",
"charity",
"other",
] as const;
export type Category = (typeof CATEGORIES)[number];
export function formatCategory(cat: string): string {
return cat
.split("_")
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
.join(" ");
}