Skip to content

PavanKoder27/Personal_Budget_Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

20 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ฐ Budget Tracker (Advanced Edition)

A modern personal & group finance platform with smart insights, recurring automation, anomaly detection, and goal motivation โ€” built with React + TypeScript + Express + MongoDB.

image

โœจ Highlights

  • ๐Ÿ” 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.

Screenshot 2025-09-16 164622 Screenshot 2025-09-16 164633

๐ŸŽฅ Demo Video

โ–ถ๏ธ Watch on Google Drive: https://drive.google.com/drive/folders/1KmxytBb1ooBJ4qzHEH0OcP1PmvbFegVm?usp=drive_link

๐Ÿ—บ๏ธ Architecture Glimpse

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
Loading

๐Ÿš€ Quick Start

1. Prereqs

  • Node 18+
  • MongoDB running locally (or connection string)

2. Install

# Backend
cd backend
npm install
# Frontend
cd ../frontend
npm install

3. Configure Backend .env

MONGODB_URI=mongodb://localhost:27017/budgettrackr
JWT_SECRET=change-me
PORT=5000
NODE_ENV=development

4. Run Dev

# In backend/
npm run dev
# In frontend/
npm start

Navigate: http://localhost:3000 โ†’ Register โ†’ Explore.

5. Build Frontend (Prod)

cd frontend
npm run build

Serve frontend/build via static host / CDN; point it at backend API domain (configure CORS as needed).


๐Ÿ” Auth Flow (Password + JWT)

  1. Register: returns { token, user } immediately.
  2. Store JWT (localStorage) โ†’ attach Authorization: Bearer <token> to protected calls.
  3. Middleware verifies + hydrates req.user.
  4. Token expiry default 7d (adjust in code/env).

๐Ÿง  Core Intelligence

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
image

๐Ÿ“ฆ Domain Models (Simplified)

User, Transaction (recurrence + anomaly), Goal, Budget, Group, Stats โ€” full ER diagram in docs. image


๐Ÿ›ฃ๏ธ Roadmap (Excerpt)

  • โœ… Goals panel animations
  • โœ… Streaming anomaly tagging
  • ๐Ÿ”œ Auto goal allocation
  • ๐Ÿ”œ Settlement execution persistence
  • ๐Ÿ”œ Realโ€‘time (WebSocket/SSE) anomaly pushes
  • ๐Ÿ”œ Export / import data
image

Full backlog: see inline comments + FEATURES.md.


๐Ÿงฉ API Cheat Sheet

(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
image

๐Ÿ› ๏ธ Development Tips

  • Force a recurrence run: set a template's nextRunAt to 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.

๐Ÿ“š Documentation Suite

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

๐Ÿงช Algorithms Snapshot

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)
  1. Compute net balance per member.
  2. Sort creditors (desc) & debtors (asc).
  3. Match extremes; reduce amounts until zero.
  4. Repeat until lists exhausted.
Recurrence Advancement
  • Compute next date from frequency + interval.
  • Decrement occurrencesLeft (if bounded) else continue.
  • Deactivate when 0 or past endDate.

๐Ÿงพ Security & Hardening Notes

  • 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).
image

๐Ÿž Troubleshooting

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

๐Ÿค Contributing

Internal / educational scope. For forks: open PRs with concise description + architectural impact notes.


๐Ÿ“„ License / Notes

Internal project (adjust before production). Replace interval scheduler & basic anomaly heuristic as scale increases.


Built with โค๏ธ โ€” iterate, extend, and keep finances intentional.

About

A modern personal budget tracker to manage transactions, category budgets, reports, savings goals, and group expense splits. Built with React (MUI) frontend and Express/MongoDB backend secured by JWT.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors