How msbharath1998-sketch/fastapi-todo works
This repository is a small FastAPI todo CRUD service. A client sends requests to the API, which validates and shapes data with Pydantic schemas, uses SQLAlchemy models and a request-scoped session to perform create, list, retrieve, update, and delete operations, then returns results. Database configuration and engine setup live separately from the route handlers. The excerpts show the route-to-model and session interactions; the configured database’s actual product and deployment are not specified.
Main entry points: main.py Todo routes · database.py Session and engine setup · models.py Todo ORM model · schemas.py Request and response schemas
Components 6
HTTP API
- Todo routes
main.py - Request and response schemas
schemas.py
Todo Data
- Todo ORM model
models.py
Persistence
- Session and engine setup
database.py - Todo database
Other components
- API client
Connections 7
- API client → Todo routes: sends requests
main.py - Todo routes → Request and response schemas: validates and shapes
main.py - Todo routes → Todo ORM model: creates and queries
main.py - Todo routes → Session and engine setup: opens session
main.py - Todo routes → Todo database: reads and writes
main.py - Session and engine setup → Todo database: connects engine
database.py - Todo ORM model → Session and engine setup: uses base
models.py