# namanlko/eks-deployed-ecommerce architecture

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

- Interactive diagram: https://gitdiagram.com/namanlko/eks-deployed-ecommerce
- Repository: https://github.com/namanlko/eks-deployed-ecommerce

## Overview

ShopSphere is a React storefront backed by an Express/MongoDB API and documented for deployment on AWS EKS behind an ALB. The main user journey is browsing products, adding them to a locally persisted cart, authenticating, and placing and tracking orders; catalog reviews and JWT authentication are additional capabilities. The graph includes documented deployment components, but unsampled deployment manifests are represented at their existing directory. Relationships are limited to shown imports/calls or README statements.

Main entry points: [`frontend/src/App.js`](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/App.js) (Page Router), [`frontend/src/utils/api.js`](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/utils/api.js) (API Client), [`backend/server.js`](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/server.js) (Express API), [`frontend/src/context/CartContext.js`](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/context/CartContext.js) (Cart State)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["Page Router<br/>[App.js]"]
  node_catalog_ui["Catalog Views<br/>[Products.js]"]
  node_product_detail["Product Detail<br/>[ProductDetail.js]"]
  node_product_card["Product Card<br/>[ProductCard.js]"]
  node_home["Home View<br/>[Home.js]"]
  node_cart_state["Cart State<br/>[CartContext.js]"]
  node_cart_view["Cart View<br/>[Cart.js]"]
  node_checkout["Checkout<br/>[Checkout.js]"]
  node_auth_state["Auth State<br/>[AuthContext.js]"]
  node_login["Login and Register<br/>[Login.js]"]
  node_orders_ui["Order Views<br/>[Orders.js]"]
  node_api_client["API Client<br/>[api.js]"]
end

subgraph group_commerce["Commerce API"]
  node_api_server["Express API<br/>[server.js]"]
  node_product_routes["Product Routes<br/>[products.js]"]
  node_product_logic["Catalog and Reviews"]
  node_product_model[("Product Store<br/>[Product.js]")]
  node_order_routes["Order Routes<br/>[orders.js]"]
  node_order_logic["Order Management<br/>[orderController.js]"]
  node_order_model[("Order Store<br/>[Order.js]")]
  node_cart_routes["Cart Routes<br/>[cart.js]"]
end

subgraph group_identity["Identity"]
  node_auth_routes["Auth Routes<br/>[auth.js]"]
  node_auth_logic["JWT Auth<br/>[authController.js]"]
  node_auth_middleware["Access Control<br/>[auth.js]"]
  node_user_model[("User Store<br/>[User.js]")]
end

subgraph group_platform["EKS Platform"]
  node_mongo[("MongoDB Deployment")]
  node_backend_deploy["Backend Deployment"]
  node_frontend_deploy["Frontend Deployment"]
  node_ingress["ALB Ingress"]
  node_autoscaling["Pod Autoscaler"]
end

node_shopper(("Shopper"))

node_shopper -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_catalog_ui
node_app -->|"routes to"| node_product_detail
node_app -->|"routes to"| node_cart_view
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_orders_ui
node_home -->|"fetches catalog"| node_api_client
node_catalog_ui -->|"fetches catalog"| node_api_client
node_product_detail -->|"fetches product"| node_api_client
node_catalog_ui -->|"renders"| node_product_card
node_home -->|"renders"| node_product_card
node_product_card -->|"adds item"| node_cart_state
node_product_detail -->|"adds item"| node_cart_state
node_cart_view -->|"reads and updates"| node_cart_state
node_cart_state -->|"persists locally"| node_shopper
node_checkout -->|"reads and clears"| node_cart_state
node_checkout -->|"creates order"| node_api_client
node_login -->|"authenticates"| node_auth_state
node_checkout -->|"checks user"| node_auth_state
node_orders_ui -->|"loads orders"| node_api_client
node_api_client -->|"calls API"| node_api_server
node_api_server -->|"mounts"| node_product_routes
node_api_server -->|"mounts"| node_auth_routes
node_api_server -->|"mounts"| node_order_routes
node_api_server -->|"mounts"| node_cart_routes
node_product_routes -->|"dispatches"| node_product_logic
node_product_logic -->|"reads and writes"| node_product_model
node_product_logic -->|"uses identity"| node_auth_middleware
node_auth_routes -->|"dispatches"| node_auth_logic
node_auth_routes -->|"protects profile"| node_auth_middleware
node_auth_logic -->|"reads and creates"| node_user_model
node_auth_middleware -->|"loads user"| node_user_model
node_order_routes -->|"dispatches"| node_order_logic
node_order_routes -->|"protects orders"| node_auth_middleware
node_order_logic -->|"reads and writes"| node_order_model
node_order_logic -->|"reduces stock"| node_product_model
node_ingress -->|"routes storefront"| node_frontend_deploy
node_ingress -->|"routes API"| node_backend_deploy
node_backend_deploy -.->|"uses database"| node_mongo
node_autoscaling -.->|"scales pods"| node_backend_deploy

click node_app "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/App.js"
click node_catalog_ui "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/pages/Products.js"
click node_product_detail "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/pages/ProductDetail.js"
click node_product_card "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/components/ProductCard.js"
click node_home "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/pages/Home.js"
click node_cart_state "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/context/CartContext.js"
click node_cart_view "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/pages/Cart.js"
click node_checkout "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/pages/Checkout.js"
click node_auth_state "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/context/AuthContext.js"
click node_login "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/pages/Login.js"
click node_orders_ui "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/pages/Orders.js"
click node_api_client "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/utils/api.js"
click node_api_server "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/server.js"
click node_product_routes "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/routes/products.js"
click node_product_logic "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/controllers/productController.js"
click node_product_model "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/models/Product.js"
click node_auth_routes "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/routes/auth.js"
click node_auth_logic "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/controllers/authController.js"
click node_auth_middleware "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/middleware/auth.js"
click node_user_model "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/models/User.js"
click node_order_routes "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/routes/orders.js"
click node_order_logic "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/controllers/orderController.js"
click node_order_model "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/models/Order.js"
click node_cart_routes "https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/routes/cart.js"
click node_mongo "https://github.com/namanlko/eks-deployed-ecommerce/tree/main/deployment/kubernetes"
click node_backend_deploy "https://github.com/namanlko/eks-deployed-ecommerce/tree/main/deployment/kubernetes"
click node_frontend_deploy "https://github.com/namanlko/eks-deployed-ecommerce/tree/main/deployment/kubernetes"
click node_ingress "https://github.com/namanlko/eks-deployed-ecommerce/tree/main/deployment/kubernetes"
click node_autoscaling "https://github.com/namanlko/eks-deployed-ecommerce/tree/main/deployment/kubernetes"

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_product_detail,node_product_card,node_home,node_cart_state,node_cart_view,node_checkout,node_auth_state,node_login,node_orders_ui,node_api_client toneBlue
class node_api_server,node_product_routes,node_product_logic,node_product_model,node_order_routes,node_order_logic,node_order_model,node_cart_routes toneAmber
class node_auth_routes,node_auth_logic,node_auth_middleware,node_user_model toneMint
class node_mongo,node_backend_deploy,node_frontend_deploy,node_ingress,node_autoscaling toneRose
class node_shopper toneIndigo
```

## Components

### Storefront

- [Page Router](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Catalog Views](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/pages/Products.js): `frontend/src/pages/Products.js`
- [Product Detail](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/pages/ProductDetail.js): `frontend/src/pages/ProductDetail.js`
- [Product Card](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/components/ProductCard.js): `frontend/src/components/ProductCard.js`
- [Home View](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/pages/Home.js): `frontend/src/pages/Home.js`
- [Cart State](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/context/CartContext.js): `frontend/src/context/CartContext.js`
- [Cart View](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/pages/Cart.js): `frontend/src/pages/Cart.js`
- [Checkout](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/pages/Checkout.js): `frontend/src/pages/Checkout.js`
- [Auth State](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/context/AuthContext.js): `frontend/src/context/AuthContext.js`
- [Login and Register](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/pages/Login.js): `frontend/src/pages/Login.js`
- [Order Views](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/pages/Orders.js): `frontend/src/pages/Orders.js`
- [API Client](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/frontend/src/utils/api.js): `frontend/src/utils/api.js`

### Commerce API

- [Express API](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/server.js): `backend/server.js`
- [Product Routes](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/routes/products.js): `backend/routes/products.js`
- [Catalog and Reviews](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/controllers/productController.js): `backend/controllers/productController.js`
- [Product Store](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/models/Product.js): `backend/models/Product.js`
- [Order Routes](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/routes/orders.js): `backend/routes/orders.js`
- [Order Management](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/controllers/orderController.js): `backend/controllers/orderController.js`
- [Order Store](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/models/Order.js): `backend/models/Order.js`
- [Cart Routes](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/routes/cart.js): `backend/routes/cart.js`

### Identity

- [Auth Routes](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [JWT Auth](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [Access Control](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`
- [User Store](https://github.com/namanlko/eks-deployed-ecommerce/blob/main/backend/models/User.js): `backend/models/User.js`

### EKS Platform

- [MongoDB Deployment](https://github.com/namanlko/eks-deployed-ecommerce/tree/main/deployment/kubernetes): `deployment/kubernetes`
- [Backend Deployment](https://github.com/namanlko/eks-deployed-ecommerce/tree/main/deployment/kubernetes): `deployment/kubernetes`
- [Frontend Deployment](https://github.com/namanlko/eks-deployed-ecommerce/tree/main/deployment/kubernetes): `deployment/kubernetes`
- [ALB Ingress](https://github.com/namanlko/eks-deployed-ecommerce/tree/main/deployment/kubernetes): `deployment/kubernetes`
- [Pod Autoscaler](https://github.com/namanlko/eks-deployed-ecommerce/tree/main/deployment/kubernetes): `deployment/kubernetes`

### Other components

- **Shopper**

## Connections

- Shopper → Page Router: uses (evidence: `README.md`)
- Page Router → Home View: routes to (evidence: `frontend/src/App.js`)
- Page Router → Catalog Views: routes to (evidence: `frontend/src/App.js`)
- Page Router → Product Detail: routes to (evidence: `frontend/src/App.js`)
- Page Router → Cart View: routes to (evidence: `frontend/src/App.js`)
- Page Router → Checkout: routes to (evidence: `frontend/src/App.js`)
- Page Router → Login and Register: routes to (evidence: `frontend/src/App.js`)
- Page Router → Order Views: routes to (evidence: `frontend/src/App.js`)
- Home View → API Client: fetches catalog (evidence: `frontend/src/pages/Home.js`)
- Catalog Views → API Client: fetches catalog (evidence: `frontend/src/pages/Products.js`)
- Product Detail → API Client: fetches product (evidence: `frontend/src/pages/ProductDetail.js`)
- Catalog Views → Product Card: renders (evidence: `frontend/src/pages/Products.js`)
- Home View → Product Card: renders (evidence: `frontend/src/pages/Home.js`)
- Product Card → Cart State: adds item (evidence: `frontend/src/components/ProductCard.js`)
- Product Detail → Cart State: adds item (evidence: `frontend/src/pages/ProductDetail.js`)
- Cart View → Cart State: reads and updates (evidence: `frontend/src/pages/Cart.js`)
- Cart State → Shopper: persists locally (evidence: `frontend/src/context/CartContext.js`)
- Checkout → Cart State: reads and clears (evidence: `frontend/src/pages/Checkout.js`)
- Checkout → API Client: creates order (evidence: `frontend/src/pages/Checkout.js`)
- Login and Register → Auth State: authenticates (evidence: `frontend/src/pages/Login.js`)
- Checkout → Auth State: checks user (evidence: `frontend/src/pages/Checkout.js`)
- Order Views → API Client: loads orders (evidence: `frontend/src/pages/Orders.js`)
- API Client → Express API: calls API (evidence: `README.md`)
- Express API → Product Routes: mounts (evidence: `backend/server.js`)
- Express API → Auth Routes: mounts (evidence: `backend/server.js`)
- Express API → Order Routes: mounts (evidence: `backend/server.js`)
- Express API → Cart Routes: mounts (evidence: `backend/server.js`)
- Product Routes → Catalog and Reviews: dispatches (evidence: `backend/routes/products.js`)
- Catalog and Reviews → Product Store: reads and writes (evidence: `backend/controllers/productController.js`)
- Catalog and Reviews → Access Control: uses identity (evidence: `backend/routes/products.js`)
- Auth Routes → JWT Auth: dispatches (evidence: `backend/routes/auth.js`)
- Auth Routes → Access Control: protects profile (evidence: `backend/routes/auth.js`)
- JWT Auth → User Store: reads and creates (evidence: `backend/controllers/authController.js`)
- Access Control → User Store: loads user (evidence: `backend/middleware/auth.js`)
- Order Routes → Order Management: dispatches (evidence: `backend/routes/orders.js`)
- Order Routes → Access Control: protects orders (evidence: `backend/routes/orders.js`)
- Order Management → Order Store: reads and writes (evidence: `backend/controllers/orderController.js`)
- Order Management → Product Store: reduces stock (evidence: `backend/controllers/orderController.js`)
- ALB Ingress → Frontend Deployment: routes storefront (evidence: `README.md`)
- ALB Ingress → Backend Deployment: routes API (evidence: `README.md`)
- Backend Deployment → MongoDB Deployment: uses database
- Pod Autoscaler → Backend Deployment: scales pods
