# mouadfiali/gke-cloud-project architecture

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

- Interactive diagram: https://gitdiagram.com/mouadfiali/gke-cloud-project
- Repository: https://github.com/mouadfiali/gke-cloud-project

## Overview

This is the application layer of a cloud-native online-shop demo: a user-facing storefront coordinates product discovery, cart operations and checkout, with separate services for recommendations, ads, currency, payments, shipping and email. The clearest sampled runtime flow is checkout calling cart, shipping and email services; the cart service delegates persistence through a store interface. The README also describes deployment, scaling and observability enhancements, but their implementation is outside the supplied source tree. Several service interactions are therefore not shown and are not asserted here.

Main entry points: [`src/frontend/handlers.go`](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/frontend/handlers.go) (Storefront), [`src/cartservice/src/cartstore/ICartStore.cs`](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/cartservice/src/cartstore/ICartStore.cs) (Cart store), [`src/checkoutservice/main.go`](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/checkoutservice/main.go) (Checkout service), [`src/cartservice/src/services/CartService.cs`](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/cartservice/src/services/CartService.cs) (Cart service)

## Diagram (Mermaid)

```mermaid
flowchart TD

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

subgraph group_commerce["Commerce services"]
  node_cart["Cart service<br/>[CartService.cs]"]
  node_cartstore["Cart store<br/>[ICartStore.cs]"]
  node_redisstore[("Redis store<br/>[RedisCartStore.cs]")]
  node_spannastore[("Spanner store")]
  node_alloystore[("AlloyDB store")]
  node_checkout["Checkout service<br/>[main.go]"]
  node_payment["Payment service<br/>[server.js]"]
end

subgraph group_discovery["Discovery services"]
  node_catalog["Product catalog<br/>[product_catalog.go]"]
  node_recommendations["Recommendations"]
  node_ads["Ad service<br/>[AdService.java]"]
end

subgraph group_support["Supporting services"]
  node_shipping["Shipping service<br/>[main.go]"]
  node_email["Email service<br/>[email_server.py]"]
  node_currency["Currency service<br/>[server.js]"]
  node_assistant["Shopping assistant"]
  node_loadgen["Load generator<br/>[locustfile.py]"]
end

node_shopper(("Shopper"))

node_shopper -.->|"uses"| node_frontend
node_frontend -.->|"requests products"| node_catalog
node_frontend -.->|"requests suggestions"| node_recommendations
node_frontend -.->|"requests ads"| node_ads
node_frontend -.->|"updates cart"| node_cart
node_frontend -.->|"submits checkout"| node_checkout
node_checkout -->|"gets cart"| node_cart
node_checkout -->|"gets quote"| node_shipping
node_checkout -->|"sends confirmation"| node_email
node_cart -->|"uses store"| node_cartstore
node_cartstore -.->|"implemented by"| node_redisstore
node_cartstore -.->|"implemented by"| node_spannastore
node_cartstore -.->|"implemented by"| node_alloystore
node_loadgen -.->|"generates traffic"| node_frontend

click node_frontend "https://github.com/mouadfiali/gke-cloud-project/blob/master/src/frontend/handlers.go"
click node_catalog "https://github.com/mouadfiali/gke-cloud-project/blob/master/src/productcatalogservice/product_catalog.go"
click node_recommendations "https://github.com/mouadfiali/gke-cloud-project/blob/master/src/recommendationservice/recommendation_server.py"
click node_ads "https://github.com/mouadfiali/gke-cloud-project/blob/master/src/adservice/src/main/java/hipstershop/AdService.java"
click node_cart "https://github.com/mouadfiali/gke-cloud-project/blob/master/src/cartservice/src/services/CartService.cs"
click node_cartstore "https://github.com/mouadfiali/gke-cloud-project/blob/master/src/cartservice/src/cartstore/ICartStore.cs"
click node_redisstore "https://github.com/mouadfiali/gke-cloud-project/blob/master/src/cartservice/src/cartstore/RedisCartStore.cs"
click node_spannastore "https://github.com/mouadfiali/gke-cloud-project/blob/master/src/cartservice/src/cartstore/SpannerCartStore.cs"
click node_alloystore "https://github.com/mouadfiali/gke-cloud-project/blob/master/src/cartservice/src/cartstore/AlloyDBCartStore.cs"
click node_checkout "https://github.com/mouadfiali/gke-cloud-project/blob/master/src/checkoutservice/main.go"
click node_payment "https://github.com/mouadfiali/gke-cloud-project/blob/master/src/paymentservice/server.js"
click node_shipping "https://github.com/mouadfiali/gke-cloud-project/blob/master/src/shippingservice/main.go"
click node_email "https://github.com/mouadfiali/gke-cloud-project/blob/master/src/emailservice/email_server.py"
click node_currency "https://github.com/mouadfiali/gke-cloud-project/blob/master/src/currencyservice/server.js"
click node_assistant "https://github.com/mouadfiali/gke-cloud-project/blob/master/src/shoppingassistantservice/shoppingassistantservice.py"
click node_loadgen "https://github.com/mouadfiali/gke-cloud-project/blob/master/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_cart,node_cartstore,node_redisstore,node_spannastore,node_alloystore,node_checkout,node_payment toneAmber
class node_catalog,node_recommendations,node_ads toneMint
class node_shipping,node_email,node_currency,node_assistant,node_loadgen toneRose
class node_shopper toneIndigo
```

## Components

### Storefront

- [Storefront](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/frontend/handlers.go): `src/frontend/handlers.go`

### Commerce services

- [Cart service](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/cartservice/src/services/CartService.cs): `src/cartservice/src/services/CartService.cs`
- [Cart store](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/cartservice/src/cartstore/ICartStore.cs): `src/cartservice/src/cartstore/ICartStore.cs`
- [Redis store](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/cartservice/src/cartstore/RedisCartStore.cs): `src/cartservice/src/cartstore/RedisCartStore.cs`
- [Spanner store](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/cartservice/src/cartstore/SpannerCartStore.cs): `src/cartservice/src/cartstore/SpannerCartStore.cs`
- [AlloyDB store](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/cartservice/src/cartstore/AlloyDBCartStore.cs): `src/cartservice/src/cartstore/AlloyDBCartStore.cs`
- [Checkout service](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/checkoutservice/main.go): `src/checkoutservice/main.go`
- [Payment service](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/paymentservice/server.js): `src/paymentservice/server.js`

### Discovery services

- [Product catalog](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/productcatalogservice/product_catalog.go): `src/productcatalogservice/product_catalog.go`
- [Recommendations](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/recommendationservice/recommendation_server.py): `src/recommendationservice/recommendation_server.py`
- [Ad service](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/adservice/src/main/java/hipstershop/AdService.java): `src/adservice/src/main/java/hipstershop/AdService.java`

### Supporting services

- [Shipping service](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/shippingservice/main.go): `src/shippingservice/main.go`
- [Email service](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/emailservice/email_server.py): `src/emailservice/email_server.py`
- [Currency service](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/currencyservice/server.js): `src/currencyservice/server.js`
- [Shopping assistant](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/shoppingassistantservice/shoppingassistantservice.py): `src/shoppingassistantservice/shoppingassistantservice.py`
- [Load generator](https://github.com/mouadfiali/gke-cloud-project/blob/master/src/loadgenerator/locustfile.py): `src/loadgenerator/locustfile.py`

### Other components

- **Shopper**

## Connections

- Shopper → Storefront: uses
- Storefront → Product catalog: requests products
- Storefront → Recommendations: requests suggestions
- Storefront → Ad service: requests ads
- Storefront → Cart service: updates cart
- Storefront → Checkout service: submits checkout
- Checkout service → Cart service: gets cart (evidence: `src/checkoutservice/main.go`)
- Checkout service → Shipping service: gets quote (evidence: `src/checkoutservice/main.go`)
- Checkout service → Email service: sends confirmation (evidence: `src/checkoutservice/main.go`)
- Cart service → Cart store: uses store (evidence: `src/cartservice/src/services/CartService.cs`)
- Cart store → Redis store: implemented by
- Cart store → Spanner store: implemented by (evidence: `src/cartservice/src/cartstore/SpannerCartStore.cs`)
- Cart store → AlloyDB store: implemented by
- Load generator → Storefront: generates traffic
