A modern web app to track and analyze your expenses by uploading receipt images. Powered by Python Flask, MySQL, and OCR for automatic data extraction!
- Upload Receipts: Snap and upload receipt images—no manual entry needed!
- OCR Extraction: Automatically reads and parses expense data using Tesseract OCR.
- Category Detection: Auto-categorizes expenses for smarter analytics.
- Dashboard: View your latest expenses in a clean, sortable table.
- Download Reports: Export your expense data as PDF reports.
- MySQL Backend: Fast and robust data storage.
Upload Receipt | Dashboard / Analytics |
---|---|
![]() |
![]() |
- Python 3.8+
- MySQL Server
- Tesseract OCR (
sudo apt install tesseract-ocr
or download for Windows) - pip
git clone https://github.com/meruva-lokesh/Expense-Tracker-Using-Python-Flask-MySQL.git
cd Expense-Tracker-Using-Python-Flask-MySQL
pip install -r requirements.txt
- Start your MySQL server.
- Create a database and user:
CREATE DATABASE expense_tracker_db;
CREATE USER 'expense_user'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON expense_tracker_db.* TO 'expense_user'@'localhost';
FLUSH PRIVILEGES;
- Update your
database.py
or.env
with your MySQL credentials.
Create a .env
file for sensitive info (recommended):
DB_HOST=localhost
DB_USER=expense_user
DB_PASSWORD=yourpassword
DB_NAME=expense_tracker_db
SECRET_KEY=your-super-secret-key
python app.py
Visit http://127.0.0.1:5000/ in your browser.
- Push code to GitHub.
- Deploy on a VPS, PythonAnywhere, or cloud provider.
- Set up Gunicorn and (optionally) Nginx for production.
- Point your deployed code to your production MySQL instance.
Expense-Tracker-Using-Python-Flask-MySQL/
│
├── app.py # Main Flask application
├── database.py # MySQL connection and helpers
├── export.py # PDF/CSV export logic
├── templates/ # HTML templates (Jinja2)
├── static/ # CSS, JS, images
├── requirements.txt # Python dependencies
└── README.md
- Backend: Python, Flask
- Database: MySQL
- OCR: pytesseract, Tesseract OCR
- Frontend: HTML5, CSS3, Jinja2 templates
Pull requests welcome! Please open an issue to discuss your proposed changes.
MIT License. See LICENSE.
- Flask
- Tesseract OCR
- ReportLab
- Bootstrap (if used in styling)
Made with 💸 by meruva-lokesh