How judoshka/stepik_fastapi_basics works
This repository is a FastAPI e-commerce API. Users browse and search products, register or authenticate, manage carts, and check out into orders; sellers manage products, while buyers can leave reviews that update product ratings. The graph reflects the README’s documented API capabilities and sampled route behavior; category and cart implementations were not sampled, so their internal wiring is shown only where supported by the application structure.
Main entry points: main.py FastAPI app · db_depends.py Session dependency · models ORM models · products.py Product routes
Components 15
API routing
- FastAPI app
app/main.py - Request validation
app/schemas.py
Commerce domains
- Product routes
app/routers/products.py - Category routes
app/routers/categories.py - Cart routes
app/routers/cart.py - Order routes
app/routers/orders.py - Review routes
app/routers/reviews.py - Rating service
app/services.py - Product images
Identity and access
- User routes
app/routers/users.py - Authentication
app/auth.py
Persistence
- Session dependency
app/db_depends.py - ORM models
app/models - SQL database
app/database.py
Other components
- Buyer or seller
Connections 37
- Buyer or seller → FastAPI app: sends requests
- FastAPI app → Product routes: dispatches
- FastAPI app → Category routes: dispatches
- FastAPI app → Cart routes: dispatches
- FastAPI app → Order routes: dispatches
- FastAPI app → Review routes: dispatches
- FastAPI app → User routes: dispatches
- Product routes → Request validation: validates with
- Category routes → Request validation: validates with
- Cart routes → Request validation: validates with
- Order routes → Request validation: validates with
- Review routes → Request validation: validates with
- User routes → Request validation: validates with
- Product routes → Session dependency: obtains sessions
- Category routes → Session dependency: obtains sessions
- Cart routes → Session dependency: obtains sessions
- Order routes → Session dependency: obtains sessions
- Review routes → Session dependency: obtains sessions
- User routes → Session dependency: obtains sessions
- Session dependency → SQL database: opens sessions
- Product routes → ORM models: queries and updates
- Category routes → ORM models: queries and updates
- Cart routes → ORM models: queries and updates
- Order routes → ORM models: queries and updates
- Review routes → ORM models: queries and updates
- User routes → ORM models: queries and updates
- ORM models → SQL database: persists records
- Product routes → Product images: stores and removes images
- FastAPI app → Product images: serves static files
- User routes → Authentication: creates tokens
- Product routes → Authentication: checks seller role
- Review routes → Authentication: checks buyer or user
- Cart routes → Authentication: authenticates requests
- Order routes → Authentication: authenticates requests
- Authentication → Session dependency: loads current user
- Review routes → Rating service: recalculates rating
- Rating service → SQL database: reads reviews; updates product