# soumil0707/ecom-2 architecture

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

- Interactive diagram: https://gitdiagram.com/soumil0707/ecom-2
- Repository: https://github.com/soumil0707/ecom-2

## Overview

This is a monorepo for an e-commerce storefront, an admin dashboard, and separate product, order, and payment services. The visible customer workflow is product browsing and selection, cart management, shipping entry, then Stripe payment; payment webhooks handle a checkout-completion event, but the webhook excerpt marks order creation as a TODO. Admin product, user, and payment views are present, though their pages use hard-coded sample data. The README provides no additional architecture detail, and several service entrypoints and routes were not sampled, so those connections are left out.

Main entry points: [`apps/client/src/app/cart/page.tsx`](https://github.com/soumil0707/ecom-2/blob/main/apps/client/src/app/cart/page.tsx) (Cart and checkout), [`apps/payment-service/src/utils/stripe.ts`](https://github.com/soumil0707/ecom-2/blob/main/apps/payment-service/src/utils/stripe.ts) (Stripe client), [`apps/payment-service/src/route/session.route.ts`](https://github.com/soumil0707/ecom-2/blob/main/apps/payment-service/src/route/session.route.ts) (Payment sessions), [`apps/client/src/app/products/[id]/page.tsx`](https://github.com/soumil0707/ecom-2/blob/main/apps/client/src/app/products/%5Bid%5D/page.tsx) (Product detail)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Customer storefront"]
  node_catalog["Product browsing"]
  node_product_detail["Product detail<br/>[page.tsx]"]
  node_product_interaction["Product selection"]
  node_cart_page["Cart and checkout<br/>[page.tsx]"]
  node_cart_state["Cart state<br/>[cartStore.ts]"]
  node_shipping["Shipping form<br/>[ShippingForm.tsx]"]
  node_stripe_form["Payment form"]
end

subgraph group_admin["Admin dashboard"]
  node_admin_products["Product admin<br/>[page.tsx]"]
  node_admin_product_table["Product table<br/>[data-table.tsx]"]
  node_admin_users["User admin<br/>[page.tsx]"]
  node_admin_user_table["User table<br/>[data-table.tsx]"]
  node_admin_user_detail["User detail<br/>[page.tsx]"]
  node_admin_payments["Payment admin<br/>[page.tsx]"]
  node_admin_payment_table["Payment table<br/>[data-table.tsx]"]
end

subgraph group_commerce["Commerce services"]
  node_product_api["Product API"]
  node_category_api["Category API"]
  node_order_api["Order routes<br/>[order.ts]"]
  node_payment_session["Payment sessions<br/>[session.route.ts]"]
  node_payment_webhook["Payment webhook<br/>[webhooks.route.ts]"]
  node_stripe_client["Stripe client<br/>[stripe.ts]"]
  node_stripe_products["Stripe products<br/>[stripeProduct.ts]"]
end

subgraph group_integrations["External integrations"]
  node_stripe_service["Stripe"]
end

subgraph group_shared["Shared packages"]
  node_product_db[("Product database<br/>[client.ts]")]
  node_order_db[("Order database<br/>[order-model.ts]")]
  node_kafka["Kafka package<br/>[client.ts]"]
end

node_customer(("Shopper"))

node_customer -.->|"browses"| node_catalog
node_customer -.->|"views"| node_product_detail
node_product_detail -->|"renders"| node_product_interaction
node_customer -.->|"checks out"| node_cart_page
node_cart_page -->|"reads and updates"| node_cart_state
node_cart_page -->|"renders"| node_shipping
node_cart_page -->|"renders"| node_stripe_form
node_admin_products -->|"renders"| node_admin_product_table
node_admin_users -->|"renders"| node_admin_user_table
node_admin_payments -->|"renders"| node_admin_payment_table
node_product_api -->|"reads and writes"| node_product_db
node_category_api -->|"reads and writes"| node_product_db
node_order_api -->|"uses"| node_order_db
node_payment_session -->|"uses"| node_stripe_client
node_payment_session -->|"uses"| node_stripe_products
node_payment_webhook -->|"verifies events"| node_stripe_client
node_stripe_client -.->|"calls"| node_stripe_service
node_stripe_products -->|"uses"| node_stripe_client

click node_catalog "https://github.com/soumil0707/ecom-2/tree/main/apps/client/src/app/products"
click node_product_detail "https://github.com/soumil0707/ecom-2/blob/main/apps/client/src/app/products/%5Bid%5D/page.tsx"
click node_product_interaction "https://github.com/soumil0707/ecom-2/blob/main/apps/client/src/components/ProductInteraction.tsx"
click node_cart_page "https://github.com/soumil0707/ecom-2/blob/main/apps/client/src/app/cart/page.tsx"
click node_cart_state "https://github.com/soumil0707/ecom-2/blob/main/apps/client/src/stores/cartStore.ts"
click node_shipping "https://github.com/soumil0707/ecom-2/blob/main/apps/client/src/components/ShippingForm.tsx"
click node_stripe_form "https://github.com/soumil0707/ecom-2/blob/main/apps/client/src/components/StripePaymentForm.tsx"
click node_admin_products "https://github.com/soumil0707/ecom-2/blob/main/apps/admin/src/app/products/page.tsx"
click node_admin_product_table "https://github.com/soumil0707/ecom-2/blob/main/apps/admin/src/app/products/data-table.tsx"
click node_admin_users "https://github.com/soumil0707/ecom-2/blob/main/apps/admin/src/app/users/page.tsx"
click node_admin_user_table "https://github.com/soumil0707/ecom-2/blob/main/apps/admin/src/app/users/data-table.tsx"
click node_admin_user_detail "https://github.com/soumil0707/ecom-2/blob/main/apps/admin/src/app/users/%5Bid%5D/page.tsx"
click node_admin_payments "https://github.com/soumil0707/ecom-2/blob/main/apps/admin/src/app/payments/page.tsx"
click node_admin_payment_table "https://github.com/soumil0707/ecom-2/blob/main/apps/admin/src/app/payments/data-table.tsx"
click node_product_api "https://github.com/soumil0707/ecom-2/blob/main/apps/product-service/src/controllers/product.controller.ts"
click node_category_api "https://github.com/soumil0707/ecom-2/blob/main/apps/product-service/src/controllers/category.controller.ts"
click node_order_api "https://github.com/soumil0707/ecom-2/blob/main/apps/order-service/src/routes/order.ts"
click node_payment_session "https://github.com/soumil0707/ecom-2/blob/main/apps/payment-service/src/route/session.route.ts"
click node_payment_webhook "https://github.com/soumil0707/ecom-2/blob/main/apps/payment-service/src/route/webhooks.route.ts"
click node_stripe_client "https://github.com/soumil0707/ecom-2/blob/main/apps/payment-service/src/utils/stripe.ts"
click node_stripe_products "https://github.com/soumil0707/ecom-2/blob/main/apps/payment-service/src/utils/stripeProduct.ts"
click node_product_db "https://github.com/soumil0707/ecom-2/blob/main/packages/product-db/src/client.ts"
click node_order_db "https://github.com/soumil0707/ecom-2/blob/main/packages/order-db/src/order-model.ts"
click node_kafka "https://github.com/soumil0707/ecom-2/blob/main/packages/kafka/src/client.ts"

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_catalog,node_product_detail,node_product_interaction,node_cart_page,node_cart_state,node_shipping,node_stripe_form toneBlue
class node_admin_products,node_admin_product_table,node_admin_users,node_admin_user_table,node_admin_user_detail,node_admin_payments,node_admin_payment_table toneAmber
class node_product_api,node_category_api,node_order_api,node_payment_session,node_payment_webhook,node_stripe_client,node_stripe_products toneMint
class node_stripe_service toneRose
class node_product_db,node_order_db,node_kafka,node_customer toneIndigo
```

## Components

### Customer storefront

- [Product browsing](https://github.com/soumil0707/ecom-2/tree/main/apps/client/src/app/products): `apps/client/src/app/products`
- [Product detail](https://github.com/soumil0707/ecom-2/blob/main/apps/client/src/app/products/%5Bid%5D/page.tsx): `apps/client/src/app/products/[id]/page.tsx`
- [Product selection](https://github.com/soumil0707/ecom-2/blob/main/apps/client/src/components/ProductInteraction.tsx): `apps/client/src/components/ProductInteraction.tsx`
- [Cart and checkout](https://github.com/soumil0707/ecom-2/blob/main/apps/client/src/app/cart/page.tsx): `apps/client/src/app/cart/page.tsx`
- [Cart state](https://github.com/soumil0707/ecom-2/blob/main/apps/client/src/stores/cartStore.ts): `apps/client/src/stores/cartStore.ts`
- [Shipping form](https://github.com/soumil0707/ecom-2/blob/main/apps/client/src/components/ShippingForm.tsx): `apps/client/src/components/ShippingForm.tsx`
- [Payment form](https://github.com/soumil0707/ecom-2/blob/main/apps/client/src/components/StripePaymentForm.tsx): `apps/client/src/components/StripePaymentForm.tsx`

### Admin dashboard

- [Product admin](https://github.com/soumil0707/ecom-2/blob/main/apps/admin/src/app/products/page.tsx): `apps/admin/src/app/products/page.tsx`
- [Product table](https://github.com/soumil0707/ecom-2/blob/main/apps/admin/src/app/products/data-table.tsx): `apps/admin/src/app/products/data-table.tsx`
- [User admin](https://github.com/soumil0707/ecom-2/blob/main/apps/admin/src/app/users/page.tsx): `apps/admin/src/app/users/page.tsx`
- [User table](https://github.com/soumil0707/ecom-2/blob/main/apps/admin/src/app/users/data-table.tsx): `apps/admin/src/app/users/data-table.tsx`
- [User detail](https://github.com/soumil0707/ecom-2/blob/main/apps/admin/src/app/users/%5Bid%5D/page.tsx): `apps/admin/src/app/users/[id]/page.tsx`
- [Payment admin](https://github.com/soumil0707/ecom-2/blob/main/apps/admin/src/app/payments/page.tsx): `apps/admin/src/app/payments/page.tsx`
- [Payment table](https://github.com/soumil0707/ecom-2/blob/main/apps/admin/src/app/payments/data-table.tsx): `apps/admin/src/app/payments/data-table.tsx`

### Commerce services

- [Product API](https://github.com/soumil0707/ecom-2/blob/main/apps/product-service/src/controllers/product.controller.ts): `apps/product-service/src/controllers/product.controller.ts`
- [Category API](https://github.com/soumil0707/ecom-2/blob/main/apps/product-service/src/controllers/category.controller.ts): `apps/product-service/src/controllers/category.controller.ts`
- [Order routes](https://github.com/soumil0707/ecom-2/blob/main/apps/order-service/src/routes/order.ts): `apps/order-service/src/routes/order.ts`
- [Payment sessions](https://github.com/soumil0707/ecom-2/blob/main/apps/payment-service/src/route/session.route.ts): `apps/payment-service/src/route/session.route.ts`
- [Payment webhook](https://github.com/soumil0707/ecom-2/blob/main/apps/payment-service/src/route/webhooks.route.ts): `apps/payment-service/src/route/webhooks.route.ts`
- [Stripe client](https://github.com/soumil0707/ecom-2/blob/main/apps/payment-service/src/utils/stripe.ts): `apps/payment-service/src/utils/stripe.ts`
- [Stripe products](https://github.com/soumil0707/ecom-2/blob/main/apps/payment-service/src/utils/stripeProduct.ts): `apps/payment-service/src/utils/stripeProduct.ts`

### External integrations

- **Stripe**

### Shared packages

- [Product database](https://github.com/soumil0707/ecom-2/blob/main/packages/product-db/src/client.ts): `packages/product-db/src/client.ts`
- [Order database](https://github.com/soumil0707/ecom-2/blob/main/packages/order-db/src/order-model.ts): `packages/order-db/src/order-model.ts`
- [Kafka package](https://github.com/soumil0707/ecom-2/blob/main/packages/kafka/src/client.ts): `packages/kafka/src/client.ts`

### Other components

- **Shopper**

## Connections

- Shopper → Product browsing: browses
- Shopper → Product detail: views
- Product detail → Product selection: renders (evidence: `apps/client/src/app/products/[id]/page.tsx`)
- Shopper → Cart and checkout: checks out
- Cart and checkout → Cart state: reads and updates (evidence: `apps/client/src/app/cart/page.tsx`)
- Cart and checkout → Shipping form: renders (evidence: `apps/client/src/app/cart/page.tsx`)
- Cart and checkout → Payment form: renders (evidence: `apps/client/src/app/cart/page.tsx`)
- Product admin → Product table: renders (evidence: `apps/admin/src/app/products/page.tsx`)
- User admin → User table: renders (evidence: `apps/admin/src/app/users/page.tsx`)
- Payment admin → Payment table: renders (evidence: `apps/admin/src/app/payments/page.tsx`)
- Product API → Product database: reads and writes (evidence: `apps/product-service/src/controllers/product.controller.ts`)
- Category API → Product database: reads and writes (evidence: `apps/product-service/src/controllers/category.controller.ts`)
- Order routes → Order database: uses (evidence: `apps/order-service/src/routes/order.ts`)
- Payment sessions → Stripe client: uses (evidence: `apps/payment-service/src/route/session.route.ts`)
- Payment sessions → Stripe products: uses (evidence: `apps/payment-service/src/route/session.route.ts`)
- Payment webhook → Stripe client: verifies events (evidence: `apps/payment-service/src/route/webhooks.route.ts`)
- Stripe client → Stripe: calls
- Stripe products → Stripe client: uses (evidence: `apps/payment-service/src/utils/stripeProduct.ts`)
