How kunj406962/finsight works
FinSight takes a user from account setup and bank-statement upload through transaction categorization, review, and persistence, then serves searchable transactions, reconciled account balances, forecasts, anomaly flags, and narrated insights in a React dashboard. The backend routers coordinate parsing, ML, database access, and external services; the frontend API client carries authenticated requests. The README documents the domain behavior and major capabilities, but several router implementations were not sampled, so their internal wiring is shown only where explicitly documented.
Main entry points: main.py FastAPI application · upload.py Upload routes · db.py Database service · client.ts API client
Components 27
Web application
- React application
frontend/src/App.tsx - Auth context
frontend/src/context/AuthContext.tsx - API client
frontend/src/api/client.ts - Transaction query
frontend/src/hooks/useTransactionsQuery.ts - Dashboard
frontend/src/pages/Dashboard.tsx - Account views
frontend/src/pages/Accounts.tsx - Transaction views
frontend/src/pages/Transactions.tsx
API and identity
- FastAPI application
backend/app/main.py - Auth routes
backend/app/routers/auth.py - Account routes
backend/app/routers/accounts.py - Transaction routes
backend/app/routers/transactions.py - Auth email hook
backend/app/routers/email_hook.py - Database service
backend/app/services/db.py
Transaction ingestion
- Upload routes
backend/app/routers/upload.py - Format detection
backend/app/services/parsers/detector.py - RBC parser
backend/app/services/parsers/rbc_parser.py - ML categorizer
backend/app/ml/categorizer.py - Transfer detection
backend/app/ml/transfer_detector.py
Financial analytics
- Anomaly scoring
backend/app/ml/anomaly.py - Forecast routes
backend/app/routers/forecast.py - Spending forecaster
backend/app/ml/forecaster.py - Insights routes
backend/app/routers/insights.py
External services
- Supabase database and auth
- Gemini AI
- Email sender
backend/app/services/email_sender.py
Other components
- Finance user
- Bank CSV export
Connections 38
- Finance user → React application: uses
- React application → Auth context: provides auth
- Auth context → API client: requests auth
- React application → Dashboard: renders
- React application → Account views: renders
- React application → Transaction views: renders
- Dashboard → API client: requests insights
- Dashboard → API client: requests forecasts
- Transaction views → Transaction query: queries
- Transaction query → API client: fetches pages
- Account views → API client: requests accounts
- API client → FastAPI application: HTTP requests
- FastAPI application → Auth routes: dispatches
- FastAPI application → Account routes: dispatches
- FastAPI application → Upload routes: dispatches
- FastAPI application → Transaction routes: dispatches
- FastAPI application → Forecast routes: dispatches
- FastAPI application → Insights routes: dispatches
- FastAPI application → Auth email hook: dispatches
- Bank CSV export → Upload routes: uploads
- Upload routes → Format detection: detects format
- Upload routes → RBC parser: parses CSV
- Upload routes → ML categorizer: classifies transactions
- Upload routes → Transfer detection: detects transfers
- Upload routes → Database service: inserts on confirm
- Upload routes → Anomaly scoring: queues scoring
- Account routes → Database service: reads and writes
- Transaction routes → Database service: reads and writes
- Forecast routes → Spending forecaster: computes forecasts
- Forecast routes → Database service: reads and caches
- Insights routes → Gemini AI: generates narration
- Insights routes → Database service: reads and caches
- Auth routes → Supabase database and auth: authenticates users
- Database service → Supabase database and auth: queries and persists
- Auth email hook → Email sender: sends email
- Anomaly scoring → Database service: stores scores
- Forecast routes → Dashboard: returns forecast
- Insights routes → Dashboard: returns narration