# tranduyloc895/retail-store-microservices architecture

> Architecture diagram of the GitHub repository tranduyloc895/retail-store-microservices, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tranduyloc895/retail-store-microservices
- Repository: https://github.com/tranduyloc895/retail-store-microservices

## Overview

This is a retail-store microservices application. The principal workflow is: a customer uses the storefront to browse catalog data, maintain cart state, update checkout details, obtain shipping rates, and submit an order. Catalog requests pass through the Go controller/API into persistent storage; checkout requests pass through NestJS orchestration into Redis, shipping, and the Orders API. The tree documents Cart, Orders, and UI services, but their source is not included here, so those components and links are shown only where README evidence supports them.

Main entry points: [`src/checkout/src/checkout/checkout.service.ts`](https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/checkout/checkout.service.ts) (Checkout Orchestrator), [`src/checkout/src/checkout/checkout.controller.ts`](https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/checkout/checkout.controller.ts) (Checkout API), [`src/catalog/controller/controller.go`](https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/catalog/controller/controller.go) (Catalog API), [`src/catalog/api/catalog.go`](https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/catalog/api/catalog.go) (Catalog Logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Experience APIs"]
  node_storefront["Web Storefront"]
  node_catalog_http["Catalog API<br/>[controller.go]"]
  node_checkout_http["Checkout API"]
end

subgraph group_catalog["Catalog Service"]
  node_catalog_logic["Catalog Logic<br/>[catalog.go]"]
  node_catalog_repo["Catalog Repository<br/>[repository.go]"]
  node_catalog_db[("Catalog Database")]
end

subgraph group_checkout["Checkout Service"]
  node_checkout_service["Checkout Orchestrator"]
  node_checkout_repo["Checkout Repository"]
  node_redis[("Redis Store")]
  node_shipping["Shipping Rates"]
  node_orders_client["Orders Client"]
end

subgraph group_commerce["Commerce Services"]
  node_cart_api["Cart API"]
  node_orders_api["Orders API"]
  node_cart_db[("Cart Database")]
  node_orders_db[("Orders Database")]
end

subgraph group_operations["Runtime Operations"]
  node_health["Health Diagnostics<br/>[app.controller.ts]"]
  node_chaos_controls["Chaos Controls"]
  node_chaos_runtime["Chaos Runtime<br/>[chaos.service.ts]"]
end

node_customer(("Customer"))

node_customer -->|"uses"| node_storefront
node_storefront -->|"calls"| node_catalog_http
node_storefront -->|"calls"| node_cart_api
node_storefront -->|"calls"| node_orders_api
node_storefront -->|"calls"| node_checkout_http
node_catalog_http -->|"dispatches"| node_catalog_logic
node_catalog_logic -->|"queries"| node_catalog_repo
node_catalog_repo -->|"reads"| node_catalog_db
node_checkout_http -->|"dispatches"| node_checkout_service
node_checkout_service -->|"reads/writes"| node_checkout_repo
node_checkout_repo -->|"stores"| node_redis
node_checkout_service -.->|"gets rates"| node_shipping
node_checkout_service -->|"creates order"| node_orders_client
node_orders_client -->|"calls"| node_orders_api
node_cart_api -->|"reads/writes"| node_cart_db
node_orders_api -->|"reads/writes"| node_orders_db
node_health -->|"checks"| node_redis
node_chaos_controls -->|"configures"| node_chaos_runtime
node_chaos_runtime -->|"modulates"| node_checkout_http

click node_catalog_http "https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/catalog/controller/controller.go"
click node_checkout_http "https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/checkout/checkout.controller.ts"
click node_catalog_logic "https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/catalog/api/catalog.go"
click node_catalog_repo "https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/catalog/repository/repository.go"
click node_checkout_service "https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/checkout/checkout.service.ts"
click node_checkout_repo "https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/checkout/repositories/RedisCheckoutRepository.ts"
click node_shipping "https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/checkout/shipping/MockShippingService.ts"
click node_orders_client "https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/checkout/orders/HttpOrdersService.ts"
click node_health "https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/app.controller.ts"
click node_chaos_controls "https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/chaos/chaos.controller.ts"
click node_chaos_runtime "https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/chaos/chaos.service.ts"

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_http,node_checkout_http toneBlue
class node_catalog_logic,node_catalog_repo,node_catalog_db toneAmber
class node_checkout_service,node_checkout_repo,node_redis,node_shipping,node_orders_client toneMint
class node_cart_api,node_orders_api,node_cart_db,node_orders_db toneRose
class node_health,node_chaos_controls,node_chaos_runtime,node_customer toneIndigo
```

## Components

### Experience APIs

- **Web Storefront**
- [Catalog API](https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/catalog/controller/controller.go): `src/catalog/controller/controller.go`
- [Checkout API](https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/checkout/checkout.controller.ts): `src/checkout/src/checkout/checkout.controller.ts`

### Catalog Service

- [Catalog Logic](https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/catalog/api/catalog.go): `src/catalog/api/catalog.go`
- [Catalog Repository](https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/catalog/repository/repository.go): `src/catalog/repository/repository.go`
- **Catalog Database**

### Checkout Service

- [Checkout Orchestrator](https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/checkout/checkout.service.ts): `src/checkout/src/checkout/checkout.service.ts`
- [Checkout Repository](https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/checkout/repositories/RedisCheckoutRepository.ts): `src/checkout/src/checkout/repositories/RedisCheckoutRepository.ts`
- **Redis Store**
- [Shipping Rates](https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/checkout/shipping/MockShippingService.ts): `src/checkout/src/checkout/shipping/MockShippingService.ts`
- [Orders Client](https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/checkout/orders/HttpOrdersService.ts): `src/checkout/src/checkout/orders/HttpOrdersService.ts`

### Commerce Services

- **Cart API**
- **Orders API**
- **Cart Database**
- **Orders Database**

### Runtime Operations

- [Health Diagnostics](https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/app.controller.ts): `src/checkout/src/app.controller.ts`
- [Chaos Controls](https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/chaos/chaos.controller.ts): `src/checkout/src/chaos/chaos.controller.ts`
- [Chaos Runtime](https://github.com/tranduyloc895/retail-store-microservices/blob/main/src/checkout/src/chaos/chaos.service.ts): `src/checkout/src/chaos/chaos.service.ts`

### Other components

- **Customer**

## Connections

- Customer → Web Storefront: uses
- Web Storefront → Catalog API: calls
- Web Storefront → Cart API: calls
- Web Storefront → Orders API: calls
- Web Storefront → Checkout API: calls
- Catalog API → Catalog Logic: dispatches
- Catalog Logic → Catalog Repository: queries
- Catalog Repository → Catalog Database: reads
- Checkout API → Checkout Orchestrator: dispatches
- Checkout Orchestrator → Checkout Repository: reads/writes
- Checkout Repository → Redis Store: stores
- Checkout Orchestrator → Shipping Rates: gets rates
- Checkout Orchestrator → Orders Client: creates order
- Orders Client → Orders API: calls
- Cart API → Cart Database: reads/writes
- Orders API → Orders Database: reads/writes
- Health Diagnostics → Redis Store: checks
- Chaos Controls → Chaos Runtime: configures
- Chaos Runtime → Checkout API: modulates
