Clone This App Tutorial
Build an Expense Tracker
Create a functional expense tracking app with categories, charts, and local storage. Track your spending like a pro.
What You'll Build
Features
- Add/edit/delete expenses
- Categorize transactions
- Monthly and yearly totals
- Visual charts and graphs
- Data persists in localStorage
- Filter by date and category
- Export to CSV
You'll Learn
- JavaScript fundamentals
- Working with forms
- LocalStorage for data persistence
- Array methods (filter, reduce, map)
- Chart.js for visualizations
- Date handling in JavaScript
Prerequisites
- Claude Code installed and working
- Completed the Starter Kit setup
- Basic understanding of HTML structure
1
Set Up the Project
Create a new project and get the basic structure in place.
mkdir expense-tracker
cd expense-tracker
claude
Paste this prompt:
Create an expense tracker app with these features:
1. A form to add expenses with:
- Amount (number input)
- Description (text input)
- Category dropdown (Food, Transport, Entertainment, Shopping, Bills, Other)
- Date picker (defaults to today)
2. A list showing all expenses with:
- Amount, description, category, and date
- Delete button for each item
- Edit functionality
3. A summary section showing:
- Total spent this month
- Breakdown by category
4. Store all data in localStorage so it persists after refresh.
Use HTML, Tailwind CSS, and vanilla JavaScript. Create a single index.html file. Make it look clean and modern with a dark theme.
2
Add Charts
Visualize your spending with interactive charts.
Paste this prompt:
Add Chart.js to visualize the expense data:
1. A pie chart showing spending breakdown by category
2. A bar chart showing daily spending for the current month
Include the Chart.js CDN and make sure the charts update automatically when expenses are added or deleted. Use colors that match the dark theme.
3
Add Filtering
Let users filter expenses by date range and category.
Paste this prompt:
Add filtering functionality:
1. A date range picker (start date and end date)
2. A category filter dropdown (All, Food, Transport, etc.)
3. A "Clear filters" button
When filters are applied:
- Update the expense list to only show matching items
- Update the summary totals
- Update the charts
Make sure filters can be combined (e.g., show only Food expenses from last week).
4
Add Edit Functionality
Allow users to edit existing expenses.
Paste this prompt:
Add the ability to edit expenses:
1. Add an "Edit" button next to each expense
2. When clicked, populate the form with that expense's data
3. Change the "Add" button to "Update" when editing
4. Add a "Cancel" button to exit edit mode
5. When "Update" is clicked, save the changes and refresh the list
Make sure the UI clearly indicates when you're in edit mode vs add mode.
5
Add Export Feature
Let users download their expense data.
Paste this prompt:
Add an "Export to CSV" button that:
1. Generates a CSV file with all expenses (or filtered expenses if filters are active)
2. Includes columns: Date, Description, Category, Amount
3. Downloads the file with a name like "expenses-2025-01.csv"
Also add an "Export to JSON" option for backing up all data.
6
Polish the UI
Make it look professional with animations and feedback.
Paste this prompt:
Polish the expense tracker UI:
1. Add smooth animations when items are added/deleted
2. Show a success toast when an expense is added
3. Add a confirmation dialog before deleting
4. Add loading states where appropriate
5. Make sure empty states look good (no expenses yet)
6. Add subtle hover effects on interactive elements
7. Ensure it looks great on mobile
Bonus Ideas
- Add budget limits per category with warnings
- Add recurring expenses (monthly bills)
- Add income tracking for net savings
- Add multiple currency support
- Sync data to Supabase for multi-device access
- Add tags for more detailed categorization
Get the Complete Tutorial
Includes finished code, additional features, and video walkthrough.
Buy Now — $29