# slayersarthak/microservices-demo architecture

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

- Interactive diagram: https://gitdiagram.com/slayersarthak/microservices-demo
- Repository: https://github.com/slayersarthak/microservices-demo

## Overview

Online Boutique is a multilingual gRPC e-commerce demo. Users browse products, manage a cart, and place an order through the web frontend; checkout prepares the order, obtains prices and a shipping quote, charges payment, ships the items, and requests confirmation email. The README also identifies recommendations, ads, and currency conversion as product services. Checkout’s orchestration calls are visible in its excerpt; many frontend and auxiliary-service connections are documented only at a high level, so those links are marked unverified or omitted.

Main entry points: [`src/frontend/handlers.go`](https://github.com/slayersarthak/microservices-demo/blob/main/src/frontend/handlers.go) (Web frontend), [`src/checkoutservice/main.go`](https://github.com/slayersarthak/microservices-demo/blob/main/src/checkoutservice/main.go) (Checkout orchestration), [`src/cartservice/src/cartstore/ICartStore.cs`](https://github.com/slayersarthak/microservices-demo/blob/main/src/cartservice/src/cartstore/ICartStore.cs) (Cart store interface), [`src/cartservice/src/services/CartService.cs`](https://github.com/slayersarthak/microservices-demo/blob/main/src/cartservice/src/services/CartService.cs) (Cart service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_frontend["Web frontend<br/>[handlers.go]"]
end

subgraph group_checkout["Order workflow"]
  node_checkout["Checkout orchestration<br/>[main.go]"]
end

subgraph group_commerce["Commerce services"]
  node_catalog["Product catalog<br/>[server.go]"]
  node_currency["Currency conversion<br/>[server.js]"]
  node_payment["Payment<br/>[server.js]"]
  node_shipping["Shipping<br/>[main.go]"]
  node_email["Order email<br/>[email_server.py]"]
end

subgraph group_cart["Cart and storage"]
  node_cartservice["Cart service<br/>[CartService.cs]"]
  node_cartstore["Cart store interface<br/>[ICartStore.cs]"]
  node_redisstore[("Redis cart store<br/>[RedisCartStore.cs]")]
  node_spannercart[("Spanner cart store")]
  node_alloycart[("AlloyDB cart store")]
end

subgraph group_discovery["Discovery services"]
  node_recommendation["Recommendations"]
  node_ads["Contextual ads<br/>[AdService.java]"]
  node_assistant["Shopping assistant"]
end

node_shopper(("Shopper"))
node_loadgen(("Load generator<br/>[locustfile.py]"))

node_shopper -->|"browses and orders"| node_frontend
node_loadgen -->|"sends requests"| node_frontend
node_frontend -.->|"places orders"| node_checkout
node_frontend -.->|"browses products"| node_catalog
node_frontend -.->|"manages cart"| node_cartservice
node_frontend -.->|"requests conversion"| node_currency
node_frontend -.->|"requests suggestions"| node_recommendation
node_frontend -.->|"requests ads"| node_ads
node_checkout -->|"reads and empties"| node_cartservice
node_checkout -->|"gets products"| node_catalog
node_checkout -->|"converts prices"| node_currency
node_checkout -->|"quotes and ships"| node_shipping
node_checkout -->|"charges card"| node_payment
node_checkout -->|"sends confirmation"| node_email
node_cartservice -->|"delegates cart operations"| node_cartstore
node_cartstore -.->|"implemented by"| node_redisstore
node_cartstore -.->|"implemented by"| node_spannercart
node_cartstore -.->|"implemented by"| node_alloycart

click node_frontend "https://github.com/slayersarthak/microservices-demo/blob/main/src/frontend/handlers.go"
click node_checkout "https://github.com/slayersarthak/microservices-demo/blob/main/src/checkoutservice/main.go"
click node_catalog "https://github.com/slayersarthak/microservices-demo/blob/main/src/productcatalogservice/server.go"
click node_currency "https://github.com/slayersarthak/microservices-demo/blob/main/src/currencyservice/server.js"
click node_payment "https://github.com/slayersarthak/microservices-demo/blob/main/src/paymentservice/server.js"
click node_shipping "https://github.com/slayersarthak/microservices-demo/blob/main/src/shippingservice/main.go"
click node_email "https://github.com/slayersarthak/microservices-demo/blob/main/src/emailservice/email_server.py"
click node_cartservice "https://github.com/slayersarthak/microservices-demo/blob/main/src/cartservice/src/services/CartService.cs"
click node_cartstore "https://github.com/slayersarthak/microservices-demo/blob/main/src/cartservice/src/cartstore/ICartStore.cs"
click node_redisstore "https://github.com/slayersarthak/microservices-demo/blob/main/src/cartservice/src/cartstore/RedisCartStore.cs"
click node_spannercart "https://github.com/slayersarthak/microservices-demo/blob/main/src/cartservice/src/cartstore/SpannerCartStore.cs"
click node_alloycart "https://github.com/slayersarthak/microservices-demo/blob/main/src/cartservice/src/cartstore/AlloyDBCartStore.cs"
click node_recommendation "https://github.com/slayersarthak/microservices-demo/blob/main/src/recommendationservice/recommendation_server.py"
click node_ads "https://github.com/slayersarthak/microservices-demo/blob/main/src/adservice/src/main/java/hipstershop/AdService.java"
click node_assistant "https://github.com/slayersarthak/microservices-demo/blob/main/src/shoppingassistantservice/shoppingassistantservice.py"
click node_loadgen "https://github.com/slayersarthak/microservices-demo/blob/main/src/loadgenerator/locustfile.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_frontend toneBlue
class node_checkout toneAmber
class node_catalog,node_currency,node_payment,node_shipping,node_email toneMint
class node_cartservice,node_cartstore,node_redisstore,node_spannercart,node_alloycart toneRose
class node_recommendation,node_ads,node_assistant,node_shopper toneIndigo
class node_loadgen toneTeal
```

## Components

### Storefront

- [Web frontend](https://github.com/slayersarthak/microservices-demo/blob/main/src/frontend/handlers.go): `src/frontend/handlers.go`

### Order workflow

- [Checkout orchestration](https://github.com/slayersarthak/microservices-demo/blob/main/src/checkoutservice/main.go): `src/checkoutservice/main.go`

### Commerce services

- [Product catalog](https://github.com/slayersarthak/microservices-demo/blob/main/src/productcatalogservice/server.go): `src/productcatalogservice/server.go`
- [Currency conversion](https://github.com/slayersarthak/microservices-demo/blob/main/src/currencyservice/server.js): `src/currencyservice/server.js`
- [Payment](https://github.com/slayersarthak/microservices-demo/blob/main/src/paymentservice/server.js): `src/paymentservice/server.js`
- [Shipping](https://github.com/slayersarthak/microservices-demo/blob/main/src/shippingservice/main.go): `src/shippingservice/main.go`
- [Order email](https://github.com/slayersarthak/microservices-demo/blob/main/src/emailservice/email_server.py): `src/emailservice/email_server.py`

### Cart and storage

- [Cart service](https://github.com/slayersarthak/microservices-demo/blob/main/src/cartservice/src/services/CartService.cs): `src/cartservice/src/services/CartService.cs`
- [Cart store interface](https://github.com/slayersarthak/microservices-demo/blob/main/src/cartservice/src/cartstore/ICartStore.cs): `src/cartservice/src/cartstore/ICartStore.cs`
- [Redis cart store](https://github.com/slayersarthak/microservices-demo/blob/main/src/cartservice/src/cartstore/RedisCartStore.cs): `src/cartservice/src/cartstore/RedisCartStore.cs`
- [Spanner cart store](https://github.com/slayersarthak/microservices-demo/blob/main/src/cartservice/src/cartstore/SpannerCartStore.cs): `src/cartservice/src/cartstore/SpannerCartStore.cs`
- [AlloyDB cart store](https://github.com/slayersarthak/microservices-demo/blob/main/src/cartservice/src/cartstore/AlloyDBCartStore.cs): `src/cartservice/src/cartstore/AlloyDBCartStore.cs`

### Discovery services

- [Recommendations](https://github.com/slayersarthak/microservices-demo/blob/main/src/recommendationservice/recommendation_server.py): `src/recommendationservice/recommendation_server.py`
- [Contextual ads](https://github.com/slayersarthak/microservices-demo/blob/main/src/adservice/src/main/java/hipstershop/AdService.java): `src/adservice/src/main/java/hipstershop/AdService.java`
- [Shopping assistant](https://github.com/slayersarthak/microservices-demo/blob/main/src/shoppingassistantservice/shoppingassistantservice.py): `src/shoppingassistantservice/shoppingassistantservice.py`

### Other components

- **Shopper**
- [Load generator](https://github.com/slayersarthak/microservices-demo/blob/main/src/loadgenerator/locustfile.py): `src/loadgenerator/locustfile.py`

## Connections

- Shopper → Web frontend: browses and orders
- Load generator → Web frontend: sends requests
- Web frontend → Checkout orchestration: places orders
- Web frontend → Product catalog: browses products
- Web frontend → Cart service: manages cart
- Web frontend → Currency conversion: requests conversion
- Web frontend → Recommendations: requests suggestions
- Web frontend → Contextual ads: requests ads
- Checkout orchestration → Cart service: reads and empties (evidence: `src/checkoutservice/main.go`)
- Checkout orchestration → Product catalog: gets products (evidence: `src/checkoutservice/main.go`)
- Checkout orchestration → Currency conversion: converts prices (evidence: `src/checkoutservice/main.go`)
- Checkout orchestration → Shipping: quotes and ships (evidence: `src/checkoutservice/main.go`)
- Checkout orchestration → Payment: charges card (evidence: `src/checkoutservice/main.go`)
- Checkout orchestration → Order email: sends confirmation (evidence: `src/checkoutservice/main.go`)
- Cart service → Cart store interface: delegates cart operations (evidence: `src/cartservice/src/services/CartService.cs`)
- Cart store interface → Redis cart store: implemented by
- Cart store interface → Spanner cart store: implemented by (evidence: `src/cartservice/src/cartstore/SpannerCartStore.cs`)
- Cart store interface → AlloyDB cart store: implemented by
