Build Guide
How to Build an Expense Tracker
An expense tracker is the most-built personal finance app and the most-abandoned — because most devs skip automatic categorisation, the one feature users actually need.
Personal finance apps have some of the highest user retention of any category. Build one and you'll learn date handling, data visualisation, CSV parsing, and recurring transaction logic.
Data model
The core tables you'll need before writing any UI.
Build order
The sequence that minimises rewrites — build in this order.
Transaction list and add form
Build a list of transactions and a form to add one — amount, description, date, type (income/expense). Store in localStorage. No categories yet.
Categories and tagging
Add a categories table with name, icon, and color. Add a category selector to the add form. Seed 10 default categories (food, transport, bills, etc.).
Monthly summary cards
Calculate total income, total expenses, and net savings for the current month. Display as three KPI cards at the top of the dashboard. Filter by month using date range.
Charts
Add a donut chart (spending by category) and a bar chart (monthly spend trend over 6 months) using Recharts. Feed them aggregated data from your transactions array.
Budget limits and alerts
Add a budget_limit per category. On each transaction add, check if the category total for the month exceeds the limit. Show a warning banner if so.
CSV import
Add a file input that accepts CSV. Parse with PapaParse. Show a preview table of parsed rows. Let the user map columns (date, amount, description) before importing.
AI auto-categorisation
Send the transaction description to Claude Haiku with a list of your categories and ask it to pick the best one. Cache results by description hash to avoid repeat API calls.
Build it with AI — Architect Prompt
Paste this into Claude, Cursor, Windsurf, or any AI coding tool. It includes the full context of this guide — data model, build order, and pitfalls — so the AI starts with everything it needs.
<context> App: Expense Tracker Difficulty: Beginner Estimated build time: 3–5 days Data model: User: id, email, currency, monthly_budget Category: id, user_id, name, icon, color, budget_limit Transaction: id, user_id, category_id, amount, type (income/expense), description, date, recurring (bool), created_at Recommended build order: 1. Transaction list and add form — Build a list of transactions and a form to add one — amount, description, date, type (income/expense). Store in localStorage. No categories yet. 2. Categories and tagging — Add a categories table with name, icon, and color. Add a category selector to the add form. Seed 10 default categories (food, transport, bills, etc.). 3. Monthly summary cards — Calculate total income, total expenses, and net savings for the current month. Display as three KPI cards at the top of the dashboard. Filter by month using date range. 4. Charts — Add a donut chart (spending by category) and a bar chart (monthly spend trend over 6 months) using Recharts. Feed them aggregated data from your transactions array. 5. Budget limits and alerts — Add a budget_limit per category. On each transaction add, check if the category total for the month exceeds the limit. Show a warning banner if so. 6. CSV import — Add a file input that accepts CSV. Parse with PapaParse. Show a preview table of parsed rows. Let the user map columns (date, amount, description) before importing. 7. AI auto-categorisation — Send the transaction description to Claude Haiku with a list of your categories and ask it to pick the best one. Cache results by description hash to avoid repeat API calls. Known pitfalls to avoid: - Using floats for money — 0.1 + 0.2 = 0.30000000000000004 in JavaScript. Store amounts as integers (cents) and divide by 100 for display only. - Ignoring timezone — a transaction at 11pm UTC might show as the next day for a user in New York. Store dates as date strings (YYYY-MM-DD), not timestamps, unless you need exact times. - Not handling negative amounts on CSV import — bank exports often use negative numbers for debits. Normalise to positive amounts with a type field on import. Tech stack (intermediate): Next.js + Supabase + Claude API for AI categorisation + Recharts </context> <role> You are a Senior Full-Stack Engineer and product architect who has shipped production Expense Trackers before. You know exactly where developers get stuck and how to structure the project to avoid rewrites. </role> <task id="step-1-clarify"> Before writing any code or spec, ask me 3–5 clarifying questions that will meaningfully change the architecture. Focus on: scale expectations, auth requirements, platform (web / mobile / both), must-have vs nice-to-have features for the MVP, and any hard constraints (budget, deadline, existing infrastructure). <example> BAD: "What tech stack do you want to use?" — too broad, doesn't change architecture decisions. GOOD: "Do you need real-time sync across devices, or is single-device with periodic refresh acceptable? This decides whether we use WebSockets or simple REST polling and significantly affects infrastructure complexity." </example> </task> <task id="step-2-architect"> After I answer your questions, generate a complete project specification including: 1. Final tech stack with version numbers 2. Full file and folder structure 3. Complete database schema — every table, column, type, index, and foreign key 4. All API routes with request/response shapes and auth requirements 5. Component tree with TypeScript props interfaces 6. Auth and authorisation flow (who can do what) 7. Step-by-step implementation plan in the exact build order from <context> above 8. All environment variables with descriptions <self_check> Before presenting the spec, verify: □ Every answer I gave in step 1 is reflected in the spec □ The database schema matches the data model in <context> □ The implementation plan follows the build order from <context> □ No circular dependencies in the component tree □ Auth is wired up before any protected routes are built □ All known pitfalls from <context> are addressed in the spec </self_check> </task> <task id="step-2.5-agents-md"> Generate an AGENTS.md file at the project root. This file is read automatically by Claude Code, Cursor, Windsurf, Sourcegraph Cody, and all major AI coding tools at the start of every session. Include: - Project overview (2–3 sentences) - Tech stack with version numbers - Folder structure with one-line descriptions - Key architectural decisions and why they were made - Coding conventions: naming (camelCase components, kebab-case files), max 200 lines per file, one concern per file - Available commands: dev, build, test, lint, db:migrate, db:seed Note in the file: "Cursor users can symlink .cursorrules → AGENTS.md. Claude Code users can symlink CLAUDE.md → AGENTS.md." </task> <task id="step-3-implement"> Implement the full project following the spec from step 2, in the exact order defined. For each step: - Write the complete code (no placeholders or TODOs) - Confirm the step is working before moving to the next - Note any deviations from the spec with an explanation <constraints> - Max 200 lines per file. WHY: every file must fit in one AI context window for easy review and editing. - One concern per file. WHY: mixing auth logic into API routes makes it impossible to reuse — extract to lib/auth.ts. - TypeScript strict mode, no `any` types. WHY: catches data shape mismatches at compile time, not in production at 2am. - All database queries in server components or API routes only. WHY: keeps credentials server-side, prevents accidental client-side exposure. - All environment variables documented in .env.example. WHY: the next developer (or your future self) should be able to set up the project in under 5 minutes. - Comment every non-obvious decision. WHY: AI tools read your comments to understand intent — without them, the next edit will break the pattern you established. </constraints> </task>
How to use this prompt
- 1.Copy the prompt above
- 2.Open Claude, Cursor (Cmd+L), or Windsurf
- 3.Paste the prompt and send — the AI will ask 3–5 clarifying questions
- 4.Answer the questions, then it generates your full project spec
- 5.Continue in the same session to implement step by step
Common mistakes
What trips up most developers building this for the first time.
Using floats for money — 0.1 + 0.2 = 0.30000000000000004 in JavaScript. Store amounts as integers (cents) and divide by 100 for display only.
Ignoring timezone — a transaction at 11pm UTC might show as the next day for a user in New York. Store dates as date strings (YYYY-MM-DD), not timestamps, unless you need exact times.
Not handling negative amounts on CSV import — bank exports often use negative numbers for debits. Normalise to positive amounts with a type field on import.
Recommended tech stack
Pick the level that matches your experience.
React + Chart.js + localStorage — charts working in a day, no backend
Next.js + Supabase + Claude API for AI categorisation + Recharts
Next.js + Plaid API (bank sync) + Supabase + Stripe — full fintech stack
Take it further — related ideas
Each comes with revenue math, a full build guide, and a prompt to paste into Claude or Cursor.
9 ideas in the archive
ContractPulse - Vendor Renewal and Health Monitor for Bootstrapped SaaS Teams
Small SaaS teams routinely lose money on zombie vendor contracts because no one owns the renewal calendar. ContractPulse ingests your vendor invoices and emails, surfaces upcoming renewals, flags price drift, and sends Slack alerts 30 days out. It's the CFO dashboard you couldn't afford to hire.
PodCraft MCP - Live Podcast Research Context Server for Claude and Cursor
Podcast hosts prep for interviews by spending 3 hours reading old episodes and guest bios. PodCraft is an MCP server that ingests your podcast RSS feed, transcribes episodes, and gives Claude or Cursor instant access to your entire show history as searchable context — so you can ask Claude to write episode briefs, generate guest questions, or find contradictions across 200 episodes in 10 seconds.
GradePath - Micro-Skill Gap Assessor That Tells Employees Exactly What to Learn Next
Your L&D budget is $50k and your team is still watching the same generic LinkedIn Learning videos from 2021. GradePath is a 10-minute skill assessment tool that maps each employee's actual gaps against their role requirements and spits out a personalized 90-day learning path — no HR consultant required.
TokenGuard - Claude API Cost Firewall Before You Hit $2000
Claude's context window is a gift until your bill arrives and you're explaining a four-figure charge to your accountant. TokenGuard is a browser extension that wraps every Claude.ai and API call with real-time token counting, running cost display, and hard spending limits you actually control.
VenueYield - Dynamic Seat Pricing Engine for Independent Event Venues
Independent music venues and comedy clubs are still pricing tickets in spreadsheets while StubHub scalpers print money on the delta. VenueYield is a plug-and-play dynamic pricing engine that watches demand signals and automatically adjusts ticket prices to maximize revenue without alienating regulars.
DeckGrade - AI Pitch Deck Structure Grader That Thinks Like a VC Partner
You spent three weeks on your pitch deck and the only feedback you got was 'needs more traction' from a friend who has never raised money. DeckGrade analyzes your deck slide by slide against proven VC narrative frameworks and tells you exactly which slides are killing your chances before you send the cold email.
EquityLens - Bloomberg-Grade Financial Insights for Retail Investors at $15/Month
Retail investors are tired of squinting at Yahoo Finance tables and paying $400/month for Bloomberg they can't afford. EquityLens surfaces clean quarterly revenue, EPS, and FCF trend charts for 200+ stocks, built for humans not hedge funds.
RedditLense - Automated Reddit Prospect Radar with CRM Sync
Your SDRs are spending three hours per day manually scrolling Reddit looking for buying signals like 'anyone recommend a tool for X' — that is a $90/hour problem dressed up as a $15/hour task. RedditLense monitors keyword-triggered Reddit posts in real-time, scores each post for buyer intent using NLP, and pushes warm leads directly into HubSpot or a Pipedrive webhook. First five SDRs pay $99/month each before you write a single line of marketing copy.
PrivacyGuard - PII Detection Layer Before Your Prompts Hit Any LLM
Every dev team has that one paranoid colleague who refuses to paste client data into ChatGPT — turns out they are right and everyone else is wrong. PrivacyGuard sits between your team and any LLM, scans outbound prompts for PII and sensitive data in real-time, and optionally reroutes flagged prompts to a self-hosted Ollama instance. Ship this to one fintech or law-adjacent SaaS team and charge $500/month before lunch.