# ssurajparfr/e-commerce architecture

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

- Interactive diagram: https://gitdiagram.com/ssurajparfr/e-commerce
- Repository: https://github.com/ssurajparfr/e-commerce

## Overview

CommerceOps is a France/EU e-commerce storefront with a React frontend and Spring Boot modular-monolith backend. The documented guest-buying journey is catalog browsing, cart, checkout with simulated payment, and order confirmation; the sampled pages show the corresponding API requests and navigation. Backend modules and PostgreSQL are included as product subsystems, but their implementation excerpts were not provided, so internal backend calls and persistence links are not asserted. The README describes Kafka and Redis as later or optional, not part of the first increment.

Main entry points: [`frontend/src/pages/Catalog.tsx`](https://github.com/ssurajparfr/e-commerce/blob/main/frontend/src/pages/Catalog.tsx) (Catalog page), [`frontend/src/App.tsx`](https://github.com/ssurajparfr/e-commerce/blob/main/frontend/src/App.tsx) (Route shell), [`frontend/src/pages/Cart.tsx`](https://github.com/ssurajparfr/e-commerce/blob/main/frontend/src/pages/Cart.tsx) (Cart page), [`frontend/src/pages/Checkout.tsx`](https://github.com/ssurajparfr/e-commerce/blob/main/frontend/src/pages/Checkout.tsx) (Checkout page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["Route shell<br/>[App.tsx]"]
  node_catalog_ui["Catalog page<br/>[Catalog.tsx]"]
  node_cart_ui["Cart page<br/>[Cart.tsx]"]
  node_checkout_ui["Checkout page<br/>[Checkout.tsx]"]
  node_confirmation_ui["Confirmation page<br/>[Confirmation.tsx]"]
  node_money["Money formatting<br/>[money.ts]"]
end

subgraph group_commerce["Commerce domains"]
  node_catalog["Catalog domain"]
  node_cart["Cart domain<br/>[CartService.java]"]
  node_inventory["Inventory domain"]
  node_orders["Order domain<br/>[Order.java]"]
end

subgraph group_checkout["Checkout and payment"]
  node_checkout_service["Checkout orchestration"]
  node_idempotency["Checkout idempotency"]
  node_payments["Payment service"]
  node_mock_provider["Mock payment provider"]
end

subgraph group_platform["Application platform"]
  node_database[("PostgreSQL")]
  node_application["Spring application"]
  node_trace["Trace filter<br/>[TraceFilter.java]"]
  node_errors["Error handling"]
end

node_shopper(("Shopper"))

node_shopper -->|"uses"| node_app
node_app -->|"routes to"| node_catalog_ui
node_app -->|"routes to"| node_cart_ui
node_app -->|"routes to"| node_checkout_ui
node_app -->|"routes to"| node_confirmation_ui
node_catalog_ui -->|"formats prices"| node_money
node_cart_ui -->|"formats prices"| node_money
node_confirmation_ui -->|"formats totals"| node_money
node_catalog_ui -.->|"requests products"| node_catalog
node_catalog_ui -.->|"adds items"| node_cart
node_cart_ui -.->|"loads cart"| node_cart
node_checkout_ui -.->|"loads cart"| node_cart
node_checkout_ui -.->|"submits checkout"| node_checkout_service
node_confirmation_ui -.->|"loads order"| node_orders
node_shopper -->|"shops"| node_catalog_ui
node_catalog_ui -->|"continues to cart"| node_cart_ui
node_cart_ui -->|"continues to checkout"| node_checkout_ui
node_checkout_ui -->|"confirms order"| node_confirmation_ui

click node_app "https://github.com/ssurajparfr/e-commerce/blob/main/frontend/src/App.tsx"
click node_catalog_ui "https://github.com/ssurajparfr/e-commerce/blob/main/frontend/src/pages/Catalog.tsx"
click node_cart_ui "https://github.com/ssurajparfr/e-commerce/blob/main/frontend/src/pages/Cart.tsx"
click node_checkout_ui "https://github.com/ssurajparfr/e-commerce/blob/main/frontend/src/pages/Checkout.tsx"
click node_confirmation_ui "https://github.com/ssurajparfr/e-commerce/blob/main/frontend/src/pages/Confirmation.tsx"
click node_money "https://github.com/ssurajparfr/e-commerce/blob/main/frontend/src/lib/money.ts"
click node_catalog "https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/catalog/CatalogService.java"
click node_cart "https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/cart/CartService.java"
click node_inventory "https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/inventory/InventoryService.java"
click node_orders "https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/orders/Order.java"
click node_checkout_service "https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/checkout/CheckoutService.java"
click node_idempotency "https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/checkout/IdempotencyService.java"
click node_payments "https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/payments/PaymentService.java"
click node_mock_provider "https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/payments/MockPaymentProvider.java"
click node_application "https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/CommerceApplication.java"
click node_trace "https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/config/TraceFilter.java"
click node_errors "https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/common/GlobalExceptionHandler.java"

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_app,node_catalog_ui,node_cart_ui,node_checkout_ui,node_confirmation_ui,node_money toneBlue
class node_catalog,node_cart,node_inventory,node_orders toneAmber
class node_checkout_service,node_idempotency,node_payments,node_mock_provider toneMint
class node_database,node_application,node_trace,node_errors toneRose
class node_shopper toneIndigo
```

## Components

### Storefront

- [Route shell](https://github.com/ssurajparfr/e-commerce/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Catalog page](https://github.com/ssurajparfr/e-commerce/blob/main/frontend/src/pages/Catalog.tsx): `frontend/src/pages/Catalog.tsx`
- [Cart page](https://github.com/ssurajparfr/e-commerce/blob/main/frontend/src/pages/Cart.tsx): `frontend/src/pages/Cart.tsx`
- [Checkout page](https://github.com/ssurajparfr/e-commerce/blob/main/frontend/src/pages/Checkout.tsx): `frontend/src/pages/Checkout.tsx`
- [Confirmation page](https://github.com/ssurajparfr/e-commerce/blob/main/frontend/src/pages/Confirmation.tsx): `frontend/src/pages/Confirmation.tsx`
- [Money formatting](https://github.com/ssurajparfr/e-commerce/blob/main/frontend/src/lib/money.ts): `frontend/src/lib/money.ts`

### Commerce domains

- [Catalog domain](https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/catalog/CatalogService.java): `backend/src/main/java/com/example/commerce/catalog/CatalogService.java`
- [Cart domain](https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/cart/CartService.java): `backend/src/main/java/com/example/commerce/cart/CartService.java`
- [Inventory domain](https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/inventory/InventoryService.java): `backend/src/main/java/com/example/commerce/inventory/InventoryService.java`
- [Order domain](https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/orders/Order.java): `backend/src/main/java/com/example/commerce/orders/Order.java`

### Checkout and payment

- [Checkout orchestration](https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/checkout/CheckoutService.java): `backend/src/main/java/com/example/commerce/checkout/CheckoutService.java`
- [Checkout idempotency](https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/checkout/IdempotencyService.java): `backend/src/main/java/com/example/commerce/checkout/IdempotencyService.java`
- [Payment service](https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/payments/PaymentService.java): `backend/src/main/java/com/example/commerce/payments/PaymentService.java`
- [Mock payment provider](https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/payments/MockPaymentProvider.java): `backend/src/main/java/com/example/commerce/payments/MockPaymentProvider.java`

### Application platform

- **PostgreSQL**
- [Spring application](https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/CommerceApplication.java): `backend/src/main/java/com/example/commerce/CommerceApplication.java`
- [Trace filter](https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/config/TraceFilter.java): `backend/src/main/java/com/example/commerce/config/TraceFilter.java`
- [Error handling](https://github.com/ssurajparfr/e-commerce/blob/main/backend/src/main/java/com/example/commerce/common/GlobalExceptionHandler.java): `backend/src/main/java/com/example/commerce/common/GlobalExceptionHandler.java`

### Other components

- **Shopper**

## Connections

- Shopper → Route shell: uses
- Route shell → Catalog page: routes to (evidence: `frontend/src/App.tsx`)
- Route shell → Cart page: routes to (evidence: `frontend/src/App.tsx`)
- Route shell → Checkout page: routes to (evidence: `frontend/src/App.tsx`)
- Route shell → Confirmation page: routes to (evidence: `frontend/src/App.tsx`)
- Catalog page → Money formatting: formats prices (evidence: `frontend/src/pages/Catalog.tsx`)
- Cart page → Money formatting: formats prices (evidence: `frontend/src/pages/Cart.tsx`)
- Confirmation page → Money formatting: formats totals (evidence: `frontend/src/pages/Confirmation.tsx`)
- Catalog page → Catalog domain: requests products
- Catalog page → Cart domain: adds items
- Cart page → Cart domain: loads cart
- Checkout page → Cart domain: loads cart
- Checkout page → Checkout orchestration: submits checkout
- Confirmation page → Order domain: loads order
- Shopper → Catalog page: shops (evidence: `README.md`)
- Catalog page → Cart page: continues to cart (evidence: `README.md`)
- Cart page → Checkout page: continues to checkout (evidence: `README.md`)
- Checkout page → Confirmation page: confirms order (evidence: `README.md`)
