A full-stack personal finance platform with a microservices architecture: a React SPA, a Node/Express REST API, and a Python/Flask machine-learning service that forecasts balances, detects anomalous transactions, and generates spending insights β all containerized and CI-tested.
π Live demo: not deployed yet β see Roadmap Β Β·Β Demo login (local):
john@example.com/password123
| Dashboard | ML Insights & Forecast |
|---|---|
add docs/dashboard.png |
add docs/insights.png |
See docs/README.md for how to generate these.
- π³ Transaction Management β create, edit, delete, filter, paginate, and bulk-import from CSV
- π― Goal Tracking β set financial goals and monitor progress toward targets
- π° Budget Management β per-category budgets with alert thresholds and over-budget flags
- π Financial Insights β charts for monthly trends, category breakdowns, and balance forecasts
- π€ ML-Powered Analytics β 30-day balance forecasting with confidence bands, transaction anomaly detection, and computed spending insights
- π Authentication β JWT-based auth with bcrypt password hashing and protected routes
- π€ Data Import β CSV upload for bulk transactions
- β‘ Real-time Dashboard β live financial summaries
- π± Responsive Design β mobile-first dark theme
βββββββββββββββββββ
β React SPA β Vite Β· Tailwind Β· Recharts
β (client:5173) β
ββββββββββ¬ββββββββββ
β REST (axios + JWT)
ββββββββββΌββββββββββ
β Node/Express β Sequelize ORM Β· JWT Β· Swagger
β API (:5001) β
ββββββ¬βββββββββ¬βββββ
Sequelize β β HTTP (JSON)
ββββββΌββββ ββββΌβββββββββββββββ
βPostgresβ β Flask ML Service β scikit-learn
β (:5432)β β (:5002) β Ridge Β· IsolationForest
ββββββββββ ββββββββββββββββββββ
The Node API is the single entry point for the client. It brokers the user's
data to the ML service and degrades gracefully (returns 503) if ML is
offline, so the core app keeps working.
| Layer | Technologies |
|---|---|
| Frontend | React 19, Vite, Tailwind CSS, Recharts, React Router, Axios |
| Backend | Node.js, Express, PostgreSQL, Sequelize ORM, JWT, bcrypt, Swagger |
| ML Service | Python, Flask, Pandas, NumPy, scikit-learn (Ridge regression, Isolation Forest) |
| Testing | Jest + Supertest (API), pytest (ML), Vitest + RTL (client) |
| DevOps | Docker, docker-compose, GitHub Actions CI |
git clone https://github.com/AjayMaan13/FinSight.git
cd FinSight
docker compose up --buildWorks with zero setup β docker-compose.yml falls back to demo-safe
defaults. To customize (real JWT_SECRET, DB credentials, etc.), copy the
root .env.example to .env first: cp .env.example .env.
This boots Postgres, runs migrations + seeders, starts the API and ML
service, and serves the client via nginx. Then open http://localhost:5173
and sign in with john@example.com / password123.
# 1. Database
# Create a PostgreSQL database named `finsight`.
# 2. Backend API
cd server
npm install
cp .env.example .env # set DB creds + JWT_SECRET
npm run migrate && npm run seed
npm run dev # http://localhost:5001
# 3. ML service
cd ../ml-service
python3.10 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
python app.py # http://localhost:5002
# 4. Frontend
cd ../client
npm install
cp .env.example .env
npm run dev # http://localhost:5173Note: the ML service pins scientific packages (numpy/pandas/scikit-learn) that ship prebuilt wheels for Python 3.10β3.12. Use one of those for the venv (the Docker image uses
python:3.11).
# Backend API (Jest + Supertest)
cd server && npm test
# ML service (pytest β 18 tests)
cd ml-service && source venv/bin/activate && pytest -q
# Frontend (Vitest + React Testing Library)
cd client && npm testCI runs all three suites plus linting on every push via
.github/workflows/ci.yml.
Interactive Swagger docs at http://localhost:5001/api-docs.
Core endpoints
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/auth/register |
Register a new user |
POST |
/api/auth/login |
Authenticate, returns JWT |
GET |
/api/transactions |
Paginated, filterable transactions |
POST |
/api/transactions |
Create a transaction |
POST |
/api/transactions/import |
Bulk CSV import |
GET |
/api/goals |
List goals with progress |
GET |
/api/budgets |
List budgets |
ML endpoints (Node API β Python ML service)
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/ml/forecast |
30-day balance forecast with 95% confidence band |
GET |
/api/ml/anomalies |
Isolation Forest anomaly detection |
GET |
/api/ml/insights |
Month-over-month spending insights |
Real models β not heuristics β served from a Python/Flask microservice and fit
per-user on that user's own transactions (no global thresholds; it adapts
to each person's normal behaviour). Full details in
ml-service/README.md.
| Capability | Technique | Notes |
|---|---|---|
| Balance forecasting | Ridge regression on calendar/seasonality features | Predicts daily net cash flow β integrates to a balance path with a 95% confidence band that widens with the horizon (variance accumulates like a random walk). Seasonal-average fallback on sparse history. |
| Anomaly detection | Isolation Forest (scikit-learn) | Features: category z-score, ratio to category median, log amount, weekday. Returns a normalized score and a feature-derived reason (e.g. "Unusually large amount for this category"). |
| Spending insights | Aggregation + forecast | Month-over-month category deltas, savings rate, top movers, projected month-end balance, budget-risk flags. |
Feature engineering (Pandas/NumPy): continuous gap-free daily balance
series, calendar features (day-of-week/-month, seasonality), and per-transaction
deviation features. Covered by an 18-test pytest suite.
curl -X POST http://localhost:5002/forecast \
-H "Content-Type: application/json" \
-d '{"transactions": [...], "days": 30}'
# β { "success": true, "model": "ridge_calendar",
# "forecast": [ { "date": "...", "balance": 1024.1, "lower": 980.4, "upper": 1067.8 }, ... ] }FinSight/
βββ client/ # React frontend
β βββ src/
β βββ components/ # UI + charts (incl. BalanceForecastChart)
β βββ pages/ # Dashboard, Transactions, Goals, Insights, β¦
β βββ context/ # Auth context
β βββ services/ # Axios API layer (incl. mlAPI)
βββ server/ # Node/Express API
β βββ controllers/ # Request handlers (incl. mlController)
β βββ models/ # Sequelize models
β βββ routes/ # API routes (incl. ml)
β βββ middleware/ # Auth, validation, error handling
β βββ migrations/ # DB schema
β βββ seeders/ # Demo data
βββ ml-service/ # Python ML microservice
β βββ ml/ # features, forecast, anomaly, insights
β βββ tests/ # pytest suite
β βββ app.py # Flask API
β βββ train.py # pipeline validation + model persistence
βββ docker-compose.yml # Full stack: db + api + ml + client
βββ render.yaml # Render Blueprint: one-click deploy of the whole stack
βββ .github/workflows/ # CI
render.yaml is a Render Blueprint
that provisions the entire stack β Postgres, the API, the ML service, and the
static client β from one deploy:
- Push this repo to your own GitHub account.
- On Render, click New β
Blueprint, connect the repo, and confirm. Render reads
render.yamland creates all four services automatically (JWT_SECRETis auto-generated; DB credentials are wired between services for you). - First boot runs migrations + seeds a demo account automatically.
All services use Render's free tier, which spins down after 15 minutes of inactivity β the first request after a break takes ~30β60s to wake up. That's expected, not a bug.
One manual step: the client's VITE_API_URL is baked into the JS bundle
at build time and is hardcoded in render.yaml to
https://finsight-server.onrender.com/api, matching the server's name:
field. If Render assigns your server a different subdomain (e.g. because that
name is already taken), update VITE_API_URL in the Render dashboard and
manually redeploy the client.
- Deploy via the Blueprint above and add the live demo link + screenshots
- Code-split the client bundle (currently one 900KB+ chunk)
Ajaypartap Singh Maan GitHub β’ LinkedIn β’ ajayapsmaanm13@gmail.com
β Star if you find it helpful!