How incognitol07/expense-tracker-api works
This is a FastAPI expense-tracking and budgeting API. The main workflow is a user authenticating and managing expenses, categories, and budgets through mounted API routes, with analytics and group expense/debt capabilities alongside it. Budget checks and notification cleanup run as scheduled background work; notifications are stored and can also be delivered over WebSockets. Several route implementations are unsampled, so their documented capabilities are represented without guessing their internal call chains.
Main entry points: main.py FastAPI application · database.py Database sessions · scheduler.py Task scheduler · notifications.py Notification helper
Components 21
API and identity
- FastAPI application
app/main.py - Authentication
app/routers/auth.py - Google sign-in
app/routers/google_auth.py - User profile
app/routers/profile.py
Personal finances
- Expense tracking
app/routers/expenses.py - Categories
app/routers/categories.py - Budget management
app/routers/budget.py - Category budgets
app/routers/category_budgets.py - Spending analytics
app/routers/analytics.py
Shared expenses
- Group management
app/routers/groups.py - Shared expenses
app/routers/group_expenses.py - Group debts
app/routers/group_debt.py
Alerts and realtime
- Notification API
app/routers/notifications.py - Task scheduler
app/background_tasks/scheduler.py - Scheduled jobs
app/background_tasks/jobs - WebSocket manager
app/websocket_manager.py - Notification helper
app/utils/helpers/notifications.py
Persistence and configuration
- Database sessions
app/database.py - User model
app/models/user.py - Application settings
app/config.py
Other components
- User
Connections 31
- User → FastAPI application: uses API
README.md - FastAPI application → Authentication: mounts
app/main.py - FastAPI application → Google sign-in: mounts
app/main.py - FastAPI application → Expense tracking: mounts
app/main.py - FastAPI application → Categories: mounts
app/main.py - FastAPI application → Budget management: mounts
app/main.py - FastAPI application → Category budgets: mounts
app/main.py - FastAPI application → Spending analytics: mounts
app/main.py - FastAPI application → User profile: mounts
app/main.py - FastAPI application → Group management: mounts
app/main.py - FastAPI application → Shared expenses: mounts
app/main.py - FastAPI application → Group debts: mounts
app/main.py - FastAPI application → Notification API: mounts
app/main.py - Authentication → Database sessions: queries
app/routers/auth.py - Google sign-in → Database sessions: queries
app/routers/google_auth.py - Expense tracking → Database sessions: uses sessions
app/routers/expenses.py - Categories → Database sessions: uses sessions
app/routers/categories.py - Budget management → Database sessions: uses sessions
app/routers/budget.py - Category budgets → Database sessions: uses sessions
app/routers/category_budgets.py - Group management → Database sessions: uses sessions
app/routers/groups.py - FastAPI application → Database sessions: creates tables
app/main.py - FastAPI application → Task scheduler: starts
app/main.py - Task scheduler → Scheduled jobs: schedules
app/background_tasks/scheduler.py - Task scheduler → Database sessions: opens sessions
app/background_tasks/scheduler.py - Scheduled jobs → WebSocket manager: sends alerts
app/background_tasks/jobs/budget_monitoring.py - FastAPI application → WebSocket manager: serves WebSockets
app/main.py - Shared expenses → Notification helper: uses notifications
- Group debts → Notification helper: uses notifications
- Notification helper → Database sessions: stores notifications
app/utils/helpers/notifications.py - FastAPI application → Application settings: configures app
app/main.py - User model → Database sessions: maps to base
app/models/user.py