How rsingh230105/ecommerce-order-service works
Order Service accepts order CRUD requests, obtains current product pricing during order creation, calculates totals, and stores orders in PostgreSQL. Creation also writes an ORDER_CREATED event to the transactional outbox in the same transaction. A separate publisher claims pending events, sends them to SNS, and records success or retryable failure; SNS fans out to Inventory’s SQS queue. The graph reflects the shown API and publisher code plus README-documented integrations; migration and deployment mechanics are excluded.
Main entry points: main.py Order API · database.py DB Session Setup · outbox_publisher.py Outbox Publisher · models.py Order Models
Components 11
Order API
- Order API
app/main.py - Order Schemas
app/schemas.py - Product Lookup
app/main.py
Persistence
- DB Session Setup
app/database.py - Order Models
app/models.py - PostgreSQL
Event Publishing
- Outbox Publisher
app/outbox_publisher.py - SNS Topic
Other components
- Order Client
- Product Service
- Inventory SQS Queue
Connections 13
- Order Client → Order API: requests
README.md - Order API → Order Schemas: validates and returns
app/main.py - Order API → Product Lookup: calls
app/main.py - Product Lookup → Product Service: gets product price
app/main.py - Order API → DB Session Setup: opens session
app/main.py - Order API → Order Models: queries and writes
app/main.py - Order Models → DB Session Setup: uses declarative base
app/models.py - DB Session Setup → PostgreSQL: connects
README.md - Order API → PostgreSQL: commits order and outbox
app/main.py - Outbox Publisher → DB Session Setup: opens sessions
app/outbox_publisher.py - Outbox Publisher → Order Models: claims and updates events
app/outbox_publisher.py - Outbox Publisher → SNS Topic: publishes events
README.md - SNS Topic → Inventory SQS Queue: fans out
README.md