Skip to content

himali-goat/order-management-api-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Order Management Microservice — POC

A lightweight Order Management API built with Python + FastAPI, containerized with Docker.

Demonstrates API-first microservice design with four core CRUD operations.


Architecture Overview

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

Infrastructure Diagram

POC Infrastructure


Quick Start

1. Prerequisites

  • Docker Desktop installed and running

2. Run the service

docker-compose up --build

3. Open API Docs (auto-generated)

http://localhost:8000/docs

API Endpoints

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

Test with curl

Create Order

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}
    ]
  }'

Query Order

curl http://localhost:8000/orders/{order_id}

Update Order

curl -X PATCH http://localhost:8000/orders/{order_id} \
  -H "Content-Type: application/json" \
  -d '{"status": "CONFIRMED"}'

Cancel Order

curl -X DELETE http://localhost:8000/orders/{order_id}

Order Status Flow

PENDING → CONFIRMED → PROCESSING → CANCELLED

POC - Tech Stack

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 -

Production Considerations (beyond POC)

  • 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)

Attribution

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.

Releases

No releases published

Packages

 
 
 

Contributors