AI-assisted personal finance tracker with receipt scanning, bulk import, analytics, budget alerts, and PWA support.
ExpenseSnap - Intelligent Expense Tracking and Personal Finance Management Platform
ExpenseSnap is a full-stack expense tracking application built for users who want more than a basic ledger. It combines a modern React frontend with a modular Flask backend to support daily expense logging, income tracking, category-based analytics, monthly budgeting, PDF reports, AI-powered receipt scanning, and conversational finance assistance through SnapBot.
The current codebase is structured as a production-oriented app:
- A React + TypeScript + Vite frontend provides the mobile-friendly dashboard, statistics, profile, and onboarding experience.
- A Flask application-factory backend exposes authentication, expense management, analytics, import/export, OCR, AI, and push-notification APIs.
- The app is prepared for local development, Firebase Hosting + Cloud Functions deployment, and also includes Render/PostgreSQL deployment artifacts from an earlier hosting workflow.
- User registration, login, logout, and persistent session-based authentication
- Google OAuth login flow
- Add, edit, delete, and browse income/expense transactions
- Smart dashboard with balance, income, expense, and recent transaction overview
- Search and filter transactions by keyword, year, month, category, and type
- Bulk import expenses from CSV / XLS / XLSX with preview, validation, and skip-invalid flow
- AI receipt scanner using Google Gemini Vision to extract merchant, date, amount, category, and line items
- AI finance assistant (SnapBot) for natural-language expense entry and spending Q&A
- Statistics screen with time-based summaries, category breakdown, and savings rate
- Monthly budget limit configuration with alert threshold tracking
- Push notification subscription flow with VAPID keys, service worker registration, and notification history
- Profile editing, profile photo upload, preferred currency selection, and notification preferences
- PDF report generation for expense summaries
- Progressive Web App support with install prompt, manifest, and service worker
- Responsive UI for mobile and desktop layouts
- React 19
- TypeScript
- Vite
- Tailwind CSS v4
- Framer Motion
- Lucide React
- Context API for app state
- Python
- Flask
- Flask-SQLAlchemy
- Flask-Login
- Flask-WTF
- Flask-Migrate
- Flask-CORS
- Authlib (Google OAuth)
- SQLite for local development fallback
- PostgreSQL for production deployment
- SQLAlchemy ORM
- Google Gemini API for chat + receipt OCR
- Pandas / OpenPyXL for import workflows
- ReportLab / Matplotlib for reports
- Web Push (
pywebpush,py-vapid) - Firebase Hosting
- Firebase Cloud Functions for Python
- Optional Render deployment config
React PWA (frontend/)
|
| fetch with credentials
v
Flask App Factory (backend/app/)
|
+-- Auth module
| - register/login/logout/check-auth
| - Google OAuth callback flow
|
+-- Expense API
| - CRUD
| - summary/statistics
| - bulk import preview/import
| - PDF report generation
| - profile/currency/budget/preferences
|
+-- AI module
| - SnapBot chat
| - spending insights
| - receipt OCR with Gemini Vision
|
+-- Notification module
| - push subscription management
| - unread history / mark-as-read
| - daily reminder + budget alert processing
|
v
SQLAlchemy Models
|
v
SQLite (local) / PostgreSQL (production)
- User signs up with username/password or Google OAuth.
- Frontend stores authenticated state via session cookies and loads dashboard data.
- User adds expenses manually, imports a file, or scans a receipt with AI.
- Backend validates input, stores transactions, and recomputes summaries.
- Statistics and dashboard views fetch updated aggregates from
/api/summary. - Optional push notifications remind users daily or warn when spending approaches the monthly budget.
- SnapBot can answer spending questions or convert natural-language messages into saved entries.
- Node.js 18+ recommended
- npm
- Python 3.11+ recommended
- Git
git clone <your-repository-url>
cd ExpenseSnapcd backend
python -m venv venvActivate the virtual environment:
# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activateInstall Python dependencies:
pip install -r requirements.txtOpen a new terminal:
cd frontend
npm installCreate backend/.env for local development.
SECRET_KEY=your-secret-key
FLASK_ENV=development
DATABASE_URL=sqlite:///expenses.dbGCLOUD_CLIENT_ID=your-google-client-id
GCLOUD_CLIENT_SECRET=your-google-client-secretGEMINI_API_KEY=your-gemini-api-keyVAPID_PUBLIC_KEY=your-vapid-public-key
VAPID_PRIVATE_KEY=your-vapid-private-key
VAPID_CONTACT_EMAIL=your-email@example.comFRONTEND_URL=http://localhost:5000
ENABLE_NOTIFICATION_SCHEDULER=false
DAILY_REMINDER_HOUR=20
BUDGET_ALERT_THRESHOLD=0.8
FUNCTION_URL=https://your-cloud-function-url
PORT=5001From backend/:
python run_local.pyExpected local backend:
http://127.0.0.1:5001
From frontend/:
npm run devExpected local frontend:
http://localhost:5000
- Vite proxies
/api,/login,/register,/logout, and/staticto the Flask backend on port5001 - Session cookies are sent with
credentials: include - If
VITE_API_URLis not set, the frontend uses relative URLs for local development
This project is currently configured for Firebase Hosting + Firebase Cloud Functions.
frontend/distis served by Firebase Hosting- Requests such as
/api/**,/login,/register,/logout,/check-auth, and/auth/**are rewritten to the Python Cloud Function namedexpensesnap backend/main.pywraps the Flask app as a 2nd-gen HTTPS function- A scheduled Firebase function (
keep_warm) pings the Flask app every 5 minutes to reduce cold starts
Key config lives in:
firebase.jsonbackend/main.py
The repo also contains backend/render.yaml and DEPLOYMENT_GUIDE.md, showing an alternate deployment path using:
- Render web service for Flask
- Render PostgreSQL database
If you want a single README for portfolio use, it is best to present Firebase as the primary deployment path and Render as an alternate deployment option.
- Register with username/email/password
- Or sign in using Google OAuth
- Add expenses or income manually from the app
- Edit or delete existing entries
- Filter transactions from the dashboard
- Open the bulk import modal
- Upload
.csv,.xls, or.xlsx - Preview valid and invalid rows
- Import all valid rows or skip invalid ones
- Upload or capture a receipt image
- Gemini Vision extracts structured expense entries
- Select detected line items and save them into the dashboard
- Switch statistics periods between week, month, year, or all time
- Review category breakdown and savings rate
- Set a monthly budget to support budget alerts
- Download PDF reports from the dashboard or statistics view
- Enable push notifications for reminders and budget alerts
- Review unread notification history from the app
- Ask questions like
How much did I spend this week? - Add entries naturally like
spent 200 on uber
ExpenseSnap/
├── backend/
│ ├── app/
│ │ ├── core/ # App config, extensions, app factory helpers
│ │ ├── features/
│ │ │ ├── ai/ # SnapBot chat + AI insights
│ │ │ ├── auth/ # Login, register, Google OAuth
│ │ │ ├── expenses/ # Expense CRUD, import, reports, OCR, APIs
│ │ │ ├── notifications/ # Push notification services and history
│ │ │ └── users/ # User model and preferences
│ │ ├── static/ # PWA assets, icons, uploads
│ │ └── templates/ # Legacy Flask-rendered auth/templates
│ ├── migrations/ # Alembic migrations
│ ├── main.py # Firebase Cloud Function entry point
│ ├── run_local.py # Local Flask dev server
│ ├── run_notifications.py # Standalone notification worker
│ └── requirements.txt
├── frontend/
│ ├── public/ # Manifest, service worker, icons, logo
│ ├── src/
│ │ ├── features/
│ │ │ ├── ai/ # SnapBot UI
│ │ │ ├── auth/ # Login/register screens
│ │ │ ├── expenses/ # Dashboard, add/edit, import, receipt scanner
│ │ │ ├── profile/ # Profile management
│ │ │ ├── settings/ # Notification/privacy/help settings
│ │ │ └── statistics/ # Analytics UI
│ │ └── shared/ # API client, hooks, context, shared components
│ ├── vite.config.ts # Dev proxy to Flask backend
│ └── package.json
├── firebase.json # Firebase hosting + function rewrites
├── ARCHITECTURE.md
└── DEPLOYMENT_GUIDE.md
The repository currently includes branding assets (frontend/public/logo.png) but no dedicated app screenshots folder yet.
For GitHub/portfolio presentation, add screenshots under a folder such as:
docs/screenshots/
Then update this section with images like:
## Screenshots



If you already have a deployed build, also add:
- Live demo URL
- Demo video / GIF
- Mobile install screenshot for the PWA flow
- Session-based auth using Flask-Login
- Frontend requests include cookies with
credentials: include - Supports:
- Username/password login
- Google OAuth login
POST /loginPOST /registerPOST /logoutGET /check-authGET /login/googleGET /auth/callback
GET /api/expensesPOST /api/expensesPUT /api/expenses/:idDELETE /api/expenses/:idGET /api/summaryGET /api/user/profilePOST /api/user/profilePUT /api/user/currencyGET /api/user/budgetPUT /api/update-budget
GET /api/import-expenses/templatePOST /api/import-expenses/previewPOST /api/import-expensesGET /api/generate-report
GET /api/push/vapid-public-keyPOST /api/push/subscribePOST /api/push/unsubscribePOST /api/push/testGET /api/notifications/history
POST /api/ai/chatGET /api/ai/insightsPOST /api/scan-receipt
- Add dedicated charts/visualizations beyond the current statistics cards and category bars
- Split the frontend bundle to reduce the current large production chunk size
- Add automated backend/frontend tests and CI workflows
- Add recurring expenses and savings goals
- Add export to CSV/Excel in addition to PDF reports
- Add role-based admin/analytics tooling
- Add richer notification scheduling controls in the UI
- Add Docker support for one-command local startup
- Add a dedicated screenshots/demo assets folder for portfolio presentation
Author
imSai-py- Email:
sai.lak.2004920@gmail.com
If you want this README to be portfolio-ready, you can also extend this section with:
- LinkedIn profile
- GitHub profile
- Portfolio website
No license file is currently present in the repository.
If you want this project to be open-source friendly, add a LICENSE file and update this section, for example:
This project is licensed under the MIT License.# Terminal 1
cd backend
venv\Scripts\activate
python run_local.py
# Terminal 2
cd frontend
npm install
npm run dev- Verified backend app startup locally through
backend/run_local.pyimports and app creation - Verified frontend production build with
npm.cmd run build - Observed a Vite warning about a large bundled chunk, which is a performance optimization opportunity rather than a build failure
