How srisaravanan55/smartbudget-ai works
SmartBudget AI is a full-stack personal-finance advisor: users authenticate, set a financial profile, log natural-language expenses, and review budgets, health scores, and reports. The React UI calls protected FastAPI routes; those routes delegate domain work to the orchestrator and specialized agents, with SQL-backed financial state and optional RAG/LLM assistance. Edges reflect explicit README statements or shown calls/import references; unsampled route and agent internals limit finer-grained links.
Main entry points: orchestrator.py Orchestrator · main.py FastAPI app · deps.py Auth dependency · routes_profile.py Profile route
Components 26
Web client
- React app
frontend/src/App.jsx - Auth state
frontend/src/context/AuthContext.jsx - API client
frontend/src/api.js - Finance pages
frontend/src/pages
API and identity
- FastAPI app
main.py - Auth routes
app/api/v1/routes_auth.py - Auth service
app/services/auth_service.py - JWT security
app/core/security.py - Auth dependency
app/api/deps.py - Error handling
app/core/exceptions.py - API schemas
app/models.py
Finance workflows
- Profile route
app/api/v1/routes_profile.py - Expense route
app/api/v1/routes_expense.py - Budget & reports
app/api/v1/routes_budget.py - Orchestrator
app/orchestrator.py
Advisor agents
- Profile agent
app/agents/profiling_agent.py - Categorization
app/agents/categorization_agent.py - Budget agent
app/agents/budget_agent.py - Debt & savings
app/agents/debt_savings_agent.py - Health scoring
app/agents/health_score_agent.py - Investment advice
app/agents/investment_agent.py - Report agent
app/agents/report_agent.py
Persistence and AI
- Finance database
app/db.py - LLM access
app/llm.py - Knowledge base
app/rag/knowledge_base.py
Other components
- User
Connections 36
- User → React app: uses
- React app → Auth state: provides auth
frontend/src/App.jsx - React app → Finance pages: routes to
frontend/src/App.jsx - Auth state → API client: calls
frontend/src/context/AuthContext.jsx - Finance pages → API client: requests data
frontend/src/pages/Budget.jsx - API client → FastAPI app: sends API calls
- FastAPI app → Auth routes: registers routes
main.py - FastAPI app → Profile route: registers routes
main.py - FastAPI app → Expense route: registers routes
main.py - FastAPI app → Budget & reports: registers routes
main.py - Auth routes → Auth service: delegates
app/api/v1/routes_auth.py - Auth service → JWT security: issues tokens
app/services/auth_service.py - Auth service → Finance database: reads and writes
app/services/auth_service.py - Auth routes → API schemas: uses schemas
app/api/v1/routes_auth.py - Profile route → Auth dependency: requires user
app/api/v1/routes_profile.py - Expense route → Auth dependency: requires user
app/api/v1/routes_expense.py - Budget & reports → Auth dependency: requires user
app/api/v1/routes_budget.py - Auth dependency → JWT security: decodes token
app/api/deps.py - Auth dependency → Finance database: loads user
app/api/deps.py - Profile route → Orchestrator: delegates
app/api/v1/routes_profile.py - Expense route → Orchestrator: delegates
app/api/v1/routes_expense.py - Budget & reports → Orchestrator: delegates
app/api/v1/routes_budget.py - Orchestrator → Profile agent: coordinates
app/orchestrator.py - Orchestrator → Categorization: categorizes
app/orchestrator.py - Orchestrator → Budget agent: generates budgets
app/orchestrator.py - Orchestrator → Debt & savings: computes plans
app/orchestrator.py - Orchestrator → Health scoring: scores finances
app/orchestrator.py - Orchestrator → Report agent: compiles report
app/orchestrator.py - Orchestrator → Finance database: reads and writes
app/orchestrator.py - Categorization → LLM access: uses
app/agents/categorization_agent.py - Report agent → LLM access: uses
app/agents/report_agent.py - Investment advice → Knowledge base: gets tips
app/agents/investment_agent.py - FastAPI app → Error handling: registers handlers
main.py - Profile route → API schemas: uses schemas
app/api/v1/routes_profile.py - Expense route → API schemas: uses schemas
app/api/v1/routes_expense.py - Budget & reports → API schemas: uses schemas
app/api/v1/routes_budget.py