Build a Monthly Expense Tracker with Budget Bars and Category Totals in One HTML File

Generates a single-file expense tracker that logs spending by category, compares it with a monthly budget using progress bars, and warns when a category is close to its limit. Data stays in the browser.

You getFull HTML file in a single code block, A short test checklist with 6 manual checks and risks and missing information table

The prompt

Prompt
Role: You are a pragmatic front-end engineer who builds privacy-friendly personal finance mini apps.

Context: The user is a graduate student sharing an apartment and tracking day-to-day spending (example value for {user_context}). The decision this tool supports is which spending categories need attention before the month ends. Currency: EUR (example value for {currency}). Categories: Rent, Groceries, Transport, Eating Out, Subscriptions, Other (example value for {categories}). Total monthly budget: 1800 (example value for {monthly_budget}).

Task: Produce one self-contained HTML file with inline CSS and JavaScript that tracks expenses and shows budget progress.

Inputs (confirm or list as assumptions first):
- Expense fields: date, amount, category, optional note
- Budget per category (default: split the total budget evenly, editable)
- Month being viewed, with previous and next month buttons

Workflow:
1. List assumptions separately (week start, how overspending is flagged, behavior when a category has no budget).
2. Build an add-expense form with validation: amount must be a positive number, date required.
3. Show a table of the month's expenses with delete and inline edit, sorted by date.
4. Show per-category cards with spent, budget, remaining and a progress bar that is green below 75%, amber from 75 to 100%, and red above 100%.
5. Show a summary row: total spent, total remaining, average daily spend so far, and projected month-end spend at the current pace.
6. Draw one simple SVG bar or donut chart of spending by category without libraries.
7. Persist all data in localStorage, and add Export CSV and Clear month buttons (confirm before clearing).

Constraints: Offline, no external requests, no analytics. Do not store anything outside localStorage. Escape user-entered notes. Do not use color alone to show status: add text such as 'Near limit' or 'Over budget'. Do not offer financial advice.

Output format:
1. Assumptions (bullets)
2. Full HTML file in a single code block
3. A short test checklist with 6 manual checks
4. Risks and missing information table (risk, impact, next action)
5. Two or three next-step enhancements

Acceptance criteria:
- Adding, editing and deleting an expense updates every total instantly
- The projection is shown only when at least one day of the month has passed
- Category status text and colors match the thresholds
- CSV export opens correctly in a spreadsheet

Quality checks: Walk through a sample month with five expenses across three categories and verify the totals. Confirm that month navigation does not mix data between months, that decimals do not show floating-point errors (round to cents), and that nothing breaks with an empty month.

Dashed parts are example values, so the prompt runs as copied. Change them in Fill in the blanks.

Works best when you give a realistic category list and budget. Test it with sample data first. Data is stored per browser, so export CSV regularly if you want a backup.

Make it repeatable

Keep using this prompt without pasting it in every time.

Prompt details

By
Prompts-GPT editors
Published
How prompts are written and checked

Did this prompt work?

Keep exploring

More in Mini Apps & Tools