Home
Softono
monthly-expenses-tracker

monthly-expenses-tracker

Open source MIT Python
14
Stars
2
Forks
0
Issues
2
Watchers
3 months
Last Commit

About monthly-expenses-tracker

A Python Flask web app for tracking monthly income and expenses โ€” featuring a dark admin dashboard, category charts, CSV export, and local JSON storage.

Platforms

Web Self-hosted

Languages

Python

Links

๐Ÿ’ฐ Monthly Expenses Tracker (Flask Web App)

A clean, modern web dashboard to track monthly income and expenses โ€” built with Flask and local JSON storage.


Python Flask License GitHub stars GitHub forks GitHub issues

๐Ÿ“Œ Overview

Monthly Expenses Tracker (Web) is a Flask-based web application that provides a modern admin dashboard for managing monthly budgets. It is a full migration of the original Python CLI tool into a browser-based interface โ€” no databases or external services required.

This project demonstrates:

  • Flask web application structure (Blueprint, app factory pattern)
  • Jinja2 templating with a shared base layout
  • File-based data persistence (JSON)
  • Separation of concerns: routes, data logic, templates, and static assets

โœจ Features

  • ๐Ÿ“Š Live dashboard with stat cards and a spending doughnut chart
  • โž• 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 all data
  • ๐ŸŽจ Dark theme UI with no external CSS framework dependencies

๐Ÿงฐ Tech Stack Used

  • Backend: Python, Flask 3.0+
  • Templating: Jinja2
  • Frontend: HTML5, CSS3, Vanilla JavaScript
  • Charts: Chart.js (CDN)
  • Data Storage: JSON (local filesystem)

๐Ÿš€ Getting Started (Local Setup)

๐Ÿ› ๏ธ Prerequisites

  • Python 3.8+ installed

๐Ÿ“ฆ Installation

git clone https://github.com/NHasan143/monthly-expenses-tracker.git
cd monthly-expenses-tracker
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

โ–ถ๏ธ Usage

Run the development server:

python run.py

Then open your browser and go to:

http://localhost:5000

โš ๏ธ If port 5000 is in use change the port in run.py:

app.run(debug=True, port=5001)

๐Ÿ—‚๏ธ Project Structure

monthly-expenses-tracker/
โ”œโ”€โ”€ run.py                        # App entry point
โ”œโ”€โ”€ requirements.txt              # Python dependencies
โ”œโ”€โ”€ budget_data.json              # Local data storage (auto-created)
โ””โ”€โ”€ app/
    โ”œโ”€โ”€ __init__.py               # Flask app factory
    โ”œโ”€โ”€ routes.py                 # All URL routes (Blueprint)
    โ”œโ”€โ”€ data.py                   # Data logic: load, save, calculate
    โ”œโ”€โ”€ templates/
    โ”‚   โ”œโ”€โ”€ base.html             # Shared layout (sidebar, topbar, flash messages)
    โ”‚   โ”œโ”€โ”€ dashboard.html        # Stat cards, chart, recent expenses
    โ”‚   โ”œโ”€โ”€ expenses.html         # Full expense table with edit/delete
    โ”‚   โ””โ”€โ”€ settings.html        # Salary update, CSV export, data reset
    โ””โ”€โ”€ static/
        โ”œโ”€โ”€ css/
        โ”‚   โ””โ”€โ”€ main.css          # All styles (variables, layout, components)
        โ””โ”€โ”€ js/
            โ”œโ”€โ”€ modals.js         # Shared modal open/close logic
            โ”œโ”€โ”€ dashboard.js      # Chart.js doughnut chart
            โ””โ”€โ”€ expenses.js       # Edit modal population

๐Ÿ’พ Data Storage

This project uses a local JSON file (budget_data.json) to store income and expenses. All financial data is kept on your machine, making the application:

  • Easy to reset (delete the JSON file and restart)
  • Transparent and portable
  • Suitable for fully offline use

๐Ÿ“„ Pages

Route Page Description
/ Dashboard Overview with stats, chart, and recent expenses
/expenses Expenses Full table with add, edit, and delete
/settings Settings Update salary, export CSV, reset all data
/export โ€” Downloads budget_export.csv directly

๐Ÿ”ฎ Roadmap & Future Enhancements

  • [Added] Flask web interface dashboard
  • [Added] Spending breakdown by category with chart
  • [Added] Edit existing expenses
  • [Added] Export summary to CSV
  • [Added] Savings rate calculation
  • [ ] User authentication (login/logout)
  • [ ] Monthly history (track across multiple months)
  • [ ] Mobile responsive layout
  • [ ] Dark/light theme toggle

๐Ÿค Contributing

Contributions are welcome.

  1. Fork the repo
  2. Create a branch: git checkout -b feature/my-change
  3. Commit changes: git commit -m "Add my change"
  4. Push: git push origin feature/my-change
  5. Open a Pull Request

๐Ÿ“„ License

Licensed under the MIT License. See LICENSE.


๐Ÿ‘ค Author

Naymul Hasan GitHub: https://github.com/NHasan143