# 4 · Personal finance tracker (local-only)

**Time:** ~45 min · **Level:** beginner · **Needs:** an AI tool, a browser, and (optional) a CSV of your own expenses
**Educational only. Not financial advice.**

## Goal
A single-page expense and savings tracker that runs **only in your browser**: no accounts, no bank connections, no server. Data stays in your browser's storage and can be exported.

## Prompt (paste this)
```text
Build a single-file local-first personal finance tracker: tracker.html (HTML + CSS + JS,
no libraries, no external requests, no analytics).

Features:
- Add a transaction: date, amount, category, note. Income positive, expenses negative.
- Import a CSV (columns: date, amount, category, note) and export all data to CSV.
- Monthly summary: income, expenses, net, savings rate (net / income), and a bar chart by category (canvas).
- A "goal" box: target amount and monthly saving; show projected months to goal using plain
  arithmetic, with the formula visible. Offer an optional "assumed yearly growth %" input defaulting to 0.
- Data is stored ONLY in localStorage. Add a visible "Delete all data" button with confirmation.
- Show this text in the footer: "Educational tool. Not financial advice. Data stays in this browser."
- Currency symbol configurable (default: [YOUR CURRENCY]).

Safety rules for the code: never ask for bank credentials, never make network requests,
escape all user text (no innerHTML with raw input), validate numbers and dates.
Dark theme, responsive. Under ~300 lines. Include 5 sample rows of fake data behind a
"Load demo data" button. Output the full file.
```

## Expected result
A page where you can add or import transactions and see monthly totals, savings rate, a category chart and a goal projection, all offline.

## Troubleshooting
- **CSV import fails:** check that the header row is exactly `date,amount,category,note` and dates are `YYYY-MM-DD`. Ask the AI: "Make the importer show which row failed."
- **Numbers look wrong:** test with the demo data and a calculator; ask the AI to print its formulas.
- **Data disappeared:** localStorage is per browser and per file location. Export CSV regularly.
- **Want charts per month or budgets?** Add one feature at a time.
- **Privacy:** don't upload real statements to a chat tool; test with fake data, then use the finished file offline with your real numbers.

*Tested on: not yet tested (we'll update this)*
