How abdyken/ecommerce-api works
E-Commerce API exposes a FastAPI workflow for account access, product discovery, cart management, and Stripe checkout through order fulfillment. Endpoint modules own request handling and database operations; shared dependencies resolve sessions and authenticated users. The README documents additional address/profile, email, and observability capabilities. The graph includes those documented branches, but unsampled implementation details and monitoring wiring are not inferred beyond the documented relationships.
Main entry points: payments.py Checkout and orders · dependencies.py Request dependencies · main.py FastAPI application · auth.py Authentication
Components 22
API entrypoints
- FastAPI application
app/main.py - Authentication
app/api/endpoints/auth.py - Product catalog
app/api/endpoints/products.py - Shopping cart
app/api/endpoints/cart.py - Checkout and orders
app/api/endpoints/payments.py - Profiles and addresses
app/api/endpoints/users.py
Commerce domains
- Users and addresses
app/models/user.py - Product records
app/models/product.py - Cart records
app/models/cart.py - Order records
app/models/order.py
Shared runtime
- Request dependencies
app/api/dependencies.py - JWT and passwords
app/core/security.py - Application settings
app/core/config.py - PostgreSQL database
app/db/database.py - Order email service
app/services/email.py
Observability
- Metrics and logs
monitoring/prometheus.yml
Other components
- Shopper
- Stripe
- SMTP service
- Prometheus
- Loki
- Promtail
Connections 31
- Shopper → FastAPI application: sends requests
README.md - FastAPI application → Authentication: routes to
app/main.py - FastAPI application → Product catalog: routes to
app/main.py - FastAPI application → Shopping cart: routes to
app/main.py - FastAPI application → Checkout and orders: routes to
app/main.py - FastAPI application → Profiles and addresses: routes to
app/main.py - Authentication → Request dependencies: uses
app/api/endpoints/auth.py - Product catalog → Request dependencies: uses
app/api/endpoints/products.py - Shopping cart → Request dependencies: uses
app/api/endpoints/cart.py - Checkout and orders → Request dependencies: uses
app/api/endpoints/payments.py - Profiles and addresses → Request dependencies: uses
app/api/endpoints/users.py - Request dependencies → JWT and passwords: validates tokens
app/api/dependencies.py - Authentication → JWT and passwords: hashes and signs
app/api/endpoints/auth.py - Request dependencies → PostgreSQL database: opens sessions
app/api/dependencies.py - Authentication → Users and addresses: reads and creates
app/api/endpoints/auth.py - Product catalog → Product records: manages products
app/api/endpoints/products.py - Shopping cart → Cart records: manages cart
app/api/endpoints/cart.py - Shopping cart → Product records: checks products
app/api/endpoints/cart.py - Profiles and addresses → Users and addresses: manages profiles
app/api/endpoints/users.py - Checkout and orders → Cart records: reads cart
app/api/endpoints/payments.py - Checkout and orders → Order records: creates orders
app/api/endpoints/payments.py - Checkout and orders → Product records: updates stock
app/api/endpoints/payments.py - Checkout and orders → Stripe: creates intents
app/api/endpoints/payments.py - Stripe → Checkout and orders: sends webhooks
app/api/endpoints/payments.py - Checkout and orders → Order email service: sends confirmations
app/api/endpoints/payments.py - Order email service → SMTP service: delivers email
- JWT and passwords → Application settings: reads signing config
app/core/security.py - Checkout and orders → Application settings: reads Stripe config
app/api/endpoints/payments.py - Order email service → Application settings: reads mail config
app/services/email.py - Metrics and logs → Prometheus: configures scraping
README.md - Promtail → Loki: ships logs
README.md