Case study
Expense Tracker
Type "nasi lemak 8" to a Discord bot and it logs the expense. It also reads receipt photos and voice notes, and a dashboard tracks budgets from payday to payday.
- Role
- Solo, end to end
- Stack
- Next.js 16, TypeScript, Drizzle ORM, SQLite
- Key decision
- Correction-aware prompting: the last 20 user corrections are injected into the prompt so parsing adapts to how the user actually writes
Problem
Logging expenses in a form is slow enough that it doesn't get done. Free-text entry is faster, but free text is messy, and a model's output can't be trusted to be well-formed or sensible.
Approach
Every model call is a single judgment step wrapped in checks. Free text goes to a small, cheap model through OpenRouter and the reply is validated against a strict schema. A reply that fails validation becomes an unparsed entry the user can fix by hand. A date that isn't a real calendar date, or falls outside the last 12 months, is replaced with today and the reply says so. Past corrections are fed back into the prompt so the parser improves on the user's own habits.
Outcome
A deployed tool where a model failure degrades to manual entry instead of bad data. The model makes one judgment per call and never chooses tools or runs multiple steps.
Highlights
- Correction-aware prompting: the last 20 user corrections are injected into the prompt so parsing adapts to how the user actually writes
- Schema-validated parsing with a safe fallback: replies are checked with Zod, failures become an unparsed entry, and an implausible date falls back to today with a note in the reply
- Cost-aware model choice: Claude Haiku 4.5 by default, because the task is short structured extraction
- Budgeting by pay cycle rather than calendar month: Left to spend is income minus fixed costs minus spend so far, and fixed costs are entered automatically on their due day
- Responsive dashboard with a sidebar layout on desktop: category bar, daily spend chart, repeat-spend list, Spend/Transfers filters and savings-goal (Tabung) progress
- Also: receipt photo parsing, voice-note logging, natural-language questions over recent spending, daily and monthly summaries, passkey login, and an API-key health check
Want something like this built?
Tell me what you need; you get a fixed quote after a short call.