Back to projects
Projectintermediate 8 steps ~90 min

Expense Tracker

Build an expense tracker that gets money right: integer cents, a defensive amount parser, accessible form validation, derived totals and charts, filters, and saved data with a schema migration.

What you'll build

An expense tracker that adds up exactly, validates kindly, and migrates old saved data.

  • React
  • forms
  • derived state
  • Intl
  • data migrations
Project briefrequirements and design decisions

Requirements

  • Add income and expenses with amount, category, and date
  • Show totals, balance, and per-category summaries
  • Filter by type and category
  • Validate amounts before saving

Architecture decisions

  • Store amounts as integer cents to avoid floating-point errors
  • Totals and summaries are derived with useMemo, never stored
  • Controlled form with validation separated from submission

Stretch goals

  • Monthly budget per category with warnings
  • CSV export
  • Charts of spending over time

Production checklist

  • Currency formatting with Intl.NumberFormat
  • Accessible form errors (aria-invalid, aria-describedby)
  • Persistence and data migration strategy

1What we're building

An expense tracker is a small app with the same problems as a banking or checkout UI: money that must add up exactly, forms that must reject bad input kindly, totals that must never disagree with the list, and saved data that outlives the version of the code that wrote it.

You'll build one with:

  • Add, list, and delete income and expenses, with category and date
  • Totals and a balance, plus a per-category spending chart
  • Filters by type and category
  • Validation with accessible error messages
  • Persistence, including a migration from an older data format
1money.js cents: parseAmount and formatCents 2transactions.js pure logic: validate, summarize, filter 3storage.js load and save with a schema version and a migration 4TransactionForm.jsx controlled form with accessible errors 5TransactionList.jsx the list, with delete 6Summary.jsx totals and category bars 7Filters.jsx type and category filters 8App.jsx state and wiring

What you'll learn: why money is stored in integer cents, parsing user input defensively, separating validation from the form so you can test it, derived state with useMemo, accessible form errors, and versioned localStorage with migrations.

Expense Tracker project | Bloom