# shamailabbas/mirocservices-masterclass architecture

> Architecture diagram of the GitHub repository shamailabbas/mirocservices-masterclass, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shamailabbas/mirocservices-masterclass
- Repository: https://github.com/shamailabbas/mirocservices-masterclass

## Overview

This repository is an educational, multi-language e-commerce microservices example. Users authenticate, browse products, manage a cart, review shipping costs, and purchase; the React UI calls an Express gateway, which routes selected API calls to services. Order management checks stock and product details, calculates totals, persists orders, and updates inventory. The README also documents standalone catalog, inventory, shipping, profile, and support services. Cross-service links not visible in excerpts are shown only where README or sampled source supports them; the service implementations are not all sampled.

Main entry points: [`ecommerce-ui/server/server.js`](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/server/server.js) (Express gateway), [`ecommerce-ui/client/src/App.js`](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/App.js) (React application), [`order-management/src/main/java/com/ltp/ordermanagement/service/OrderService.java`](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/order-management/src/main/java/com/ltp/ordermanagement/service/OrderService.java) (Cart and purchase logic), [`ecommerce-ui/server/routes`](https://github.com/shamailabbas/mirocservices-masterclass/tree/main/ecommerce-ui/server/routes) (Catalog, stock, shipping, contact routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["React application<br/>[App.js]"]
  node_authui["Sign-in and signup<br/>[AuthPage.js]"]
  node_catalogui["Product browsing<br/>[ProductList.js]"]
  node_detailui["Product details<br/>[ProductDetail.js]"]
  node_orderui["Cart and orders<br/>[Orders.js]"]
  node_inventoryui["Inventory view<br/>[Inventory.js]"]
  node_shippingui["Shipping view"]
  node_profileui["Profile<br/>[Profile.js]"]
  node_contactui["Contact support<br/>[Contact.js]"]
end

subgraph group_gateway["API Gateway"]
  node_gateway["Express gateway<br/>[server.js]"]
  node_authroute["Auth routes<br/>[auth.js]"]
  node_orderroutes["Order routes<br/>[orders.js]"]
  node_otherroutes["Catalog, stock, shipping, contact routes"]
end

subgraph group_commerce["Commerce Services"]
  node_catalog["Product catalog<br/>[index.js]"]
  node_inventory["Inventory API<br/>[inventory_api.py]"]
  node_orders["Order controller"]
  node_orderlogic["Cart and purchase logic<br/>[OrderService.java]"]
  node_cartitem["Cart item model<br/>[CartItem.java]"]
  node_productmodel["Product model<br/>[Product.java]"]
  node_orderstore[("Order repository")]
  node_shipping["Shipping service<br/>[main.go]"]
end

subgraph group_identity["Identity and Support"]
  node_profile["Profile and auth service<br/>[auth_api.js]"]
  node_support["Support API<br/>[server.py]"]
end

node_buyer(("Shopper"))

node_buyer -->|"uses"| node_app
node_app -->|"routes"| node_authui
node_app -->|"routes"| node_catalogui
node_app -->|"routes"| node_detailui
node_app -->|"routes"| node_orderui
node_app -->|"routes"| node_inventoryui
node_app -->|"routes"| node_shippingui
node_app -->|"routes"| node_profileui
node_app -->|"routes"| node_contactui
node_authui -->|"requests"| node_gateway
node_catalogui -.->|"requests"| node_gateway
node_detailui -.->|"requests"| node_gateway
node_orderui -.->|"requests"| node_gateway
node_inventoryui -.->|"requests"| node_gateway
node_shippingui -.->|"requests"| node_gateway
node_profileui -.->|"requests"| node_gateway
node_contactui -.->|"requests"| node_gateway
node_gateway -->|"mounts"| node_authroute
node_gateway -->|"mounts"| node_orderroutes
node_gateway -->|"mounts"| node_otherroutes
node_authroute -->|"forwards auth"| node_profile
node_orderroutes -->|"forwards orders"| node_orders
node_orders -->|"delegates"| node_orderlogic
node_orderlogic -->|"checks and updates stock"| node_inventory
node_orderlogic -->|"loads product details"| node_catalog
node_orderlogic -->|"requests shipping fee"| node_shipping
node_orderlogic -->|"persists orders"| node_orderstore
node_orderlogic -->|"creates items"| node_cartitem
node_orderlogic -->|"reads product data"| node_productmodel
node_otherroutes -.->|"forwards catalog"| node_catalog
node_otherroutes -.->|"forwards inventory"| node_inventory
node_otherroutes -.->|"forwards shipping"| node_shipping
node_otherroutes -.->|"forwards contact"| node_support

click node_app "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/App.js"
click node_authui "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/pages/AuthPage.js"
click node_catalogui "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/pages/ProductList.js"
click node_detailui "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/pages/ProductDetail.js"
click node_orderui "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/pages/Orders.js"
click node_inventoryui "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/pages/Inventory.js"
click node_shippingui "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/pages/ShippingHandling.js"
click node_profileui "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/pages/Profile.js"
click node_contactui "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/pages/Contact.js"
click node_gateway "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/server/server.js"
click node_authroute "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/server/routes/auth.js"
click node_orderroutes "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/server/routes/orders.js"
click node_otherroutes "https://github.com/shamailabbas/mirocservices-masterclass/tree/main/ecommerce-ui/server/routes"
click node_catalog "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/product-catalog/index.js"
click node_inventory "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/product-inventory/inventory_api.py"
click node_orders "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/order-management/src/main/java/com/ltp/ordermanagement/OrderController.java"
click node_orderlogic "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/order-management/src/main/java/com/ltp/ordermanagement/service/OrderService.java"
click node_cartitem "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/order-management/src/main/java/com/ltp/ordermanagement/model/CartItem.java"
click node_productmodel "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/order-management/src/main/java/com/ltp/ordermanagement/model/Product.java"
click node_orderstore "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/order-management/src/main/java/com/ltp/ordermanagement/repository/OrderRepository.java"
click node_shipping "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/shipping-and-handling/main.go"
click node_profile "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/profile-management/auth_api.js"
click node_support "https://github.com/shamailabbas/mirocservices-masterclass/blob/main/contact-support-team/server.py"

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_app,node_authui,node_catalogui,node_detailui,node_orderui,node_inventoryui,node_shippingui,node_profileui,node_contactui toneBlue
class node_gateway,node_authroute,node_orderroutes,node_otherroutes toneAmber
class node_catalog,node_inventory,node_orders,node_orderlogic,node_cartitem,node_productmodel,node_orderstore,node_shipping toneMint
class node_profile,node_support toneRose
class node_buyer toneIndigo
```

## Components

### Storefront

- [React application](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/App.js): `ecommerce-ui/client/src/App.js`
- [Sign-in and signup](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/pages/AuthPage.js): `ecommerce-ui/client/src/pages/AuthPage.js`
- [Product browsing](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/pages/ProductList.js): `ecommerce-ui/client/src/pages/ProductList.js`
- [Product details](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/pages/ProductDetail.js): `ecommerce-ui/client/src/pages/ProductDetail.js`
- [Cart and orders](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/pages/Orders.js): `ecommerce-ui/client/src/pages/Orders.js`
- [Inventory view](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/pages/Inventory.js): `ecommerce-ui/client/src/pages/Inventory.js`
- [Shipping view](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/pages/ShippingHandling.js): `ecommerce-ui/client/src/pages/ShippingHandling.js`
- [Profile](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/pages/Profile.js): `ecommerce-ui/client/src/pages/Profile.js`
- [Contact support](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/client/src/pages/Contact.js): `ecommerce-ui/client/src/pages/Contact.js`

### API Gateway

- [Express gateway](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/server/server.js): `ecommerce-ui/server/server.js`
- [Auth routes](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/server/routes/auth.js): `ecommerce-ui/server/routes/auth.js`
- [Order routes](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/ecommerce-ui/server/routes/orders.js): `ecommerce-ui/server/routes/orders.js`
- [Catalog, stock, shipping, contact routes](https://github.com/shamailabbas/mirocservices-masterclass/tree/main/ecommerce-ui/server/routes): `ecommerce-ui/server/routes`

### Commerce Services

- [Product catalog](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/product-catalog/index.js): `product-catalog/index.js`
- [Inventory API](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/product-inventory/inventory_api.py): `product-inventory/inventory_api.py`
- [Order controller](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/order-management/src/main/java/com/ltp/ordermanagement/OrderController.java): `order-management/src/main/java/com/ltp/ordermanagement/OrderController.java`
- [Cart and purchase logic](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/order-management/src/main/java/com/ltp/ordermanagement/service/OrderService.java): `order-management/src/main/java/com/ltp/ordermanagement/service/OrderService.java`
- [Cart item model](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/order-management/src/main/java/com/ltp/ordermanagement/model/CartItem.java): `order-management/src/main/java/com/ltp/ordermanagement/model/CartItem.java`
- [Product model](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/order-management/src/main/java/com/ltp/ordermanagement/model/Product.java): `order-management/src/main/java/com/ltp/ordermanagement/model/Product.java`
- [Order repository](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/order-management/src/main/java/com/ltp/ordermanagement/repository/OrderRepository.java): `order-management/src/main/java/com/ltp/ordermanagement/repository/OrderRepository.java`
- [Shipping service](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/shipping-and-handling/main.go): `shipping-and-handling/main.go`

### Identity and Support

- [Profile and auth service](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/profile-management/auth_api.js): `profile-management/auth_api.js`
- [Support API](https://github.com/shamailabbas/mirocservices-masterclass/blob/main/contact-support-team/server.py): `contact-support-team/server.py`

### Other components

- **Shopper**

## Connections

- Shopper → React application: uses (evidence: `ecommerce-ui/client/src/App.js`)
- React application → Sign-in and signup: routes (evidence: `ecommerce-ui/client/src/App.js`)
- React application → Product browsing: routes (evidence: `ecommerce-ui/client/src/App.js`)
- React application → Product details: routes (evidence: `ecommerce-ui/client/src/App.js`)
- React application → Cart and orders: routes (evidence: `ecommerce-ui/client/src/App.js`)
- React application → Inventory view: routes (evidence: `ecommerce-ui/client/src/App.js`)
- React application → Shipping view: routes (evidence: `ecommerce-ui/client/src/App.js`)
- React application → Profile: routes (evidence: `ecommerce-ui/client/src/App.js`)
- React application → Contact support: routes (evidence: `ecommerce-ui/client/src/App.js`)
- Sign-in and signup → Express gateway: requests (evidence: `ecommerce-ui/client/src/pages/AuthPage.js`)
- Product browsing → Express gateway: requests
- Product details → Express gateway: requests
- Cart and orders → Express gateway: requests
- Inventory view → Express gateway: requests
- Shipping view → Express gateway: requests
- Profile → Express gateway: requests
- Contact support → Express gateway: requests
- Express gateway → Auth routes: mounts (evidence: `ecommerce-ui/server/server.js`)
- Express gateway → Order routes: mounts (evidence: `ecommerce-ui/server/server.js`)
- Express gateway → Catalog, stock, shipping, contact routes: mounts (evidence: `ecommerce-ui/server/server.js`)
- Auth routes → Profile and auth service: forwards auth (evidence: `ecommerce-ui/server/routes/auth.js`)
- Order routes → Order controller: forwards orders (evidence: `ecommerce-ui/server/routes/orders.js`)
- Order controller → Cart and purchase logic: delegates (evidence: `order-management/src/main/java/com/ltp/ordermanagement/OrderController.java`)
- Cart and purchase logic → Inventory API: checks and updates stock (evidence: `order-management/src/main/java/com/ltp/ordermanagement/service/OrderService.java`)
- Cart and purchase logic → Product catalog: loads product details (evidence: `order-management/src/main/java/com/ltp/ordermanagement/service/OrderService.java`)
- Cart and purchase logic → Shipping service: requests shipping fee (evidence: `order-management/src/main/java/com/ltp/ordermanagement/service/OrderService.java`)
- Cart and purchase logic → Order repository: persists orders (evidence: `order-management/src/main/java/com/ltp/ordermanagement/service/OrderService.java`)
- Cart and purchase logic → Cart item model: creates items (evidence: `order-management/src/main/java/com/ltp/ordermanagement/service/OrderService.java`)
- Cart and purchase logic → Product model: reads product data (evidence: `order-management/src/main/java/com/ltp/ordermanagement/service/OrderService.java`)
- Catalog, stock, shipping, contact routes → Product catalog: forwards catalog
- Catalog, stock, shipping, contact routes → Inventory API: forwards inventory
- Catalog, stock, shipping, contact routes → Shipping service: forwards shipping
- Catalog, stock, shipping, contact routes → Support API: forwards contact
