How kunalsambyal/expense-tracker works
This is a full-stack, multi-user expense tracker: users register or sign in, manage categories and expenses, then review spending summaries and optional AI-generated advice in a Streamlit dashboard. The backend exposes FastAPI endpoints, applies user-scoped services and validation, and persists records through async SQLAlchemy. The README documents analytics and local Ollama integration, but the expense endpoint and AI orchestration source were not excerpted; those links are shown as unverified rather than asserted as inspected.
Components 20
Streamlit client
- Dashboard UI
frontend/main.py - HTTP API client
frontend/api_client.py
API and identity
- FastAPI app
backend/main.py - Auth endpoints
backend/app/api/v1/endpoints/auth.py - User endpoints
backend/app/api/v1/endpoints/users.py - Category endpoints
backend/app/api/v1/endpoints/categories.py - Expense endpoints
backend/app/api/v1/endpoints/expenses.py - User service
backend/app/services/user_service.py - JWT and hashing
backend/app/core/security.py - Request and response schemas
backend/app/schemas - API error handling
backend/app/core/exceptions.py
Expense domain
- Category service
backend/app/services/category_service.py - Expense service
backend/app/services/expense_service.py - AI advisor
backend/app/services/ai_service.py
Persistence and insights
- Async DB session
backend/app/db/session.py - Runtime configuration
backend/app/core/config.py - User, category, expense models
backend/app/models - PostgreSQL database
Other components
- User
- Local Ollama
Connections 27
- User → Dashboard UI: uses
README.md - Dashboard UI → HTTP API client: calls
frontend/main.py - HTTP API client → FastAPI app: sends HTTP
frontend/api_client.py - FastAPI app → Auth endpoints: mounts
backend/main.py - FastAPI app → User endpoints: mounts
backend/main.py - FastAPI app → Category endpoints: mounts
backend/main.py - FastAPI app → Expense endpoints: mounts
backend/main.py - FastAPI app → API error handling: configures
backend/main.py - Auth endpoints → User service: calls
backend/app/api/v1/endpoints/auth.py - Auth endpoints → JWT and hashing: creates token
backend/app/api/v1/endpoints/auth.py - User service → JWT and hashing: hashes passwords
backend/app/services/user_service.py - Category endpoints → Category service: calls
backend/app/api/v1/endpoints/categories.py - Category endpoints → Async DB session: gets session
backend/app/api/v1/endpoints/categories.py - User service → Async DB session: queries
backend/app/services/user_service.py - Category service → User, category, expense models: reads and writes
backend/app/services/category_service.py - Expense service → User, category, expense models: reads and writes
backend/app/services/expense_service.py - User service → User, category, expense models: queries
backend/app/services/user_service.py - Async DB session → Runtime configuration: reads settings
backend/app/db/session.py - FastAPI app → Async DB session: opens database
backend/main.py - User, category, expense models → PostgreSQL database: maps records
README.md - Auth endpoints → Request and response schemas: validates and returns
backend/app/api/v1/endpoints/auth.py - Category endpoints → Request and response schemas: uses schemas
backend/app/api/v1/endpoints/categories.py - Expense endpoints → Expense service: delegates
- Expense endpoints → Request and response schemas: uses schemas
- Expense endpoints → AI advisor: requests insights
- AI advisor → Local Ollama: requests advice
README.md - AI advisor → Expense service: uses aggregations