A clean, minimal web dashboard to track monthly income and expenses — built with Flask and SQLite.
- Dashboard with stat cards and spending charts
- Add, edit, and delete expenses via modal forms
- Category-based spending breakdown with progress bars
- Savings rate calculation
- Export full summary to CSV
- Settings page to update salary and reset data
- Dark / light theme toggle
- User authentication (register, login, password reset)
- Backend: Python, Flask 3.0+
- Database: SQLite (local file —
users.db) - Templating: Jinja2
- Frontend: HTML5, CSS3, Vanilla JavaScript
- Charts: Chart.js, D3.js
- Python 3.8+
git clone <your-repo-url>cd monthly-expenses-trackerpython -m venv .venv
source .venv/bin/activate # macOS / Linux
.venv\Scripts\activate # Windowspip install -r requirements.txtCreate a .env file in the project root:
FLASK_SECRET_KEY=your-secret-key-hereGenerate a secure secret key:
python -c "import secrets; print(secrets.token_hex(32))"Mail variables are optional — only needed if you want password reset emails to work:
MAIL_SERVER=smtp.gmail.comMAIL_PORT=587MAIL_USE_TLS=trueMAIL_USERNAME=you@gmail.comMAIL_PASSWORD=your-app-passwordMAIL_DEFAULT_SENDER=you@gmail.com
python run.pyOpen your browser at:
http://localhost:5001
The SQLite database (users.db) is created automatically on first run.
monthly-expenses-tracker/
├── run.py # App entry point
├── requirements.txt # Python dependencies
├── .env # Environment variables (not committed)
├── users.db # SQLite database (auto-created)
└── app/
├── __init__.py # Flask app factory
├── routes.py # Main routes (Blueprint)
├── auth.py # Auth routes (login, register, reset)
├── models.py # SQLAlchemy models
├── data.py # Data logic
├── email_utils.py # Password reset email
├── templates/
│ ├── base.html # Shared layout
│ ├── dashboard.html # Stats and charts
│ ├── expenses.html # Expense table
│ ├── settings.html # Settings page
│ ├── login.html
│ ├── register.html
│ ├── forgot_password.html
│ └── reset_password.html
└── static/
├── css/
│ ├── main.css
│ └── auth.css
├── js/
│ ├── modals.js
│ ├── dashboard.js
│ ├── expenses.js
│ ├── monthly_chart.js
│ └── gsap_animations.js
└── Assets/
└── logo.svg
| Route | Page | Description |
|---|---|---|
/ | Dashboard | Overview with stats and charts |
/expenses | Expenses | Full table with add, edit, delete |
/settings | Settings | Update salary, export CSV, reset data |
/export | — | Downloads budget_export.csv |
/login | Login | Sign in |
/register | Register | Create account |
/forgot-password | Forgot Password | Request reset link |
Licensed under the MIT License. See LICENSE.