# raphaeldiscky/go-micro-commerce architecture

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

- Interactive diagram: https://gitdiagram.com/raphaeldiscky/go-micro-commerce
- Repository: https://github.com/raphaeldiscky/go-micro-commerce

## Overview

Go Micro Commerce is a distributed commerce application: customers and administrators use a web storefront backed by independently deployed Go services, with API gateways and federated GraphQL interfaces. The main customer path spans authentication, product discovery, cart and checkout, payment, fulfillment, and order updates; chat and notifications are parallel capabilities. The graph retains these documented product stages and key asynchronous and real-time mechanisms. Evidence is limited to the README, tree, and supplied excerpts/index; unshown service-to-service wiring is not asserted.

Main entry points: [`graphql-gateway`](https://github.com/raphaeldiscky/go-micro-commerce/tree/main/graphql-gateway) (Federated gateway), [`order-service/internal`](https://github.com/raphaeldiscky/go-micro-commerce/tree/main/order-service/internal) (Order management), [`cart-service/internal/service`](https://github.com/raphaeldiscky/go-micro-commerce/tree/main/cart-service/internal/service) (Cart and checkout), [`auth-service/internal/service/auth_service.go`](https://github.com/raphaeldiscky/go-micro-commerce/blob/main/auth-service/internal/service/auth_service.go) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_frontend["Storefront"]
  node_frontend_gql["GraphQL clients"]
end

subgraph group_access["API access"]
  node_router["Federated gateway"]
  node_api_gateway["REST gateway"]
end

subgraph group_commerce["Commerce services"]
  node_auth["Authentication<br/>[auth_service.go]"]
  node_product["Product catalog"]
  node_search["Product search<br/>[search_service.go]"]
  node_cart["Cart and checkout"]
  node_orders["Order management"]
  node_payment["Payments"]
  node_fulfillment["Fulfillment"]
end

subgraph group_engagement["Customer engagement"]
  node_chat["Chat"]
  node_notifications["Notifications<br/>[manager.go]"]
end

subgraph group_platform["Messaging and data"]
  node_kafka["Event streaming"]
  node_redis["Redis pub/sub"]
  node_postgres[("Service databases")]
  node_elasticsearch[("Search index")]
  node_temporal["Workflow engine"]
end

node_customer(("Customer"))
node_courier["Carrier service"]
node_stripe["Payment provider"]

node_customer -->|"uses"| node_frontend
node_frontend -.->|"queries"| node_frontend_gql
node_frontend_gql -.->|"sends GraphQL"| node_router
node_customer -.->|"calls REST"| node_api_gateway
node_router -.->|"routes federation"| node_auth
node_router -.->|"routes federation"| node_product
node_router -.->|"routes federation"| node_cart
node_router -.->|"routes federation"| node_orders
node_router -.->|"routes federation"| node_payment
node_api_gateway -.->|"proxies requests"| node_product
node_api_gateway -.->|"proxies requests"| node_auth
node_customer -.->|"signs in"| node_auth
node_customer -.->|"searches products"| node_search
node_search -->|"queries index"| node_elasticsearch
node_customer -.->|"checks out"| node_cart
node_cart -->|"persists sessions"| node_postgres
node_customer -.->|"pays"| node_payment
node_payment -.->|"charges"| node_stripe
node_orders -.->|"requests fulfillment"| node_fulfillment
node_orders -.->|"orchestrates saga"| node_temporal
node_fulfillment -->|"creates shipment"| node_courier
node_fulfillment -.->|"stores fulfillment"| node_postgres
node_auth -.->|"stores identity"| node_postgres
node_orders -.->|"publishes events"| node_kafka
node_kafka -.->|"delivers events"| node_notifications
node_cart -.->|"publishes events"| node_kafka
node_chat -->|"subscribes events"| node_redis
node_notifications -->|"subscribes events"| node_redis
node_customer -.->|"chats"| node_chat
node_customer -.->|"receives updates"| node_notifications

click node_frontend "https://github.com/raphaeldiscky/go-micro-commerce/tree/main/frontend/src/routes"
click node_frontend_gql "https://github.com/raphaeldiscky/go-micro-commerce/tree/main/frontend/src/lib/graphql"
click node_router "https://github.com/raphaeldiscky/go-micro-commerce/tree/main/graphql-gateway"
click node_api_gateway "https://github.com/raphaeldiscky/go-micro-commerce/tree/main/api-gateway/internal/gateway"
click node_auth "https://github.com/raphaeldiscky/go-micro-commerce/blob/main/auth-service/internal/service/auth_service.go"
click node_product "https://github.com/raphaeldiscky/go-micro-commerce/tree/main/product-service/internal"
click node_search "https://github.com/raphaeldiscky/go-micro-commerce/blob/main/search-service/internal/service/search_service.go"
click node_cart "https://github.com/raphaeldiscky/go-micro-commerce/tree/main/cart-service/internal/service"
click node_orders "https://github.com/raphaeldiscky/go-micro-commerce/tree/main/order-service/internal"
click node_payment "https://github.com/raphaeldiscky/go-micro-commerce/tree/main/payment-service/internal"
click node_fulfillment "https://github.com/raphaeldiscky/go-micro-commerce/blob/main/fulfillment-service/internal/service/fulfillment_service.go"
click node_chat "https://github.com/raphaeldiscky/go-micro-commerce/tree/main/chat-service/internal"
click node_notifications "https://github.com/raphaeldiscky/go-micro-commerce/blob/main/notification-service/internal/subscription/manager.go"
click node_temporal "https://github.com/raphaeldiscky/go-micro-commerce/blob/main/pkg/temporal/schedule_manager.go"

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,node_frontend_gql toneBlue
class node_router,node_api_gateway toneAmber
class node_auth,node_product,node_search,node_cart,node_orders,node_payment,node_fulfillment toneMint
class node_chat,node_notifications toneRose
class node_kafka,node_redis,node_postgres,node_elasticsearch,node_temporal,node_customer,node_courier,node_stripe toneIndigo
```

## Components

### Web experience

- [Storefront](https://github.com/raphaeldiscky/go-micro-commerce/tree/main/frontend/src/routes): `frontend/src/routes`
- [GraphQL clients](https://github.com/raphaeldiscky/go-micro-commerce/tree/main/frontend/src/lib/graphql): `frontend/src/lib/graphql`

### API access

- [Federated gateway](https://github.com/raphaeldiscky/go-micro-commerce/tree/main/graphql-gateway): `graphql-gateway`
- [REST gateway](https://github.com/raphaeldiscky/go-micro-commerce/tree/main/api-gateway/internal/gateway): `api-gateway/internal/gateway`

### Commerce services

- [Authentication](https://github.com/raphaeldiscky/go-micro-commerce/blob/main/auth-service/internal/service/auth_service.go): `auth-service/internal/service/auth_service.go`
- [Product catalog](https://github.com/raphaeldiscky/go-micro-commerce/tree/main/product-service/internal): `product-service/internal`
- [Product search](https://github.com/raphaeldiscky/go-micro-commerce/blob/main/search-service/internal/service/search_service.go): `search-service/internal/service/search_service.go`
- [Cart and checkout](https://github.com/raphaeldiscky/go-micro-commerce/tree/main/cart-service/internal/service): `cart-service/internal/service`
- [Order management](https://github.com/raphaeldiscky/go-micro-commerce/tree/main/order-service/internal): `order-service/internal`
- [Payments](https://github.com/raphaeldiscky/go-micro-commerce/tree/main/payment-service/internal): `payment-service/internal`
- [Fulfillment](https://github.com/raphaeldiscky/go-micro-commerce/blob/main/fulfillment-service/internal/service/fulfillment_service.go): `fulfillment-service/internal/service/fulfillment_service.go`

### Customer engagement

- [Chat](https://github.com/raphaeldiscky/go-micro-commerce/tree/main/chat-service/internal): `chat-service/internal`
- [Notifications](https://github.com/raphaeldiscky/go-micro-commerce/blob/main/notification-service/internal/subscription/manager.go): `notification-service/internal/subscription/manager.go`

### Messaging and data

- **Event streaming**
- **Redis pub/sub**
- **Service databases**
- **Search index**
- [Workflow engine](https://github.com/raphaeldiscky/go-micro-commerce/blob/main/pkg/temporal/schedule_manager.go): `pkg/temporal/schedule_manager.go`

### Other components

- **Customer**
- **Carrier service**
- **Payment provider**

## Connections

- Customer → Storefront: uses
- Storefront → GraphQL clients: queries
- GraphQL clients → Federated gateway: sends GraphQL
- Customer → REST gateway: calls REST
- Federated gateway → Authentication: routes federation
- Federated gateway → Product catalog: routes federation
- Federated gateway → Cart and checkout: routes federation
- Federated gateway → Order management: routes federation
- Federated gateway → Payments: routes federation
- REST gateway → Product catalog: proxies requests
- REST gateway → Authentication: proxies requests
- Customer → Authentication: signs in
- Customer → Product search: searches products
- Product search → Search index: queries index
- Customer → Cart and checkout: checks out
- Cart and checkout → Service databases: persists sessions
- Customer → Payments: pays
- Payments → Payment provider: charges
- Order management → Fulfillment: requests fulfillment
- Order management → Workflow engine: orchestrates saga
- Fulfillment → Carrier service: creates shipment (evidence: `fulfillment-service/internal/service/fulfillment_service.go`)
- Fulfillment → Service databases: stores fulfillment
- Authentication → Service databases: stores identity
- Order management → Event streaming: publishes events
- Event streaming → Notifications: delivers events
- Cart and checkout → Event streaming: publishes events
- Chat → Redis pub/sub: subscribes events (evidence: `chat-service/internal/subscription/manager.go`)
- Notifications → Redis pub/sub: subscribes events (evidence: `notification-service/internal/subscription/manager.go`)
- Customer → Chat: chats
- Customer → Notifications: receives updates
