# nagavjm/ecommercesaga architecture

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

- Interactive diagram: https://gitdiagram.com/nagavjm/ecommercesaga
- Repository: https://github.com/nagavjm/ecommercesaga

## Overview

This is a .NET microservices e-commerce platform with an Angular storefront. Customers browse products, manage a cart, authenticate, and submit orders; order creation returns asynchronously while the Saga Orchestrator coordinates inventory, payment, and shipping, with status available through tracking. Admin screens cover products, inventory, and saga monitoring. The README documents service capabilities and messaging patterns, but sampled sources do not show most service-to-service dispatch details, so those links are omitted rather than inferred.

Main entry points: [`src/ApiGateway/OcelotGateway/Program.cs`](https://github.com/nagavjm/ecommercesaga/blob/main/src/ApiGateway/OcelotGateway/Program.cs) (Ocelot Gateway), [`src/Services/SagaOrchestrator/SagaOrchestrator.Application/Services/OrderSagaCoordinator.cs`](https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/SagaOrchestrator/SagaOrchestrator.Application/Services/OrderSagaCoordinator.cs) (Saga Orchestrator), [`src/Frontend/ecommerce-angular/src/app/app.component.ts`](https://github.com/nagavjm/ecommercesaga/blob/main/src/Frontend/ecommerce-angular/src/app/app.component.ts) (Angular Storefront), [`src/BuildingBlocks/BuildingBlocks.Messaging/Outbox/OutboxProcessorBackgroundService.cs`](https://github.com/nagavjm/ecommercesaga/blob/main/src/BuildingBlocks/BuildingBlocks.Messaging/Outbox/OutboxProcessorBackgroundService.cs) (Outbox & Bus)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Storefront"]
  node_storefront["Angular Storefront<br/>[app.component.ts]"]
  node_catalog["Catalog Browsing"]
  node_cartui["Cart &amp; Checkout"]
  node_authui["Sign In<br/>[auth.service.ts]"]
  node_ordersui["Orders &amp; Tracking"]
  node_adminui["Admin Console"]
end

subgraph group_edge["API Edge"]
  node_gateway["Ocelot Gateway<br/>[Program.cs]"]
end

subgraph group_commerce["Commerce Services"]
  node_identity["Identity Service<br/>[AuthController.cs]"]
  node_products["Product Service"]
  node_cart["Cart Service<br/>[CartController.cs]"]
  node_orders["Order Service"]
end

subgraph group_fulfillment["Fulfillment Saga"]
  node_inventory["Inventory Service"]
  node_payment["Payment Service"]
  node_shipping["Shipping Service"]
  node_saga["Saga Orchestrator"]
  node_notification["Notifications"]
end

subgraph group_platform["Shared Platform"]
  node_contracts["Event Contracts<br/>[Events]"]
  node_messaging["Outbox &amp; Bus"]
  node_observability["Observability"]
end

node_shopper(("Shopper"))

node_shopper -->|"uses"| node_storefront
node_storefront -->|"routes to"| node_catalog
node_storefront -->|"routes to"| node_cartui
node_storefront -->|"routes to"| node_ordersui
node_storefront -->|"routes to"| node_adminui
node_authui -.->|"HTTP requests"| node_gateway
node_storefront -.->|"API access"| node_gateway
node_gateway -->|"routes requests"| node_identity
node_gateway -->|"routes requests"| node_products
node_gateway -->|"routes requests"| node_cart
node_gateway -->|"routes requests"| node_orders
node_gateway -->|"routes requests"| node_inventory
node_gateway -->|"routes requests"| node_payment
node_gateway -->|"routes requests"| node_shipping
node_gateway -->|"routes requests"| node_saga
node_gateway -->|"routes requests"| node_notification
node_orders -->|"starts async flow"| node_saga
node_saga -->|"coordinates"| node_inventory
node_saga -->|"coordinates"| node_payment
node_saga -->|"coordinates"| node_shipping
node_saga -.->|"status tracking"| node_ordersui
node_orders -->|"outbox events"| node_messaging
node_payment -->|"outbox events"| node_messaging
node_shipping -->|"outbox events"| node_messaging
node_messaging -->|"publishes contracts"| node_contracts
node_saga -->|"handles events"| node_contracts
node_gateway -->|"configures"| node_observability

click node_storefront "https://github.com/nagavjm/ecommercesaga/blob/main/src/Frontend/ecommerce-angular/src/app/app.component.ts"
click node_catalog "https://github.com/nagavjm/ecommercesaga/tree/main/src/Frontend/ecommerce-angular/src/app/features/catalog"
click node_cartui "https://github.com/nagavjm/ecommercesaga/blob/main/src/Frontend/ecommerce-angular/src/app/features/checkout/checkout.component.ts"
click node_authui "https://github.com/nagavjm/ecommercesaga/blob/main/src/Frontend/ecommerce-angular/src/app/core/services/auth.service.ts"
click node_ordersui "https://github.com/nagavjm/ecommercesaga/tree/main/src/Frontend/ecommerce-angular/src/app/features/orders"
click node_adminui "https://github.com/nagavjm/ecommercesaga/tree/main/src/Frontend/ecommerce-angular/src/app/features/admin"
click node_gateway "https://github.com/nagavjm/ecommercesaga/blob/main/src/ApiGateway/OcelotGateway/Program.cs"
click node_identity "https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/Identity/Identity.API/Controllers/AuthController.cs"
click node_products "https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/Product/Product.API/Controllers/ProductsController.cs"
click node_cart "https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/Cart/Cart.API/Controllers/CartController.cs"
click node_orders "https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/Order/Order.API/Controllers/OrdersController.cs"
click node_inventory "https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/Inventory/Inventory.API/Controllers/InventoryController.cs"
click node_payment "https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/Payment/Payment.API/Controllers/PaymentsController.cs"
click node_shipping "https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/Shipping/Shipping.API/Controllers/ShippingController.cs"
click node_saga "https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/SagaOrchestrator/SagaOrchestrator.Application/Services/OrderSagaCoordinator.cs"
click node_notification "https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/Notification/Notification.API/Consumers/NotificationMessageConsumerWorker.cs"
click node_contracts "https://github.com/nagavjm/ecommercesaga/tree/main/src/BuildingBlocks/BuildingBlocks.Contracts/Events"
click node_messaging "https://github.com/nagavjm/ecommercesaga/blob/main/src/BuildingBlocks/BuildingBlocks.Messaging/Outbox/OutboxProcessorBackgroundService.cs"
click node_observability "https://github.com/nagavjm/ecommercesaga/tree/main/src/BuildingBlocks/BuildingBlocks.Observability"

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_storefront,node_catalog,node_cartui,node_authui,node_ordersui,node_adminui toneBlue
class node_gateway toneAmber
class node_identity,node_products,node_cart,node_orders toneMint
class node_inventory,node_payment,node_shipping,node_saga,node_notification toneRose
class node_contracts,node_messaging,node_observability,node_shopper toneIndigo
```

## Components

### Storefront

- [Angular Storefront](https://github.com/nagavjm/ecommercesaga/blob/main/src/Frontend/ecommerce-angular/src/app/app.component.ts): `src/Frontend/ecommerce-angular/src/app/app.component.ts`
- [Catalog Browsing](https://github.com/nagavjm/ecommercesaga/tree/main/src/Frontend/ecommerce-angular/src/app/features/catalog): `src/Frontend/ecommerce-angular/src/app/features/catalog`
- [Cart & Checkout](https://github.com/nagavjm/ecommercesaga/blob/main/src/Frontend/ecommerce-angular/src/app/features/checkout/checkout.component.ts): `src/Frontend/ecommerce-angular/src/app/features/checkout/checkout.component.ts`
- [Sign In](https://github.com/nagavjm/ecommercesaga/blob/main/src/Frontend/ecommerce-angular/src/app/core/services/auth.service.ts): `src/Frontend/ecommerce-angular/src/app/core/services/auth.service.ts`
- [Orders & Tracking](https://github.com/nagavjm/ecommercesaga/tree/main/src/Frontend/ecommerce-angular/src/app/features/orders): `src/Frontend/ecommerce-angular/src/app/features/orders`
- [Admin Console](https://github.com/nagavjm/ecommercesaga/tree/main/src/Frontend/ecommerce-angular/src/app/features/admin): `src/Frontend/ecommerce-angular/src/app/features/admin`

### API Edge

- [Ocelot Gateway](https://github.com/nagavjm/ecommercesaga/blob/main/src/ApiGateway/OcelotGateway/Program.cs): `src/ApiGateway/OcelotGateway/Program.cs`

### Commerce Services

- [Identity Service](https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/Identity/Identity.API/Controllers/AuthController.cs): `src/Services/Identity/Identity.API/Controllers/AuthController.cs`
- [Product Service](https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/Product/Product.API/Controllers/ProductsController.cs): `src/Services/Product/Product.API/Controllers/ProductsController.cs`
- [Cart Service](https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/Cart/Cart.API/Controllers/CartController.cs): `src/Services/Cart/Cart.API/Controllers/CartController.cs`
- [Order Service](https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/Order/Order.API/Controllers/OrdersController.cs): `src/Services/Order/Order.API/Controllers/OrdersController.cs`

### Fulfillment Saga

- [Inventory Service](https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/Inventory/Inventory.API/Controllers/InventoryController.cs): `src/Services/Inventory/Inventory.API/Controllers/InventoryController.cs`
- [Payment Service](https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/Payment/Payment.API/Controllers/PaymentsController.cs): `src/Services/Payment/Payment.API/Controllers/PaymentsController.cs`
- [Shipping Service](https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/Shipping/Shipping.API/Controllers/ShippingController.cs): `src/Services/Shipping/Shipping.API/Controllers/ShippingController.cs`
- [Saga Orchestrator](https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/SagaOrchestrator/SagaOrchestrator.Application/Services/OrderSagaCoordinator.cs): `src/Services/SagaOrchestrator/SagaOrchestrator.Application/Services/OrderSagaCoordinator.cs`
- [Notifications](https://github.com/nagavjm/ecommercesaga/blob/main/src/Services/Notification/Notification.API/Consumers/NotificationMessageConsumerWorker.cs): `src/Services/Notification/Notification.API/Consumers/NotificationMessageConsumerWorker.cs`

### Shared Platform

- [Event Contracts](https://github.com/nagavjm/ecommercesaga/tree/main/src/BuildingBlocks/BuildingBlocks.Contracts/Events): `src/BuildingBlocks/BuildingBlocks.Contracts/Events`
- [Outbox & Bus](https://github.com/nagavjm/ecommercesaga/blob/main/src/BuildingBlocks/BuildingBlocks.Messaging/Outbox/OutboxProcessorBackgroundService.cs): `src/BuildingBlocks/BuildingBlocks.Messaging/Outbox/OutboxProcessorBackgroundService.cs`
- [Observability](https://github.com/nagavjm/ecommercesaga/tree/main/src/BuildingBlocks/BuildingBlocks.Observability): `src/BuildingBlocks/BuildingBlocks.Observability`

### Other components

- **Shopper**

## Connections

- Shopper → Angular Storefront: uses (evidence: `src/Frontend/ecommerce-angular/src/app/app.component.ts`)
- Angular Storefront → Catalog Browsing: routes to
- Angular Storefront → Cart & Checkout: routes to
- Angular Storefront → Orders & Tracking: routes to
- Angular Storefront → Admin Console: routes to
- Sign In → Ocelot Gateway: HTTP requests
- Angular Storefront → Ocelot Gateway: API access
- Ocelot Gateway → Identity Service: routes requests (evidence: `README.md`)
- Ocelot Gateway → Product Service: routes requests (evidence: `README.md`)
- Ocelot Gateway → Cart Service: routes requests (evidence: `README.md`)
- Ocelot Gateway → Order Service: routes requests (evidence: `README.md`)
- Ocelot Gateway → Inventory Service: routes requests (evidence: `README.md`)
- Ocelot Gateway → Payment Service: routes requests (evidence: `README.md`)
- Ocelot Gateway → Shipping Service: routes requests (evidence: `README.md`)
- Ocelot Gateway → Saga Orchestrator: routes requests (evidence: `README.md`)
- Ocelot Gateway → Notifications: routes requests (evidence: `README.md`)
- Order Service → Saga Orchestrator: starts async flow (evidence: `README.md`)
- Saga Orchestrator → Inventory Service: coordinates (evidence: `README.md`)
- Saga Orchestrator → Payment Service: coordinates (evidence: `README.md`)
- Saga Orchestrator → Shipping Service: coordinates (evidence: `README.md`)
- Saga Orchestrator → Orders & Tracking: status tracking
- Order Service → Outbox & Bus: outbox events (evidence: `README.md`)
- Payment Service → Outbox & Bus: outbox events (evidence: `README.md`)
- Shipping Service → Outbox & Bus: outbox events (evidence: `README.md`)
- Outbox & Bus → Event Contracts: publishes contracts (evidence: `src/BuildingBlocks/BuildingBlocks.Messaging/Outbox/OutboxProcessorBackgroundService.cs`)
- Saga Orchestrator → Event Contracts: handles events
- Ocelot Gateway → Observability: configures (evidence: `src/ApiGateway/OcelotGateway/Program.cs`)
