How narasimhacha/e--commerce-platform-using-py works
This is a FastAPI e-commerce backend. The principal workflow is user registration/login, JWT-authenticated catalog and cart operations, with admin-gated inventory management and stock checks; a separate recommendation endpoint is documented as using cart contents and Claude, then validating suggestions against the catalog. The graph follows sampled route and persistence calls; recommendation internals and some documented route wiring were not sampled, so only documented dependencies are shown.
Main entry points: auth.py Auth routes · cart.py Cart operations · main.py FastAPI app · database.py DB engine and sessions
Components 13
API routing
- FastAPI app
main.py
Identity and access
- Auth routes
auth.py - JWT and RBAC
auth.py - Password hashing
auth.py
Commerce features
- Product catalog
main.py - Cart operations
cart.py - Stock validation
cart.py - Recommendations
main.py
Persistence
- Models and schemas
models.py - DB engine and sessions
Database_config/database.py
Other components
- API client
- Claude API
- SQL database
Connections 20
- API client → FastAPI app: sends requests
- FastAPI app → Auth routes: dispatches auth
- FastAPI app → Cart operations: dispatches cart
- FastAPI app → Product catalog: handles catalog
- FastAPI app → Recommendations: handles recommendations
- Auth routes → Password hashing: hashes and verifies
- Auth routes → JWT and RBAC: creates tokens
- JWT and RBAC → Auth routes: authenticates routes
- Auth routes → DB engine and sessions: opens sessions
- Product catalog → DB engine and sessions: opens sessions
- Cart operations → JWT and RBAC: checks identity
- Cart operations → Stock validation: validates quantity
- Cart operations → DB engine and sessions: opens sessions
- Recommendations → Cart operations: uses cart contents
- Recommendations → Claude API: requests suggestions
- Recommendations → DB engine and sessions: validates products
- DB engine and sessions → SQL database: connects to
- Auth routes → Models and schemas: uses user models
- Product catalog → Models and schemas: uses product models
- Cart operations → Models and schemas: uses cart models