# imsaksham009/ecommerce architecture

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

- Interactive diagram: https://gitdiagram.com/imsaksham009/ecommerce
- Repository: https://github.com/imsaksham009/ecommerce

## Overview

This is a MERN eCommerce application. Customers browse and filter products, inspect details and reviews, manage a cart, provide shipping information, pay, and track orders; users can also manage accounts. Administrators manage products, orders, and users. The graph includes the React route/UI and Redux layers, Express routing and controllers, persistence, and documented integrations. Some frontend-to-API links and unsampled admin details are based on README documentation rather than inspected component code.

Main entry points: [`frontend/src/App.jsx`](https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/App.jsx) (Page routing), [`backend/routes/productRoute.js`](https://github.com/imsaksham009/ecommerce/blob/master/backend/routes/productRoute.js) (API routes), [`backend/app.js`](https://github.com/imsaksham009/ecommerce/blob/master/backend/app.js) (Express application), [`backend/controllers/productController.js`](https://github.com/imsaksham009/ecommerce/blob/master/backend/controllers/productController.js) (Product handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer storefront"]
  node_routes_ui["Page routing<br/>[App.jsx]"]
  node_catalog_ui["Product catalog<br/>[Products.jsx]"]
  node_detail_ui["Product details<br/>[ProductDetail.jsx]"]
  node_auth_ui["Account access<br/>[LoginSignUp.jsx]"]
  node_product_state["Product state<br/>[productAction.js]"]
  node_detail_state["Detail and review state"]
  node_auth_state["Authentication state<br/>[userAction.js]"]
end

subgraph group_checkout["Checkout and orders"]
  node_cart_ui["Cart and shipping<br/>[Cart.jsx]"]
  node_confirm_ui["Order confirmation<br/>[ConfirmOrder.jsx]"]
  node_payment_ui["Payment step<br/>[Payment.jsx]"]
  node_order_ui["Order tracking<br/>[Orders.jsx]"]
  node_cart_state["Cart state<br/>[cartReducer.js]"]
  node_order_state["Order state<br/>[orderAction.js]"]
  node_payment_state["Payment state<br/>[paymentReducer.js]"]
end

subgraph group_admin["Administration"]
  node_admin_ui["Admin console<br/>[Dashboard.jsx]"]
end

subgraph group_backend["API and domain"]
  node_api_app["Express application<br/>[app.js]"]
  node_routes["API routes<br/>[productRoute.js]"]
  node_auth_mw["Access control<br/>[auth.js]"]
  node_product_ctrl["Product handlers"]
  node_user_ctrl["Account handlers<br/>[userController.js]"]
  node_order_ctrl["Order handlers<br/>[orderController.js]"]
  node_payment_ctrl["Payment handlers"]
  node_review_ctrl["Review handlers"]
end

subgraph group_infra["Persistence and integrations"]
  node_product_model[("Product records<br/>[productModel.js]")]
  node_review_model[("Review records<br/>[reviewModel.js]")]
  node_user_model[("User records<br/>[userModel.js]")]
  node_order_model[("Order records<br/>[orderModel.js]")]
  node_mongo[("MongoDB")]
  node_cloudinary["Cloudinary"]
  node_razorpay["Razorpay"]
  node_email["Email service"]
end

node_shopper(("Shopper"))
node_admin_actor(("Administrator"))

node_shopper -->|"uses storefront"| node_routes_ui
node_routes_ui -->|"routes to"| node_catalog_ui
node_routes_ui -->|"routes to"| node_detail_ui
node_routes_ui -->|"routes to"| node_auth_ui
node_catalog_ui -->|"loads products"| node_product_state
node_detail_ui -->|"loads details"| node_detail_state
node_auth_ui -->|"dispatches auth"| node_auth_state
node_shopper -.->|"manages cart"| node_cart_ui
node_cart_ui -->|"updates cart"| node_cart_state
node_routes_ui -->|"routes to"| node_cart_ui
node_routes_ui -->|"routes to"| node_confirm_ui
node_routes_ui -->|"routes to"| node_payment_ui
node_confirm_ui -->|"requests payment"| node_payment_state
node_payment_ui -->|"creates order"| node_order_state
node_payment_ui -->|"uses payment state"| node_payment_state
node_routes_ui -->|"routes to"| node_order_ui
node_admin_actor -.->|"manages store"| node_admin_ui
node_routes_ui -->|"routes to"| node_admin_ui
node_catalog_ui -.->|"requests catalog"| node_api_app
node_detail_ui -.->|"requests details"| node_api_app
node_auth_ui -.->|"authenticates"| node_api_app
node_cart_ui -.->|"submits checkout"| node_api_app
node_order_ui -.->|"requests orders"| node_api_app
node_admin_ui -.->|"manages records"| node_api_app
node_api_app -->|"mounts endpoints"| node_routes
node_routes -->|"dispatches product"| node_product_ctrl
node_routes -->|"checks access"| node_auth_mw
node_routes -->|"dispatches account"| node_user_ctrl
node_routes -->|"dispatches orders"| node_order_ctrl
node_routes -->|"dispatches payment"| node_payment_ctrl
node_routes -->|"dispatches reviews"| node_review_ctrl
node_product_ctrl -->|"reads and writes"| node_product_model
node_product_ctrl -->|"reads reviews"| node_review_model
node_review_ctrl -->|"updates ratings"| node_product_model
node_review_ctrl -->|"writes reviews"| node_review_model
node_user_ctrl -->|"reads and writes"| node_user_model
node_order_ctrl -->|"reads and writes"| node_order_model
node_order_ctrl -->|"updates stock"| node_product_model
node_product_model -.->|"persists records"| node_mongo
node_review_model -.->|"persists records"| node_mongo
node_user_model -.->|"persists records"| node_mongo
node_order_model -.->|"persists records"| node_mongo
node_product_ctrl -->|"manages images"| node_cloudinary
node_user_ctrl -->|"deletes avatar"| node_cloudinary
node_payment_ctrl -.->|"processes payment"| node_razorpay
node_user_ctrl -->|"sends reset link"| node_email

click node_routes_ui "https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/App.jsx"
click node_catalog_ui "https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/Components/Products/Products.jsx"
click node_detail_ui "https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/Components/ProductDetail/ProductDetail.jsx"
click node_auth_ui "https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/Components/User/LoginSignUp.jsx"
click node_product_state "https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/reducers/Products/productAction.js"
click node_detail_state "https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/reducers/ProductDetail/productDetailAction.js"
click node_auth_state "https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/reducers/Auth/userAction.js"
click node_cart_ui "https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/Components/Cart/Cart.jsx"
click node_confirm_ui "https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/Components/Cart/ConfirmOrder.jsx"
click node_payment_ui "https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/Components/Cart/Payment.jsx"
click node_order_ui "https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/Components/Order/Orders.jsx"
click node_cart_state "https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/reducers/Cart/cartReducer.js"
click node_order_state "https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/reducers/NewOrder/orderAction.js"
click node_payment_state "https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/reducers/Payment/paymentReducer.js"
click node_admin_ui "https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/Components/admin/Dashboard.jsx"
click node_api_app "https://github.com/imsaksham009/ecommerce/blob/master/backend/app.js"
click node_routes "https://github.com/imsaksham009/ecommerce/blob/master/backend/routes/productRoute.js"
click node_auth_mw "https://github.com/imsaksham009/ecommerce/blob/master/backend/Middleware/auth.js"
click node_product_ctrl "https://github.com/imsaksham009/ecommerce/blob/master/backend/controllers/productController.js"
click node_user_ctrl "https://github.com/imsaksham009/ecommerce/blob/master/backend/controllers/userController.js"
click node_order_ctrl "https://github.com/imsaksham009/ecommerce/blob/master/backend/controllers/orderController.js"
click node_payment_ctrl "https://github.com/imsaksham009/ecommerce/blob/master/backend/controllers/paymentController.js"
click node_review_ctrl "https://github.com/imsaksham009/ecommerce/blob/master/backend/controllers/reviewController.js"
click node_product_model "https://github.com/imsaksham009/ecommerce/blob/master/backend/Models/productModel.js"
click node_review_model "https://github.com/imsaksham009/ecommerce/blob/master/backend/Models/reviewModel.js"
click node_user_model "https://github.com/imsaksham009/ecommerce/blob/master/backend/Models/userModel.js"
click node_order_model "https://github.com/imsaksham009/ecommerce/blob/master/backend/Models/orderModel.js"

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_routes_ui,node_catalog_ui,node_detail_ui,node_auth_ui,node_product_state,node_detail_state,node_auth_state toneBlue
class node_cart_ui,node_confirm_ui,node_payment_ui,node_order_ui,node_cart_state,node_order_state,node_payment_state toneAmber
class node_admin_ui toneMint
class node_api_app,node_routes,node_auth_mw,node_product_ctrl,node_user_ctrl,node_order_ctrl,node_payment_ctrl,node_review_ctrl toneRose
class node_product_model,node_review_model,node_user_model,node_order_model,node_mongo,node_cloudinary,node_razorpay,node_email,node_shopper,node_admin_actor toneIndigo
```

## Components

### Customer storefront

- [Page routing](https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Product catalog](https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/Components/Products/Products.jsx): `frontend/src/Components/Products/Products.jsx`
- [Product details](https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/Components/ProductDetail/ProductDetail.jsx): `frontend/src/Components/ProductDetail/ProductDetail.jsx`
- [Account access](https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/Components/User/LoginSignUp.jsx): `frontend/src/Components/User/LoginSignUp.jsx`
- [Product state](https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/reducers/Products/productAction.js): `frontend/src/reducers/Products/productAction.js`
- [Detail and review state](https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/reducers/ProductDetail/productDetailAction.js): `frontend/src/reducers/ProductDetail/productDetailAction.js`
- [Authentication state](https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/reducers/Auth/userAction.js): `frontend/src/reducers/Auth/userAction.js`

### Checkout and orders

- [Cart and shipping](https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/Components/Cart/Cart.jsx): `frontend/src/Components/Cart/Cart.jsx`
- [Order confirmation](https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/Components/Cart/ConfirmOrder.jsx): `frontend/src/Components/Cart/ConfirmOrder.jsx`
- [Payment step](https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/Components/Cart/Payment.jsx): `frontend/src/Components/Cart/Payment.jsx`
- [Order tracking](https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/Components/Order/Orders.jsx): `frontend/src/Components/Order/Orders.jsx`
- [Cart state](https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/reducers/Cart/cartReducer.js): `frontend/src/reducers/Cart/cartReducer.js`
- [Order state](https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/reducers/NewOrder/orderAction.js): `frontend/src/reducers/NewOrder/orderAction.js`
- [Payment state](https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/reducers/Payment/paymentReducer.js): `frontend/src/reducers/Payment/paymentReducer.js`

### Administration

- [Admin console](https://github.com/imsaksham009/ecommerce/blob/master/frontend/src/Components/admin/Dashboard.jsx): `frontend/src/Components/admin/Dashboard.jsx`

### API and domain

- [Express application](https://github.com/imsaksham009/ecommerce/blob/master/backend/app.js): `backend/app.js`
- [API routes](https://github.com/imsaksham009/ecommerce/blob/master/backend/routes/productRoute.js): `backend/routes/productRoute.js`
- [Access control](https://github.com/imsaksham009/ecommerce/blob/master/backend/Middleware/auth.js): `backend/Middleware/auth.js`
- [Product handlers](https://github.com/imsaksham009/ecommerce/blob/master/backend/controllers/productController.js): `backend/controllers/productController.js`
- [Account handlers](https://github.com/imsaksham009/ecommerce/blob/master/backend/controllers/userController.js): `backend/controllers/userController.js`
- [Order handlers](https://github.com/imsaksham009/ecommerce/blob/master/backend/controllers/orderController.js): `backend/controllers/orderController.js`
- [Payment handlers](https://github.com/imsaksham009/ecommerce/blob/master/backend/controllers/paymentController.js): `backend/controllers/paymentController.js`
- [Review handlers](https://github.com/imsaksham009/ecommerce/blob/master/backend/controllers/reviewController.js): `backend/controllers/reviewController.js`

### Persistence and integrations

- [Product records](https://github.com/imsaksham009/ecommerce/blob/master/backend/Models/productModel.js): `backend/Models/productModel.js`
- [Review records](https://github.com/imsaksham009/ecommerce/blob/master/backend/Models/reviewModel.js): `backend/Models/reviewModel.js`
- [User records](https://github.com/imsaksham009/ecommerce/blob/master/backend/Models/userModel.js): `backend/Models/userModel.js`
- [Order records](https://github.com/imsaksham009/ecommerce/blob/master/backend/Models/orderModel.js): `backend/Models/orderModel.js`
- **MongoDB**
- **Cloudinary**
- **Razorpay**
- **Email service**

### Other components

- **Shopper**
- **Administrator**

## Connections

- Shopper → Page routing: uses storefront (evidence: `frontend/src/App.jsx`)
- Page routing → Product catalog: routes to (evidence: `frontend/src/App.jsx`)
- Page routing → Product details: routes to (evidence: `frontend/src/App.jsx`)
- Page routing → Account access: routes to (evidence: `frontend/src/App.jsx`)
- Product catalog → Product state: loads products (evidence: `frontend/src/Components/Products/Products.jsx`)
- Product details → Detail and review state: loads details (evidence: `frontend/src/Components/ProductDetail/ProductDetail.jsx`)
- Account access → Authentication state: dispatches auth (evidence: `frontend/src/Components/User/LoginSignUp.jsx`)
- Shopper → Cart and shipping: manages cart (evidence: `README.md`)
- Cart and shipping → Cart state: updates cart (evidence: `frontend/src/Components/Cart/Cart.jsx`)
- Page routing → Cart and shipping: routes to (evidence: `frontend/src/App.jsx`)
- Page routing → Order confirmation: routes to (evidence: `frontend/src/App.jsx`)
- Page routing → Payment step: routes to (evidence: `frontend/src/App.jsx`)
- Order confirmation → Payment state: requests payment (evidence: `frontend/src/Components/Cart/ConfirmOrder.jsx`)
- Payment step → Order state: creates order (evidence: `frontend/src/Components/Cart/Payment.jsx`)
- Payment step → Payment state: uses payment state (evidence: `frontend/src/Components/Cart/Payment.jsx`)
- Page routing → Order tracking: routes to (evidence: `frontend/src/App.jsx`)
- Administrator → Admin console: manages store (evidence: `README.md`)
- Page routing → Admin console: routes to (evidence: `frontend/src/App.jsx`)
- Product catalog → Express application: requests catalog (evidence: `README.md`)
- Product details → Express application: requests details (evidence: `README.md`)
- Account access → Express application: authenticates (evidence: `README.md`)
- Cart and shipping → Express application: submits checkout (evidence: `README.md`)
- Order tracking → Express application: requests orders (evidence: `README.md`)
- Admin console → Express application: manages records (evidence: `README.md`)
- Express application → API routes: mounts endpoints (evidence: `backend/app.js`)
- API routes → Product handlers: dispatches product (evidence: `backend/routes/productRoute.js`)
- API routes → Access control: checks access (evidence: `backend/routes/productRoute.js`)
- API routes → Account handlers: dispatches account
- API routes → Order handlers: dispatches orders
- API routes → Payment handlers: dispatches payment
- API routes → Review handlers: dispatches reviews
- Product handlers → Product records: reads and writes (evidence: `backend/controllers/productController.js`)
- Product handlers → Review records: reads reviews (evidence: `backend/controllers/productController.js`)
- Review handlers → Product records: updates ratings (evidence: `backend/controllers/reviewController.js`)
- Review handlers → Review records: writes reviews (evidence: `backend/controllers/reviewController.js`)
- Account handlers → User records: reads and writes (evidence: `backend/controllers/userController.js`)
- Order handlers → Order records: reads and writes (evidence: `backend/controllers/orderController.js`)
- Order handlers → Product records: updates stock (evidence: `backend/controllers/orderController.js`)
- Product records → MongoDB: persists records (evidence: `README.md`)
- Review records → MongoDB: persists records (evidence: `README.md`)
- User records → MongoDB: persists records (evidence: `README.md`)
- Order records → MongoDB: persists records (evidence: `README.md`)
- Product handlers → Cloudinary: manages images (evidence: `backend/controllers/productController.js`)
- Account handlers → Cloudinary: deletes avatar (evidence: `backend/controllers/userController.js`)
- Payment handlers → Razorpay: processes payment (evidence: `README.md`)
- Account handlers → Email service: sends reset link (evidence: `backend/controllers/userController.js`)
