How yogeshwanth2005/finance works
Fin (SurakshaCFO) is a personal-finance and insurance-gap application. A family submits a profile, receives protection and investment estimates, browses published insurance plans, and can ask a multilingual advisor questions grounded in its profile and indexed policy documents. Admins upload documents, review extracted plan-card drafts, and publish cards. The graph includes the documented fund-data and account capabilities; some frontend-to-API links are dashed because the relevant page implementations were not sampled.
Main entry points: profile.py Family profile · chat.py Advisor chat · api.ts Typed API client · App.tsx Page routing
Components 28
Family interface
- Page routing
frontend/src/App.tsx - Dashboard
frontend/src/pages/Dashboard.tsx - Insurance browser
frontend/src/pages/Insurance.tsx - Investments page
frontend/src/pages/Investments.tsx - Document manager
frontend/src/pages/AdminDocuments.tsx - Typed API client
frontend/src/lib/api.ts
Accounts and profiles
- Authentication
backend/routers/auth.py - Session security
backend/lib/auth.py - Family profile
backend/routers/profile.py - Profile models
backend/models/profile.py
Advice and plans
- Advisor chat
backend/routers/chat.py - Chat context
backend/lib/chat_context.py - Policy retrieval
backend/lib/rag.py - LLM adapter
backend/lib/llm.py - Document administration
backend/routers/admin.py - Plan extraction
backend/lib/plan_extract.py - Published plans
backend/routers/plans.py - Plan and chat models
backend/models/rag.py
Funds and estimates
- Allocation estimates
backend/lib/allocation.py - Finance assumptions
backend/lib/finance_config.py - Fund API
backend/routers/funds.py - Fund catalog and refresh
backend/lib/fund_store.py - Fund persistence
backend/lib/fund_repo.py
Other components
- Family user
- Admin user
- MongoDB
- Groq API
- AMFI data
Connections 38
- Family user → Page routing: uses
README.md - Admin user → Document manager: manages documents
README.md - Page routing → Dashboard: routes to
frontend/src/App.tsx - Page routing → Insurance browser: routes to
frontend/src/App.tsx - Page routing → Investments page: routes to
frontend/src/App.tsx - Dashboard → Typed API client: requests data
- Insurance browser → Typed API client: requests plans
- Investments page → Typed API client: requests funds
- Document manager → Typed API client: manages documents
- Typed API client → Authentication: calls API
- Authentication → Session security: uses security
backend/routers/auth.py - Authentication → MongoDB: reads and writes
backend/routers/auth.py - Session security → MongoDB: reads users
backend/lib/auth.py - Family profile → MongoDB: reads and writes
backend/routers/profile.py - Family profile → Allocation estimates: computes estimates
backend/routers/profile.py - Family profile → Profile models: validates profile
backend/routers/profile.py - Advisor chat → MongoDB: reads and writes
backend/routers/chat.py - Advisor chat → Policy retrieval: retrieves policy text
README.md - Advisor chat → Chat context: builds answer context
README.md - Advisor chat → LLM adapter: streams answers
README.md - Policy retrieval → MongoDB: reads indexed chunks
backend/lib/rag.py - Policy retrieval → Chat context: ranks document chunks
backend/lib/rag.py - LLM adapter → Groq API: requests completions
backend/lib/llm.py - Document administration → MongoDB: manages documents
README.md - Document administration → Policy retrieval: indexes documents
README.md - Document administration → Plan extraction: drafts plan cards
README.md - Plan extraction → LLM adapter: extracts plan fields
backend/lib/plan_extract.py - Plan extraction → Plan and chat models: validates plan fields
backend/lib/plan_extract.py - Published plans → MongoDB: reads published plans
README.md - Family user → Family profile: submits finances
- Family user → Advisor chat: asks advisor
README.md - Family user → Published plans: browses plans
README.md - Family profile → Finance assumptions: uses assumptions
backend/routers/profile.py - Fund API → Fund catalog and refresh: serves fund data
README.md - Fund catalog and refresh → Fund persistence: persists fund rows
backend/lib/fund_store.py - Fund persistence → MongoDB: stores fund rows
backend/lib/fund_repo.py - Fund catalog and refresh → AMFI data: refreshes NAV data
- Family user → Fund API: explores funds