A full end-to-end Flask + Bootstrap + OpenAI + SQLite project you can run in VSCode.

- User registration and login
- Add, edit, and delete expenses
- Monthly budget tracking
- Dashboard with charts
- Automatic AI category suggestion when category is left blank
- AI-generated spending insights and recommendations
- SQLite database for easy local setup
- Flask
- Flask-Login
- Flask-SQLAlchemy
- Bootstrap 5
- Chart.js
- OpenAI API
- SQLite
ai_expense_tracker/
│── app.py
│── requirements.txt
│── .env.example
│── README.md
│── instance/
│── static/
│ └── css/
│ └── styles.css
└── templates/
├── base.html
├── index.html
├── login.html
├── register.html
├── dashboard.html
├── add_expense.html
├── edit_expense.html
└── insights.htmlpython -m venv venvWindows PowerShell
venv\Scripts\Activate.ps1Windows CMD
venv\Scripts\activateMac/Linux
source venv/bin/activatepip install -r requirements.txtCopy .env.example to .env and add your key:
SECRET_KEY=super-secret
OPENAI_API_KEY=your_openai_api_key_here
OPENAI_MODEL=gpt-4.1-minipython app.pyThen open:
http://127.0.0.1:5000- The app works without an OpenAI key for normal expense tracking.
- AI category suggestion and AI insights need
OPENAI_API_KEY. - Database file is automatically created in
instance/app.db.
Built a full-stack AI Expense Tracker with Flask, Bootstrap, SQLite, and OpenAI API, supporting authentication, expense CRUD workflows, chart-based analytics, monthly budget tracking, and AI-generated financial insights.