SmartSpend AI is a polished Flask web app that turns raw expense CSVs into clear financial insights, interactive charts, and shareable analysis snapshots.
- Website 1: https://smartspend-ai-production.up.railway.app/
- Website 2: https://smartspend-ai-6oiq.onrender.com/
It supports two modes:
- Flask mode (full app): server-side analytics + SQLite persistence.
- Static preview mode: quick Live Server demo using browser storage.
- Modern, recruiter-friendly UI (dark/light theme, animations, responsive layout).
- Strong analytics pipeline from uploaded CSV data.
- Multiple chart views for trends, categories, volatility, and momentum.
- Profile + analysis persistence with SQLite.
- API endpoints for profile and snapshot operations.
- Upload CSV files with date + amount columns (category is optional).
- Data is cleaned, normalized, and transformed into analytics-ready structures.
- Returns dashboard-ready metrics and chart series.
- KPI cards (total, average, prediction, anomalies).
- Trend, category, monthly comparison, scatter, cumulative, rolling, velocity, and volatility views.
- Focus mode for chart cards and rich hover tooltips.
- Save profile details (name, email, occupation, avatar, theme).
- Load existing profile data by email.
- Avatar preview sync across profile/nav.
- SQLite-backed tables:
profilesanalyses
- Analysis snapshots can be saved and revisited.
- Built-in downloadable CSV endpoint using
data/sample_expenses_large.csv.
- Backend: Flask, Pandas, NumPy, scikit-learn, SQLite
- Frontend: HTML, CSS, JavaScript, Chart.js, Font Awesome
- Deployment: Gunicorn + Render
smartspend-ai/
ββ app.py
ββ Procfile
ββ requirements.txt
ββ README.md
ββ index.html # Static Live Server preview page
ββ templates/
β ββ index.html # Flask homepage
β ββ dashboard.html # Dashboard view rendered after upload
β ββ profile.html # Profile page
ββ static/
β ββ css/
β β ββ style.css
β ββ js/
β β ββ app.js
β β ββ index-page.js
β β ββ dashboard-page.js
β β ββ profile-page.js
β ββ images/
β ββ anonymous-avatar.svg
β ββ person_12259248.png
ββ data/
β ββ sample_expenses.csv
β ββ sample_expenses_large.csv
ββ models/
ββ expense_model.pkl
ββ kmeans_model.pkl
- Install dependencies:
pip install -r requirements.txt- Start app:
python app.py- Open:
http://127.0.0.1:5000
- Open project in VS Code.
- Start Live Server from root
index.html. - Use preview flow (localStorage only): sign in, upload CSV, inspect mock dashboard.
Note: Static preview does not call Flask routes or DB APIs.
GET /healthGET /download/sample-csvPOST /uploadPOST /api/profileGET /api/profile?email=<email>POST /api/analysis
Minimum required columns:
- A date/time-like column (
date,time, etc.) - An amount-like column (
amount,price,cost, etc.)
Optional:
- Category/type/group column
If category is missing, records default to General.
This repository now includes a railway.json file so Railway uses the correct web process automatically.
- Push the project to GitHub.
- In Railway, create a new project from your repo.
- Railway will install dependencies from
requirements.txt. - Railway will start the app with:
gunicorn --bind 0.0.0.0:$PORT app:app- Add environment variables:
SECRET_KEY(required, secure random string)SMARTSPEND_DB(optional custom DB path/name)MAX_UPLOAD_MB(optional, default8)
- Deploy and test
/health, CSV upload, profile save/load, and analysis save.
- Push project to GitHub.
- Create a Web Service in Render from your repo.
- Set Build Command:
pip install -r requirements.txt- Set Start Command:
gunicorn app:app- Add environment variables:
SECRET_KEY(required, secure random string)SMARTSPEND_DB(optional custom DB path/name)MAX_UPLOAD_MB(optional, default8)
- Set health check path to
/health. - Deploy and test upload + dashboard + profile save flows.
Use the static file link from root preview (./data/sample_expenses_large.csv).
Flask route downloads (/download/sample-csv) require running the Flask app.
- Ensure CSV has valid date/time and amount columns.
- Check file size against
MAX_UPLOAD_MB.
- Confirm
gunicorn app:appstart command. - Confirm dependencies installed from
requirements.txt.
- OAuth-based Google sign-in backend integration
- User-specific analysis history page
- Export dashboard as PDF/PNG
- Budget-goal tracking and alerts
- Multi-currency support
MIT (see LICENSE).