# vanh251/omnichannel-e-commerce-platform architecture

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

- Interactive diagram: https://gitdiagram.com/vanh251/omnichannel-e-commerce-platform
- Repository: https://github.com/vanh251/omnichannel-e-commerce-platform

## Overview

This is a Java/Spring omnichannel e-commerce backend: web, mobile, and store clients share identity, catalog, inventory, order, and payment services. The principal workflow authenticates a customer, verifies catalog SKU and price, reserves stock while creating a pending order, then completes or compensates the order asynchronously from payment events; notification events are handled separately. The README documents the service boundaries and event flow, but most service implementations were not sampled, so those links cite the README rather than implying source inspection.

Main entry points: [`api-gateway/src/main/java/com/example/apigateway`](https://github.com/vanh251/omnichannel-e-commerce-platform/tree/main/api-gateway/src/main/java/com/example/apigateway) (API gateway), [`order-inventory-service/src/main/java/com/example/orderinventoryservice`](https://github.com/vanh251/omnichannel-e-commerce-platform/tree/main/order-inventory-service/src/main/java/com/example/orderinventoryservice) (Order and inventory), [`payment-service/src/main/java/com/example/paymentservice`](https://github.com/vanh251/omnichannel-e-commerce-platform/tree/main/payment-service/src/main/java/com/example/paymentservice) (Payment service), [`product-service/src/main`](https://github.com/vanh251/omnichannel-e-commerce-platform/tree/main/product-service/src/main) (Product catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_edge["Entry and identity"]
  node_gateway["API gateway"]
  node_identity["Identity service"]
  node_identitydb[("Identity PostgreSQL")]
end

subgraph group_catalog["Catalog and inventory"]
  node_product["Product catalog"]
  node_productdb[("Product MongoDB")]
  node_order["Order and inventory"]
  node_orderdb[("Order PostgreSQL")]
end

subgraph group_commerce["Orders and payments"]
  node_payment["Payment service"]
  node_paymentdb[("Payment PostgreSQL")]
  node_payos["payOS"]
end

subgraph group_messaging["Events and notifications"]
  node_rabbit["RabbitMQ exchange and queues"]
  node_notification["Notification service"]
  node_notificationdb[("Notification MongoDB")]
  node_smtp["SMTP / Mailpit"]
end

node_customer(("Web / mobile / store"))

node_customer -->|"calls REST"| node_gateway
node_gateway -->|"routes REST"| node_identity
node_gateway -->|"routes REST"| node_product
node_gateway -->|"routes REST"| node_order
node_gateway -->|"routes REST"| node_payment
node_identity -->|"stores identity"| node_identitydb
node_identity -->|"publishes outbox events"| node_rabbit
node_product -->|"stores catalog"| node_productdb
node_order -->|"verifies SKU and price"| node_product
node_product -->|"returns product details"| node_order
node_order -->|"stores orders and outbox"| node_orderdb
node_order -->|"publishes order events"| node_rabbit
node_rabbit -->|"dispatches payment events"| node_order
node_payment -->|"stores payment and outbox"| node_paymentdb
node_payment -.->|"creates links and reconciles"| node_payos
node_payos -->|"sends webhook"| node_gateway
node_payment -->|"publishes payment events"| node_rabbit
node_rabbit -->|"dispatches order events"| node_payment
node_rabbit -->|"dispatches notification events"| node_notification
node_notification -->|"stores email jobs"| node_notificationdb
node_notification -->|"sends transactional email"| node_smtp

click node_gateway "https://github.com/vanh251/omnichannel-e-commerce-platform/tree/main/api-gateway/src/main/java/com/example/apigateway"
click node_identity "https://github.com/vanh251/omnichannel-e-commerce-platform/tree/main/identity-service/src/main/java/com/example/identityservice"
click node_product "https://github.com/vanh251/omnichannel-e-commerce-platform/tree/main/product-service/src/main"
click node_order "https://github.com/vanh251/omnichannel-e-commerce-platform/tree/main/order-inventory-service/src/main/java/com/example/orderinventoryservice"
click node_payment "https://github.com/vanh251/omnichannel-e-commerce-platform/tree/main/payment-service/src/main/java/com/example/paymentservice"
click node_notification "https://github.com/vanh251/omnichannel-e-commerce-platform/tree/main/notification-service/src/main/java/com/example/notificationservice"

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_gateway,node_identity,node_identitydb toneBlue
class node_product,node_productdb,node_order,node_orderdb toneAmber
class node_payment,node_paymentdb,node_payos toneMint
class node_rabbit,node_notification,node_notificationdb,node_smtp toneRose
class node_customer toneIndigo
```

## Components

### Entry and identity

- [API gateway](https://github.com/vanh251/omnichannel-e-commerce-platform/tree/main/api-gateway/src/main/java/com/example/apigateway): `api-gateway/src/main/java/com/example/apigateway`
- [Identity service](https://github.com/vanh251/omnichannel-e-commerce-platform/tree/main/identity-service/src/main/java/com/example/identityservice): `identity-service/src/main/java/com/example/identityservice`
- **Identity PostgreSQL**

### Catalog and inventory

- [Product catalog](https://github.com/vanh251/omnichannel-e-commerce-platform/tree/main/product-service/src/main): `product-service/src/main`
- **Product MongoDB**
- [Order and inventory](https://github.com/vanh251/omnichannel-e-commerce-platform/tree/main/order-inventory-service/src/main/java/com/example/orderinventoryservice): `order-inventory-service/src/main/java/com/example/orderinventoryservice`
- **Order PostgreSQL**

### Orders and payments

- [Payment service](https://github.com/vanh251/omnichannel-e-commerce-platform/tree/main/payment-service/src/main/java/com/example/paymentservice): `payment-service/src/main/java/com/example/paymentservice`
- **Payment PostgreSQL**
- **payOS**

### Events and notifications

- **RabbitMQ exchange and queues**
- [Notification service](https://github.com/vanh251/omnichannel-e-commerce-platform/tree/main/notification-service/src/main/java/com/example/notificationservice): `notification-service/src/main/java/com/example/notificationservice`
- **Notification MongoDB**
- **SMTP / Mailpit**

### Other components

- **Web / mobile / store**

## Connections

- Web / mobile / store → API gateway: calls REST (evidence: `README.md`)
- API gateway → Identity service: routes REST (evidence: `README.md`)
- API gateway → Product catalog: routes REST (evidence: `README.md`)
- API gateway → Order and inventory: routes REST (evidence: `README.md`)
- API gateway → Payment service: routes REST (evidence: `README.md`)
- Identity service → Identity PostgreSQL: stores identity (evidence: `README.md`)
- Identity service → RabbitMQ exchange and queues: publishes outbox events (evidence: `README.md`)
- Product catalog → Product MongoDB: stores catalog (evidence: `README.md`)
- Order and inventory → Product catalog: verifies SKU and price (evidence: `README.md`)
- Product catalog → Order and inventory: returns product details (evidence: `README.md`)
- Order and inventory → Order PostgreSQL: stores orders and outbox (evidence: `README.md`)
- Order and inventory → RabbitMQ exchange and queues: publishes order events (evidence: `README.md`)
- RabbitMQ exchange and queues → Order and inventory: dispatches payment events (evidence: `README.md`)
- Payment service → Payment PostgreSQL: stores payment and outbox (evidence: `README.md`)
- Payment service → payOS: creates links and reconciles (evidence: `README.md`)
- payOS → API gateway: sends webhook (evidence: `README.md`)
- Payment service → RabbitMQ exchange and queues: publishes payment events (evidence: `README.md`)
- RabbitMQ exchange and queues → Payment service: dispatches order events (evidence: `README.md`)
- RabbitMQ exchange and queues → Notification service: dispatches notification events (evidence: `README.md`)
- Notification service → Notification MongoDB: stores email jobs (evidence: `README.md`)
- Notification service → SMTP / Mailpit: sends transactional email (evidence: `README.md`)
