A comprehensive database management system for tracking personal finances, expenses, budgets, and recurring payments with powerful analytics and reporting capabilities.
- Overview
- Features
- Tech Stack
- Database Architecture
- Installation
- Usage
- API Documentation
- Project Structure
- Documentation
- Screenshots
- Contributing
- Future Enhancements
- License
This project is a Personal Finance Management System built using MySQL database. It helps users track their daily expenses and income across multiple accounts (like bank accounts, cash, credit cards).
Think of it as a digital notebook where you record every rupee you spend or earn. The system automatically:
- Updates your account balances
- Categorizes your spending (food, transport, entertainment, etc.)
- Creates monthly reports showing where your money goes
- Warns you if you're exceeding your budget
- Manages recurring payments like subscriptions
The database is properly normalized (follows 1NF, 2NF, 3NF rules) to avoid data redundancy. It uses triggers to automatically update balances and stored procedures to generate complex reports efficiently.
A full-stack financial management application with a robust MySQL relational database backend. The system implements:
- Multi-account management with real-time balance tracking
- Double-entry transaction logging for data integrity
- Many-to-many tagging system for flexible expense categorization
- Budget monitoring with threshold alerts
- Recurring payment automation using scheduled tasks
- Complex analytical queries for financial insights
- Database triggers for automatic balance updates and constraint validation
- Stored procedures for report generation and data aggregation
- RESTful API built with Flask/Node.js
- Normalized schema (3NF) with proper indexing strategies
- Personal Budget Management: Track monthly spending across categories
- Multi-Account Consolidation: Manage cash, multiple bank accounts, credit cards in one place
- Financial Goal Tracking: Monitor savings progress and budget adherence
- Tax Preparation: Generate annual expense reports by category
- Subscription Management: Track and predict recurring payments
- Split Expense Tracking: Tag transactions for shared expenses with roommates/family
- Financial Analytics: Understand spending patterns with visual reports
- Data Integrity: Proper DBMS principles ensure no financial data is lost or corrupted
- Scalability: Normalized schema handles thousands of transactions efficiently
- Automation: Triggers and procedures reduce manual work and human errors
- Privacy: Self-hosted solution keeps sensitive financial data secure
- Learning Value: Demonstrates real-world application of DBMS concepts (normalization, ACID properties, stored procedures, triggers, indexing)
- Professional Portfolio: Showcases database design, backend development, and system architecture skills
- β Multi-Account Management - Track cash, bank accounts, credit cards, digital wallets
- β Transaction Tracking - Record income and expenses with detailed metadata
- β Category Management - Organize transactions with custom categories
- β Flexible Tagging - Add multiple tags to transactions for cross-category analysis
- β Budget Planning - Set monthly/yearly budgets per category with alerts
- β Recurring Payments - Automate tracking of subscriptions and regular bills
- β Real-time Balance Updates - Automatic balance calculation using triggers
- β Negative Balance Prevention - Database-level constraints for data integrity
- π Monthly Summary Reports - Income vs Expense breakdowns
- π Category-wise Analysis - Spending patterns by category
- π‘ Budget vs Actual - Compare planned vs actual spending
- π Transaction Search - Filter by date, category, tags, accounts
- π Recurring Payment Dashboard - View upcoming bills
- π ACID Compliance - Ensures transaction reliability
- ποΈ 3NF Normalized Schema - Eliminates data redundancy
- β‘ Optimized Indexes - Fast query performance
- π Automatic Triggers - Balance updates and validation
- π¦ Stored Procedures - Complex report generation
- π User Authentication - Secure multi-user support
- MySQL 8.0+ - Relational database management system
- MySQL Workbench - Database design and administration
- Python 3.8+ - Primary programming language
- Flask 2.0+ - Web framework for REST API
- SQLAlchemy - ORM for database interactions
- PyMySQL - MySQL database connector
- React.js - UI framework
- Chart.js - Data visualization
- Axios - API client
- Git - Version control
- Postman - API testing
- Draw.io - ER diagram creation
- VSCode - Code editor
The system uses 8 core tables with proper relationships:
Users β Accounts β Transactions β Categories
β
Transaction_Tags
β
Tags
Budgets (linked to Users + Categories)
Recurring_Payments (linked to Users + Categories)
Key Relationships:
- One User β Many Accounts (1:N)
- One Account β Many Transactions (1:N)
- One Category β Many Transactions (1:N)
- Many Transactions β Many Tags (M:N via Transaction_Tags)
- One User β Many Budgets (1:N)
See ER_DIAGRAM.md for detailed entity-relationship documentation.
# MySQL 8.0 or higher
mysql --version
# Python 3.8 or higher
python --version
# pip package manager
pip --versiongit clone https://github.com/yourusername/personal-finance-tracker.git
cd personal-finance-tracker# Windows
python -m venv venv
venv\Scripts\activate
# Linux/Mac
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txt# Create MySQL database
mysql -u root -p
# In MySQL prompt:
CREATE DATABASE finance_tracker;
EXIT;mysql -u root -p finance_tracker < database/schema.sql
mysql -u root -p finance_tracker < database/procedures.sql
mysql -u root -p finance_tracker < database/triggers.sql
mysql -u root -p finance_tracker < database/seed_data.sqlCreate .env file in project root:
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=finance_tracker
SECRET_KEY=your_secret_key_here# Start Flask server
python app.py
# Server runs on http://localhost:5000curl -X POST http://localhost:5000/api/accounts \
-H "Content-Type: application/json" \
-d '{
"user_id": 1,
"account_name": "Main Bank Account",
"account_type": "bank",
"balance": 50000.00
}'curl -X POST http://localhost:5000/api/transactions \
-H "Content-Type: application/json" \
-d '{
"account_id": 1,
"category_id": 2,
"amount": 500.00,
"type": "expense",
"description": "Grocery shopping",
"tags": ["food", "essential"]
}'curl http://localhost:5000/api/reports/monthly?month=11&year=2025See API_DOCUMENTATION.md for complete API reference.
POST /api/auth/register Register new user
POST /api/auth/login User login
GET /api/accounts List all accounts
POST /api/accounts Create new account
PUT /api/accounts/:id Update account
DELETE /api/accounts/:id Delete account
GET /api/transactions List transactions (with filters)
POST /api/transactions Add transaction
PUT /api/transactions/:id Update transaction
DELETE /api/transactions/:id Delete transaction
GET /api/categories List all categories
POST /api/categories Create category
GET /api/reports/monthly Monthly summary
GET /api/reports/category Category breakdown
GET /api/reports/budget-status Budget vs actual
GET /api/recurring List recurring payments
POST /api/recurring Add recurring payment
PUT /api/recurring/:id Update recurring payment
DELETE /api/recurring/:id Delete recurring payment
Full API documentation with request/response examples: API_DOCUMENTATION.md
personal-finance-tracker/
β
βββ app.py # Flask application entry point
βββ requirements.txt # Python dependencies
βββ .env.example # Environment variables template
βββ README.md # This file
β
βββ database/ # Database files
β βββ schema.sql # Table definitions
β βββ procedures.sql # Stored procedures
β βββ triggers.sql # Database triggers
β βββ seed_data.sql # Sample data
β βββ indexes.sql # Index definitions
β
βββ docs/ # Documentation
β βββ ER_DIAGRAM.md # Entity-Relationship diagram
β βββ NORMALIZATION.md # Normalization explanation
β βββ DFD.md # Data Flow Diagrams
β βββ USE_CASES.md # Use case diagrams
β βββ SEQUENCE_DIAGRAMS.md # Sequence diagrams
β βββ FLOWCHARTS.md # Process flowcharts
β βββ API_DOCUMENTATION.md # API reference
β βββ VIVA_QUESTIONS.md # Interview questions
β βββ TEACHER_GUIDE.md # Professor-friendly explanation
β
βββ api/ # Flask API routes
β βββ __init__.py
β βββ auth.py # Authentication routes
β βββ accounts.py # Account management
β βββ transactions.py # Transaction routes
β βββ categories.py # Category routes
β βββ reports.py # Report generation
β βββ recurring.py # Recurring payments
β
βββ models/ # Database models (SQLAlchemy)
β βββ __init__.py
β βββ user.py
β βββ account.py
β βββ transaction.py
β βββ category.py
β βββ tag.py
β βββ budget.py
β
βββ utils/ # Helper functions
β βββ __init__.py
β βββ db.py # Database connection
β βββ validators.py # Input validation
β βββ helpers.py # Utility functions
β
βββ tests/ # Unit tests
βββ test_accounts.py
βββ test_transactions.py
βββ test_reports.py
Comprehensive documentation is available in the docs/ folder:
| Document | Description |
|---|---|
| ER_DIAGRAM.md | Complete ER diagram with entity descriptions |
| NORMALIZATION.md | Normalization process (1NF β 2NF β 3NF) |
| DFD.md | Data Flow Diagrams (Level 0, 1, 2) |
| USE_CASES.md | Use case diagrams and descriptions |
| SEQUENCE_DIAGRAMS.md | Sequence diagrams for key flows |
| FLOWCHARTS.md | Process flowcharts |
| API_DOCUMENTATION.md | Complete API reference |
| VIVA_QUESTIONS.md | 20+ viva questions with answers |
| TEACHER_GUIDE.md | Professor-friendly project explanation |
Main dashboard showing account balances, recent transactions, and spending summary
Detailed transaction history with filtering and search
Visual analytics with category breakdown and budget comparison
Budget creation and monitoring interface
Contributions are welcome! Please follow these guidelines:
- Fork the repository
git clone https://github.com/yourusername/personal-finance-tracker.git- Create a feature branch
git checkout -b feature/your-feature-name-
Make your changes
- Write clean, documented code
- Follow existing code style
- Add tests for new features
-
Commit your changes
git commit -m "Add: Description of your feature"- Push to your fork
git push origin feature/your-feature-name- Open a Pull Request
- Describe your changes
- Reference any related issues
- Wait for review
- Follow PEP 8 for Python code
- Use meaningful variable names
- Add comments for complex logic
- Write docstrings for functions
- Use GitHub Issues
- Provide clear description
- Include steps to reproduce
- Add relevant logs/screenshots
- π€ AI-based Auto-categorization - Machine learning to automatically categorize transactions
- π Predictive Analytics - Forecast future expenses based on historical data
- π‘ Smart Budget Recommendations - AI suggests optimal budget allocations
- π¦ Bank API Integration - Automatic transaction import from banks
- π UPI Payment Tracking - Real-time capture of UPI transactions
- π§ Email Bill Parsing - Extract transaction data from email receipts
- π± SMS Parser - Auto-capture transactions from bank SMS
- πΈ OCR Bill Scanning - Scan and extract data from paper receipts
- π Multi-currency Support - Track expenses in different currencies
- π₯ Shared Budgets - Family/roommate expense splitting
- π― Financial Goals - Savings goal tracking with milestones
- π Investment Tracking - Monitor stocks, mutual funds, crypto
- π° Net Worth Calculator - Assets vs liabilities tracking
- π Spending Trends - Year-over-year comparison
- π Smart Alerts - Unusual spending detection
- π± Mobile App (React Native) - iOS and Android apps
- π Web Dashboard - Rich web interface with React
- π End-to-end Encryption - Enhanced data security
- βοΈ Cloud Sync - Multi-device synchronization
This project is licensed under the MIT License - see the LICENSE file for details.
Your Name
- GitHub: @yourusername
- LinkedIn: Your Name
- Email: [email protected]
- MySQL documentation and community
- Flask framework developers
- Database design best practices from academic resources
- Open source community for inspiration
If you found this project helpful:
- β Star this repository
- π Report bugs via Issues
- π‘ Suggest features
- π€ Contribute via Pull Requests
Built with β€οΈ using MySQL, Python, and Flask
Personal Finance & Expense Tracker | MySQL + Python + Flask
Engineered a production-grade financial management system with MySQL backend, implementing normalized database schema (3NF), automated triggers for real-time balance updates, and stored procedures for complex analytical queries. Developed RESTful API with Flask supporting multi-account management, budget tracking, and recurring payment automation. Demonstrated expertise in database design, transaction management, indexing optimization, and backend architecture, managing 8+ interconnected tables with proper referential integrity and ACID compliance.