Budget tracker web app
Track income and expenses in the browser with categories, monthly filters and a chart; data stays on your device.
Beginnerโฑ 5โ8 hours๐ช 7 stepsHTMLCSSJavaScriptChart.js
What you'll learn
- โForms and validation
- โArray methods (filter, map, reduce)
- โCharts with Chart.js
What you'll build
- โAdd income/expense with category and date
- โBalance, income and expense totals
- โFilter by month and category
- โDoughnut chart by category
Step-by-step guide
- 1
Form
Inputs for description, amount, type (income/expense), category, date; validate amount > 0.
- 2
Store transactions
An array of objects saved to localStorage as JSON after every change.
- 3
Totals
Use reduce to sum income and expense; balance = income โ expense; format with Intl.NumberFormat("en-IN", {style: "currency", currency: "INR"}).
- 4
List and delete
Render the list newest first with a delete button using the item's id.
- 5
Filters
A month input and category select; derive the visible list with filter.
- 6
Chart
Add Chart.js from a CDN and draw a doughnut chart of expenses by category; update it on every change.
- 7
Export
Download the data as CSV using a Blob and an <a download> link.
๐ Make it stand out
- +Recurring transactions
- +Import CSV
- +Sync to a backend later