A modern personal & group finance platform with smart insights, recurring automation, anomaly detection, and goal motivation โ built with React + TypeScript + Express + MongoDB.
- ๐ JWT Auth โ password-based, minimal & extensible.
- โป๏ธ Recurring Transactions โ template engine materializes future expenses/income.
- ๐จ Anomaly Detection โ streaming zโscore style heuristic (Welford variance) flags outliers.
- ๐งฎ Financial Health Score โ composite scoring + recommendations.
- ๐ฏ Savings Goals โ progress bars, urgency badge, success flair.
- ๐ฅ Group Balances & Settlement Suggestions โ netting algorithm for fair payouts.
- ๐ Budgets & Reports โ monthly category tracking + charts.
- โ๏ธ Clean Architecture โ typed API, modular routes, scheduler, insights service.
- ๐งช Deterministic Algorithms โ rolling stats, greedy settlement, recurrence advancement.
Mermaid diagrams & deeper design live in docs/ARCHITECTURE.md.
flowchart LR
UI[React SPA] --> API[Express /api]
API --> DB[(MongoDB)]
Scheduler[Recurrence Loop] --> API
API --> Stats[Streaming Stats]
Stats --> DB
- Node 18+
- MongoDB running locally (or connection string)
# Backend
cd backend
npm install
# Frontend
cd ../frontend
npm installMONGODB_URI=mongodb://localhost:27017/budgettrackr
JWT_SECRET=change-me
PORT=5000
NODE_ENV=development# In backend/
npm run dev
# In frontend/
npm startNavigate: http://localhost:3000 โ Register โ Explore.
cd frontend
npm run buildServe frontend/build via static host / CDN; point it at backend API domain (configure CORS as needed).
- Register: returns
{ token, user }immediately. - Store JWT (localStorage) โ attach
Authorization: Bearer <token>to protected calls. - Middleware verifies + hydrates
req.user. - Token expiry default 7d (adjust in code/env).
| Feature | How It Works | Benefit |
|---|---|---|
| Recurrence | Interval loop queries templates by nextRunAt |
Automates routine cashflow |
| Anomaly Detection | Welford mean/variance + threshold > mean + 2ฯ (n>5) |
Surfaces unusual spending |
| Health Score | Weighted normalized components | Actionable personal finance pulse |
| Group Settlement | Greedy pairing of net positive/negative balances | Minimal settlement transfers |
User, Transaction (recurrence + anomaly), Goal, Budget, Group, Stats โ full ER diagram in docs.

- โ Goals panel animations
- โ Streaming anomaly tagging
- ๐ Auto goal allocation
- ๐ Settlement execution persistence
- ๐ Realโtime (WebSocket/SSE) anomaly pushes
- ๐ Export / import data
Full backlog: see inline comments + FEATURES.md.
(Details & examples in docs/API_REFERENCE.md)
POST /api/auth/register -> { token, user }
POST /api/auth/login -> { token, user }
GET /api/auth/me -> { user }
POST /api/transactions # create (template or concrete)
GET /api/transactions/anomalies
GET /api/goals
GET /api/insights/health
GET /api/insights/checklist
GET /api/groups/:id/settlements/suggest
- Force a recurrence run: set a template's
nextRunAtto past date and wait scheduler tick. - Trigger anomaly: add 6 similar expenses then one large outlier.
- Urgent goal badge: create goal with deadline โค 14 days.
| Doc | Purpose |
|---|---|
docs/ARCHITECTURE.md |
Diagrams & system design |
docs/SRS.md |
Requirements (functional & nonโfunctional) |
docs/TECHNICAL_GUIDE.md |
Contributor setup & internals |
docs/USER_GUIDE.md |
Endโuser walkthrough |
docs/API_REFERENCE.md |
Endpoint contracts |
FEATURES.md |
Feature deepโdives & examples |
Welford Streaming Stats
Delta = x - mean
mean += Delta / count
Delta2 = x - mean
M2 += Delta * Delta2
variance = count > 1 ? M2/(count-1) : 0
stdDev = sqrt(variance)
Greedy Settlement (Concept)
- Compute net balance per member.
- Sort creditors (desc) & debtors (asc).
- Match extremes; reduce amounts until zero.
- Repeat until lists exhausted.
Recurrence Advancement
- Compute next date from frequency + interval.
- Decrement
occurrencesLeft(if bounded) else continue. - Deactivate when 0 or past
endDate.
- Bcrypt 12 rounds; rotate secret; consider rate limiting & lockout.
- Improve: move token to HttpOnly cookie + refresh flow for production.
- Limit anomaly endpoint exposure (auth already required).
| Issue | Hint |
|---|---|
| Recurring not firing | Check isTemplate, recurrence.active, and nextRunAt <= now |
| No anomalies | Need โฅ6 samples; outlier must exceed threshold |
| Auth 401 | Missing/expired token header |
Internal / educational scope. For forks: open PRs with concise description + architectural impact notes.
Internal project (adjust before production). Replace interval scheduler & basic anomaly heuristic as scale increases.
Built with โค๏ธ โ iterate, extend, and keep finances intentional.