A modern, full-stack expense tracking web application built with Flask, SQLite, and Chart.js.
- Dashboard — Today/week/month totals, spending charts, recent transactions
- Add Expense — Form with receipt upload, recurring options
- Ledger — Spreadsheet-style table with search, filter, sort, edit, delete, pagination
- Reports — Daily, weekly, monthly, category-wise reports with charts
- Budget — Set monthly budgets, track usage, warnings at 80% / 100%
- Export — CSV, Excel (.xlsx), PDF report downloads
- Dark / Light mode — Toggle in the topbar
- Fully responsive — Mobile-friendly sidebar + layout
| Layer | Technology |
|---|---|
| Frontend | HTML5, CSS3 (custom), JavaScript |
| Backend | Python 3.10+ / Flask |
| Database | SQLite via Flask-SQLAlchemy |
| Charts | Chart.js 4 |
| Export | openpyxl (Excel), ReportLab (PDF) |
pip install Flask Flask-SQLAlchemy python-dateutil openpyxl reportlab Pillowcd expense-tracker
python app.pyhttp://localhost:5000
The SQLite database (instance/expenses.db) is created automatically on first run.
expense-tracker/
├── app.py # Flask app + all API routes
├── requirements.txt
├── instance/
│ └── expenses.db # SQLite DB (auto-created)
├── static/
│ ├── css/
│ │ └── style.css # All styles (variables, layout, components)
│ ├── js/
│ │ ├── main.js # Global utilities, theme, sidebar, toasts
│ │ ├── dashboard.js # Dashboard charts & stats
│ │ ├── expenses.js # Ledger table, edit, delete, export
│ │ ├── reports.js # All report tabs & charts
│ │ └── budget.js # Budget form & history
│ └── uploads/ # Uploaded receipt images
└── templates/
├── base.html # Shared layout (sidebar, topbar, modal, toast)
├── dashboard.html
├── add_expense.html
├── expenses.html
├── reports.html
└── budget.html
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/expenses |
List expenses (paginated) |
| POST | /api/expenses |
Create expense |
| PUT | /api/expenses/<id> |
Update expense |
| DELETE | /api/expenses/<id> |
Delete expense |
| GET | /api/stats/dashboard |
Dashboard summary stats |
| GET | /api/stats/trends |
6-month spending trends |
| GET | /api/reports/<type> |
daily/weekly/monthly/category |
| GET | /api/budget |
Get budget for month |
| POST | /api/budget |
Set budget |
| GET | /api/budget/history |
All budget records |
| GET | /api/export/csv |
Export as CSV |
| GET | /api/export/excel |
Export as Excel (.xlsx) |
| GET | /api/export/pdf |
Export monthly PDF report |
Food · Travel · Shopping · Bills · Education · Entertainment · Health · Other
Cash · Credit Card · Debit Card · UPI · Net Banking · Other