A lightweight Order Management API built with Python + FastAPI, containerized with Docker.
Demonstrates API-first microservice design with four core CRUD operations.
Client / API Consumer
|
[ API Gateway ] ← enforce RBAC, rate limiting, auth here
|
[ Order Management API ] ← this service
|
[ In-Memory Store ] ← replace with PostgreSQL / SAP in production
- Docker Desktop installed and running
docker-compose up --buildhttp://localhost:8000/docs
| Operation | Method | Endpoint |
|---|---|---|
| Create Order | POST | /orders |
| Query Order | GET | /orders/{order_id} |
| Update Order | PATCH | /orders/{order_id} |
| Cancel Order | DELETE | /orders/{order_id} |
| List Orders | GET | /orders |
| Health Check | GET | /health |
curl -X POST http://localhost:8000/orders \
-H "Content-Type: application/json" \
-d '{
"customer_id": "CUST-001",
"items": [
{"product_id": "SKY-RF-5G-001", "quantity": 2, "unit_price": 49.99}
]
}'curl http://localhost:8000/orders/{order_id}curl -X PATCH http://localhost:8000/orders/{order_id} \
-H "Content-Type: application/json" \
-d '{"status": "CONFIRMED"}'curl -X DELETE http://localhost:8000/orders/{order_id}PENDING → CONFIRMED → PROCESSING → CANCELLED
| Component | Technology | Version |
|---|---|---|
| API Framework | FastAPI | 0.110.0 |
| Web Server | Uvicorn | 0.29.0 |
| Data Validation | Pydantic | 2.6.4 |
| Runtime | Python | 3.11 |
| Container | Docker | - |
- Replace in-memory store with PostgreSQL or SAP ERP integration
- Add JWT-based authentication at the API Gateway layer
- Implement RBAC — e.g., only ORDER_ADMIN role can cancel orders
- Add event publishing (Kafka/Event Grid) on order state changes
- Add pagination to GET /orders
- Deploy behind an API Gateway (Azure APIM, Kong, AWS API GW)
This POC was designed by Rabindra Aryal and built with the assistance of Claude.ai (Anthropic).
The architecture decisions, domain model, API design, and business rules were defined by the author. Claude assisted with code generation, containerization, and documentation.
