A fully functional multi-user expense tracker web app built with Flask, SQLite3, HTML, and CSS. Track your income and expenses with beautiful charts, categorization, and detailed reporting.
- 👤 User Authentication: Secure registration and login system
- 🏠 Personal Dashboard: Overview of total income, expenses, and net balance per user
- 💼 Transaction Management: Add, edit, and delete income/expense transactions
- 🏷️ Category Management: Create and manage custom categories per user
- 📊 Filtering & Reports: Filter transactions by date, type, and category
- 📥 Data Export: Export filtered data to CSV format
- 📈 Charts & Visualization: Monthly income vs expense charts
- 📱 Responsive Design: Works on desktop, tablet, and mobile devices
- 🔒 Data Isolation: Each user has their own separate data
expense-tracker/
├── app.py # Flask backend application
├── requirements.txt # Python dependencies
├── database/
│ └── tracker.db # SQLite database (created automatically)
├── static/
│ ├── css/
│ │ └── style.css # All styling
│ └── js/
│ └── charts.js # Chart visualization code
├── templates/
│ ├── base.html # Base template
│ ├── index.html # Dashboard
│ ├── add.html # Add/Edit transactions
│ ├── categories.html # Category management
│ └── reports.html # Reports and filtering
└── README.md
- Python 3.7 or higher
- pip (Python package installer)
cd expense-tracker
pip install -r requirements.txtpython app.pyOpen your web browser and navigate to:
http://localhost:5000
users (New!)
id(INTEGER PRIMARY KEY)username(TEXT UNIQUE) - Unique usernameemail(TEXT UNIQUE) - User email addresspassword_hash(TEXT) - Hashed passwordcreated_at(TIMESTAMP) - Account creation date
transactions
id(INTEGER PRIMARY KEY)date(TEXT) - Transaction dateamount(REAL) - Transaction amounttype(TEXT) - 'income' or 'expense'category_id(INTEGER) - Foreign key to categoriesdescription(TEXT) - Optional descriptionuser_id(INTEGER) - Foreign key to users (New!)
categories
id(INTEGER PRIMARY KEY)name(TEXT) - Category nameuser_id(INTEGER) - Foreign key to users (New!)- UNIQUE(name, user_id) - Categories are unique per user
budgets (Optional - for future features)
id(INTEGER PRIMARY KEY)month(TEXT) - Month for budgetcategory_id(INTEGER) - Foreign key to categoriesamount_limit(REAL) - Budget limituser_id(INTEGER) - Foreign key to users (New!)
- Click "Add Transaction" from the dashboard or navigation
- Fill in the required fields:
- Date: Transaction date
- Amount: Transaction amount (positive number)
- Type: Income or Expense
- Category: Optional category selection
- Description: Optional description
- Click "Add Transaction" to save
- Go to "Categories" in the navigation
- Add new categories using the form at the top
- Delete categories you no longer need
- Default categories are provided for common expenses
- Go to "Reports" in the navigation
- Use filters to narrow down transactions:
- Type: Income only, Expenses only, or All
- Category: Specific category or All
- Month: Specific month or All
- Year: Specific year or All
- Export filtered data to CSV for external analysis
- Summary Cards: Show total income, expenses, and net balance
- Monthly Chart: Visual representation of income vs expenses over time
- Recent Transactions: Quick view of latest 10 transactions
- Quick Actions: Easy access to common functions
The application is fully responsive and works on:
- Desktop: Full features with optimal layout
- Tablet: Adapted layout with touch-friendly interface
- Mobile: Compact design with essential features
- Backend: Add new routes in
app.py - Frontend: Create new templates in
templates/ - Styling: Modify
static/css/style.css - JavaScript: Extend
static/js/charts.js
- Add new tables or columns in the
init_db()function - Update routes to handle new data
- Modify templates to display new information
- Colors: Modify CSS custom properties in
style.css - Layout: Adjust grid layouts and flexbox configurations
- Typography: Change font families and sizes
- Run with
python app.py - Debug mode enabled by default
- Set
debug=Falseinapp.py - Use a production WSGI server like Gunicorn
- Configure environment variables
- Set up database backups
Create a Dockerfile:
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 5000
CMD ["python", "app.py"]- Budget Tracking: Set and monitor category budgets
- Recurring Transactions: Automate regular income/expenses
- Multi-currency Support: Handle different currencies
- Data Import: Import from bank statements or other apps
- Advanced Charts: More visualization options
- User Authentication: Multi-user support
- Mobile App: Native mobile application
- API: RESTful API for external integrations
Database not found
- The SQLite database is created automatically on first run
- Check that the
database/directory exists
Port already in use
- Change the port in
app.py:app.run(debug=True, port=5001)
Styling not loading
- Ensure static files are served correctly
- Check browser console for 404 errors
Form validation errors
- Ensure JavaScript is enabled in browser
- Check console for JavaScript errors
This project is open source and available under the MIT License.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
For issues or questions:
- Check the troubleshooting section
- Review the code comments
- Test with sample data
- Check browser console for errors
Happy Expense Tracking! 💰📊