How mugil0095/daily-expenses-sharing-application-using-fastapi works
This is a FastAPI backend for managing users and shared expenses. A client sends user or expense requests through the registered API routers; the routers validate request/response shapes and delegate persistence operations to CRUD functions using SQLAlchemy sessions and relational models. Expense splits can carry equal, exact, or percentage types, but the sampled implementation stores supplied split values rather than calculating shares. The README mentions downloadable balance sheets, but no such endpoint or implementation appears in the tree. Percentage validation exists in app/utils.py but is not wired into the routes. Wiring reflects sampled source; unsampled capabilities are not inferred.
Main entry points: main.py FastAPI app · users.py User routes · expenses.py Expense routes · database.py DB sessions
Components 11
API entry
- FastAPI app
app/main.py - User routes
app/routers/users.py - Expense routes
app/routers/expenses.py - Request schemas
app/schemas.py
Expense domain
- User operations
app/crud.py - Expense operations
app/crud.py - Percentage check
app/utils.py
Persistence
- Relational models
app/models.py - DB sessions
app/database.py - MySQL
Other components
- API client
Connections 13
- API client → FastAPI app: sends requests
- FastAPI app → User routes: dispatches users
- FastAPI app → Expense routes: dispatches expenses
- FastAPI app → DB sessions: creates tables
- User routes → Request schemas: uses schemas
- Expense routes → Request schemas: uses schemas
- User routes → User operations: calls
- Expense routes → Expense operations: calls
- User routes → DB sessions: opens sessions
- Expense routes → DB sessions: opens sessions
- User operations → Relational models: queries and creates
- Expense operations → Relational models: queries and creates
- DB sessions → MySQL: connects