# smart-kishor24/microservices-based-order-processing-system architecture

> Architecture diagram of the GitHub repository smart-kishor24/microservices-based-order-processing-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/smart-kishor24/microservices-based-order-processing-system
- Repository: https://github.com/smart-kishor24/microservices-based-order-processing-system

## Overview

This is a Spring Boot microservices order-processing system. A client submits an order through the Order Service, which validates the customer, reserves product stock, persists the order, and requests a notification; failed stock reservation triggers compensation. Separate services own customer, product, order, and notification data and expose management and lookup operations. The README also documents cancellation, order-status updates, notification history, and the dashboard. Relationships for orchestration are documented in the README and indexed source references; unsampled implementation details are not inferred.

Main entry points: [`order-service/src/main/java/com/orderprocessing/order/service/impl/OrderServiceImpl.java`](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/order-service/src/main/java/com/orderprocessing/order/service/impl/OrderServiceImpl.java) (Order Orchestrator), [`order-service/src/main/java/com/orderprocessing/order/client/ProductClient.java`](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/order-service/src/main/java/com/orderprocessing/order/client/ProductClient.java) (Product REST Client), [`customer-service/src/main/java/com/orderprocessing/customer/controller/CustomerController.java`](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/customer-service/src/main/java/com/orderprocessing/customer/controller/CustomerController.java) (Customer API), [`product-service/src/main/java/com/orderprocessing/product/controller/ProductController.java`](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/product-service/src/main/java/com/orderprocessing/product/controller/ProductController.java) (Product API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shared["Shared Contracts"]
  node_apiresponse["API Responses<br/>[ApiResponse.java]"]
  node_sharedexceptions["Shared Error Handling"]
end

subgraph group_customer["Customer Service"]
  node_customerapi["Customer API"]
  node_customerlogic["Customer Management"]
  node_customerstore[("Customer Records<br/>[Customer.java]")]
end

subgraph group_product["Product Service"]
  node_productapi["Product API"]
  node_productlogic["Catalog &amp; Inventory"]
  node_productstore[("Product Records<br/>[Product.java]")]
end

subgraph group_orders["Order Service"]
  node_orderapi["Order API"]
  node_orderlogic["Order Orchestrator"]
  node_customerclient["Customer REST Client"]
  node_productclient["Product REST Client<br/>[ProductClient.java]"]
  node_notificationclient["Notification REST Client"]
  node_orderstore[("Order Records<br/>[Order.java]")]
end

subgraph group_notifications["Notification Service"]
  node_notificationapi["Notification API"]
  node_notificationlogic["Notification Audit"]
  node_notificationstore[("Notification Records<br/>[Notification.java]")]
end

node_client(("Client"))
node_dashboard["Web Dashboard<br/>[app.js]"]

node_client -->|"submits orders"| node_orderapi
node_orderapi -->|"delegates"| node_orderlogic
node_orderlogic -->|"validates customer"| node_customerclient
node_customerclient -->|"calls validation"| node_customerapi
node_orderlogic -->|"reserves stock"| node_productclient
node_productclient -->|"calls inventory"| node_productapi
node_orderlogic -->|"persists order"| node_orderstore
node_orderlogic -->|"requests notification"| node_notificationclient
node_notificationclient -->|"calls dispatch"| node_notificationapi
node_customerapi -->|"delegates"| node_customerlogic
node_productapi -->|"delegates"| node_productlogic
node_notificationapi -->|"delegates"| node_notificationlogic
node_customerlogic -.->|"manages records"| node_customerstore
node_productlogic -->|"manages records"| node_productstore
node_notificationlogic -.->|"records audit"| node_notificationstore
node_client -->|"manages profiles"| node_customerapi
node_client -->|"manages catalog"| node_productapi
node_client -->|"retrieves history"| node_notificationapi
node_orderlogic -->|"restores on rollback"| node_productclient
node_orderlogic -->|"restores on cancel"| node_productclient
node_orderlogic -->|"alerts on cancel"| node_notificationclient

click node_dashboard "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/frontend-dashboard/app.js"
click node_apiresponse "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/common-dto/src/main/java/com/orderprocessing/common/dto/ApiResponse.java"
click node_sharedexceptions "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/common-dto/src/main/java/com/orderprocessing/common/exception/GlobalExceptionHandler.java"
click node_customerapi "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/customer-service/src/main/java/com/orderprocessing/customer/controller/CustomerController.java"
click node_customerlogic "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/customer-service/src/main/java/com/orderprocessing/customer/service/impl/CustomerServiceImpl.java"
click node_customerstore "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/customer-service/src/main/java/com/orderprocessing/customer/entity/Customer.java"
click node_productapi "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/product-service/src/main/java/com/orderprocessing/product/controller/ProductController.java"
click node_productlogic "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/product-service/src/main/java/com/orderprocessing/product/service/impl/ProductServiceImpl.java"
click node_productstore "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/product-service/src/main/java/com/orderprocessing/product/entity/Product.java"
click node_orderapi "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/order-service/src/main/java/com/orderprocessing/order/controller/OrderController.java"
click node_orderlogic "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/order-service/src/main/java/com/orderprocessing/order/service/impl/OrderServiceImpl.java"
click node_customerclient "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/order-service/src/main/java/com/orderprocessing/order/client/CustomerClient.java"
click node_productclient "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/order-service/src/main/java/com/orderprocessing/order/client/ProductClient.java"
click node_notificationclient "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/order-service/src/main/java/com/orderprocessing/order/client/NotificationClient.java"
click node_orderstore "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/order-service/src/main/java/com/orderprocessing/order/entity/Order.java"
click node_notificationapi "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/notification-service/src/main/java/com/orderprocessing/notification/controller/NotificationController.java"
click node_notificationlogic "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/notification-service/src/main/java/com/orderprocessing/notification/service/impl/NotificationServiceImpl.java"
click node_notificationstore "https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/notification-service/src/main/java/com/orderprocessing/notification/entity/Notification.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_apiresponse,node_sharedexceptions,node_client toneBlue
class node_customerapi,node_customerlogic,node_customerstore toneAmber
class node_productapi,node_productlogic,node_productstore toneMint
class node_orderapi,node_orderlogic,node_customerclient,node_productclient,node_notificationclient,node_orderstore toneRose
class node_notificationapi,node_notificationlogic,node_notificationstore toneIndigo
class node_dashboard toneTeal
```

## Components

### Shared Contracts

- [API Responses](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/common-dto/src/main/java/com/orderprocessing/common/dto/ApiResponse.java): `common-dto/src/main/java/com/orderprocessing/common/dto/ApiResponse.java`
- [Shared Error Handling](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/common-dto/src/main/java/com/orderprocessing/common/exception/GlobalExceptionHandler.java): `common-dto/src/main/java/com/orderprocessing/common/exception/GlobalExceptionHandler.java`

### Customer Service

- [Customer API](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/customer-service/src/main/java/com/orderprocessing/customer/controller/CustomerController.java): `customer-service/src/main/java/com/orderprocessing/customer/controller/CustomerController.java`
- [Customer Management](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/customer-service/src/main/java/com/orderprocessing/customer/service/impl/CustomerServiceImpl.java): `customer-service/src/main/java/com/orderprocessing/customer/service/impl/CustomerServiceImpl.java`
- [Customer Records](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/customer-service/src/main/java/com/orderprocessing/customer/entity/Customer.java): `customer-service/src/main/java/com/orderprocessing/customer/entity/Customer.java`

### Product Service

- [Product API](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/product-service/src/main/java/com/orderprocessing/product/controller/ProductController.java): `product-service/src/main/java/com/orderprocessing/product/controller/ProductController.java`
- [Catalog & Inventory](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/product-service/src/main/java/com/orderprocessing/product/service/impl/ProductServiceImpl.java): `product-service/src/main/java/com/orderprocessing/product/service/impl/ProductServiceImpl.java`
- [Product Records](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/product-service/src/main/java/com/orderprocessing/product/entity/Product.java): `product-service/src/main/java/com/orderprocessing/product/entity/Product.java`

### Order Service

- [Order API](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/order-service/src/main/java/com/orderprocessing/order/controller/OrderController.java): `order-service/src/main/java/com/orderprocessing/order/controller/OrderController.java`
- [Order Orchestrator](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/order-service/src/main/java/com/orderprocessing/order/service/impl/OrderServiceImpl.java): `order-service/src/main/java/com/orderprocessing/order/service/impl/OrderServiceImpl.java`
- [Customer REST Client](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/order-service/src/main/java/com/orderprocessing/order/client/CustomerClient.java): `order-service/src/main/java/com/orderprocessing/order/client/CustomerClient.java`
- [Product REST Client](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/order-service/src/main/java/com/orderprocessing/order/client/ProductClient.java): `order-service/src/main/java/com/orderprocessing/order/client/ProductClient.java`
- [Notification REST Client](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/order-service/src/main/java/com/orderprocessing/order/client/NotificationClient.java): `order-service/src/main/java/com/orderprocessing/order/client/NotificationClient.java`
- [Order Records](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/order-service/src/main/java/com/orderprocessing/order/entity/Order.java): `order-service/src/main/java/com/orderprocessing/order/entity/Order.java`

### Notification Service

- [Notification API](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/notification-service/src/main/java/com/orderprocessing/notification/controller/NotificationController.java): `notification-service/src/main/java/com/orderprocessing/notification/controller/NotificationController.java`
- [Notification Audit](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/notification-service/src/main/java/com/orderprocessing/notification/service/impl/NotificationServiceImpl.java): `notification-service/src/main/java/com/orderprocessing/notification/service/impl/NotificationServiceImpl.java`
- [Notification Records](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/notification-service/src/main/java/com/orderprocessing/notification/entity/Notification.java): `notification-service/src/main/java/com/orderprocessing/notification/entity/Notification.java`

### Other components

- **Client**
- [Web Dashboard](https://github.com/smart-kishor24/microservices-based-order-processing-system/blob/main/frontend-dashboard/app.js): `frontend-dashboard/app.js`

## Connections

- Client → Order API: submits orders (evidence: `README.md`)
- Order API → Order Orchestrator: delegates (evidence: `order-service/src/main/java/com/orderprocessing/order/controller/OrderController.java`)
- Order Orchestrator → Customer REST Client: validates customer (evidence: `order-service/src/main/java/com/orderprocessing/order/service/impl/OrderServiceImpl.java`)
- Customer REST Client → Customer API: calls validation (evidence: `README.md`)
- Order Orchestrator → Product REST Client: reserves stock (evidence: `order-service/src/main/java/com/orderprocessing/order/service/impl/OrderServiceImpl.java`)
- Product REST Client → Product API: calls inventory (evidence: `README.md`)
- Order Orchestrator → Order Records: persists order (evidence: `order-service/src/main/java/com/orderprocessing/order/service/impl/OrderServiceImpl.java`)
- Order Orchestrator → Notification REST Client: requests notification (evidence: `order-service/src/main/java/com/orderprocessing/order/service/impl/OrderServiceImpl.java`)
- Notification REST Client → Notification API: calls dispatch (evidence: `README.md`)
- Customer API → Customer Management: delegates (evidence: `customer-service/src/main/java/com/orderprocessing/customer/controller/CustomerController.java`)
- Product API → Catalog & Inventory: delegates (evidence: `product-service/src/main/java/com/orderprocessing/product/controller/ProductController.java`)
- Notification API → Notification Audit: delegates (evidence: `notification-service/src/main/java/com/orderprocessing/notification/controller/NotificationController.java`)
- Customer Management → Customer Records: manages records (evidence: `customer-service/src/main/java/com/orderprocessing/customer/service/impl/CustomerServiceImpl.java`)
- Catalog & Inventory → Product Records: manages records (evidence: `product-service/src/main/java/com/orderprocessing/product/service/impl/ProductServiceImpl.java`)
- Notification Audit → Notification Records: records audit (evidence: `notification-service/src/main/java/com/orderprocessing/notification/service/impl/NotificationServiceImpl.java`)
- Client → Customer API: manages profiles (evidence: `README.md`)
- Client → Product API: manages catalog (evidence: `README.md`)
- Client → Notification API: retrieves history (evidence: `README.md`)
- Order Orchestrator → Product REST Client: restores on rollback (evidence: `README.md`)
- Order Orchestrator → Product REST Client: restores on cancel (evidence: `README.md`)
- Order Orchestrator → Notification REST Client: alerts on cancel (evidence: `README.md`)
