# deepak4511/e-commerce_with_mern architecture

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

- Interactive diagram: https://gitdiagram.com/deepak4511/e-commerce_with_mern
- Repository: https://github.com/deepak4511/e-commerce_with_mern

## Overview

This is a full-stack online shop with customer and administrator experiences. Customers browse and search products, manage carts and addresses, place and pay for orders, then review order status; administrators manage catalog items and orders. The React app routes requests through Redux-backed pages to an Express API, whose controllers persist domain records in MongoDB and delegate image uploads and PayPal payments to external services. The sampled files establish these main route/controller/model relationships; several controllers and the client API wiring were not included, so their internal calls are not inferred.

Main entry points: [`server/server.js`](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/server.js) (API server), [`client/src/App.jsx`](https://github.com/deepak4511/e-commerce_with_mern/blob/main/client/src/App.jsx) (Route application), [`server/controllers/admin/products-controller.js`](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/controllers/admin/products-controller.js) (Product management), [`server/controllers/shop/cart-controller.js`](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/controllers/shop/cart-controller.js) (Cart service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Customer storefront"]
  node_app["Route application<br/>[App.jsx]"]
  node_shop_pages["Shop pages"]
  node_shop_state["Shop state"]
  node_auth_pages["Login and registration"]
end

subgraph group_admin["Shop administration"]
  node_admin_pages["Admin pages"]
  node_admin_state["Admin state"]
end

subgraph group_api["API and domain services"]
  node_server["API server<br/>[server.js]"]
  node_auth_routes["Auth routes<br/>[auth-routes.js]"]
  node_auth_controller["Auth service<br/>[auth-controller.js]"]
  node_product_routes["Admin product routes<br/>[products-routes.js]"]
  node_product_controller["Product management"]
  node_shop_cart["Cart service<br/>[cart-controller.js]"]
  node_admin_order["Admin order service"]
  node_shop_order_routes["Order routes<br/>[order-routes.js]"]
  node_admin_order_routes["Admin order routes<br/>[order-routes.js]"]
  node_address_routes["Address routes<br/>[address-routes.js]"]
end

subgraph group_data["Persistent records"]
  node_product_model[("Products<br/>[product.js]")]
  node_user_model[("Users<br/>[user.js]")]
  node_cart_model[("Carts<br/>[cart.js]")]
  node_order_model[("Orders<br/>[Order.js]")]
  node_address_model[("Addresses<br/>[address.js]")]
end

node_shopper(("Shopper"))
node_administrator(("Administrator"))
node_cloudinary["Cloudinary"]
node_paypal["PayPal"]
node_mongo[("MongoDB")]

node_shopper -->|"uses storefront"| node_app
node_administrator -->|"uses admin"| node_app
node_app -->|"routes to"| node_shop_pages
node_app -->|"routes to"| node_auth_pages
node_app -->|"routes to"| node_admin_pages
node_shop_pages -->|"uses state"| node_shop_state
node_admin_pages -->|"uses state"| node_admin_state
node_app -->|"checks authentication"| node_server
node_server -->|"mounts routes"| node_auth_routes
node_server -->|"mounts routes"| node_product_routes
node_server -->|"mounts routes"| node_shop_order_routes
node_server -->|"mounts routes"| node_admin_order_routes
node_server -->|"mounts routes"| node_address_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_product_routes -->|"dispatches"| node_product_controller
node_shop_order_routes -->|"dispatches orders"| node_order_model
node_admin_order_routes -->|"dispatches"| node_admin_order
node_admin_order -->|"reads and updates"| node_order_model
node_product_controller -->|"reads and writes"| node_product_model
node_product_controller -.->|"uploads images"| node_cloudinary
node_auth_controller -->|"reads and writes"| node_user_model
node_shop_cart -->|"reads and writes"| node_cart_model
node_shop_cart -->|"reads products"| node_product_model
node_server -->|"connects"| node_mongo

click node_app "https://github.com/deepak4511/e-commerce_with_mern/blob/main/client/src/App.jsx"
click node_shop_pages "https://github.com/deepak4511/e-commerce_with_mern/tree/main/client/src/pages/shopping-view"
click node_shop_state "https://github.com/deepak4511/e-commerce_with_mern/tree/main/client/src/store/shop"
click node_auth_pages "https://github.com/deepak4511/e-commerce_with_mern/tree/main/client/src/pages/auth"
click node_admin_pages "https://github.com/deepak4511/e-commerce_with_mern/tree/main/client/src/pages/admin-view"
click node_admin_state "https://github.com/deepak4511/e-commerce_with_mern/tree/main/client/src/store/admin"
click node_server "https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/server.js"
click node_auth_routes "https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/routes/auth/auth-routes.js"
click node_auth_controller "https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/controllers/auth/auth-controller.js"
click node_product_routes "https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/routes/admin/products-routes.js"
click node_product_controller "https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/controllers/admin/products-controller.js"
click node_shop_cart "https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/controllers/shop/cart-controller.js"
click node_admin_order "https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/controllers/admin/order-controller.js"
click node_shop_order_routes "https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/routes/shop/order-routes.js"
click node_admin_order_routes "https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/routes/admin/order-routes.js"
click node_address_routes "https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/routes/shop/address-routes.js"
click node_product_model "https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/models/product.js"
click node_user_model "https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/models/user.js"
click node_cart_model "https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/models/cart.js"
click node_order_model "https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/models/Order.js"
click node_address_model "https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/models/address.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_app,node_shop_pages,node_shop_state,node_auth_pages toneBlue
class node_admin_pages,node_admin_state,node_mongo toneAmber
class node_server,node_auth_routes,node_auth_controller,node_product_routes,node_product_controller,node_shop_cart,node_admin_order,node_shop_order_routes,node_admin_order_routes,node_address_routes toneMint
class node_product_model,node_user_model,node_cart_model,node_order_model,node_address_model toneRose
class node_shopper,node_administrator,node_cloudinary,node_paypal toneIndigo
```

## Components

### Customer storefront

- [Route application](https://github.com/deepak4511/e-commerce_with_mern/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Shop pages](https://github.com/deepak4511/e-commerce_with_mern/tree/main/client/src/pages/shopping-view): `client/src/pages/shopping-view`
- [Shop state](https://github.com/deepak4511/e-commerce_with_mern/tree/main/client/src/store/shop): `client/src/store/shop`
- [Login and registration](https://github.com/deepak4511/e-commerce_with_mern/tree/main/client/src/pages/auth): `client/src/pages/auth`

### Shop administration

- [Admin pages](https://github.com/deepak4511/e-commerce_with_mern/tree/main/client/src/pages/admin-view): `client/src/pages/admin-view`
- [Admin state](https://github.com/deepak4511/e-commerce_with_mern/tree/main/client/src/store/admin): `client/src/store/admin`

### API and domain services

- [API server](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/server.js): `server/server.js`
- [Auth routes](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/routes/auth/auth-routes.js): `server/routes/auth/auth-routes.js`
- [Auth service](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/controllers/auth/auth-controller.js): `server/controllers/auth/auth-controller.js`
- [Admin product routes](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/routes/admin/products-routes.js): `server/routes/admin/products-routes.js`
- [Product management](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/controllers/admin/products-controller.js): `server/controllers/admin/products-controller.js`
- [Cart service](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/controllers/shop/cart-controller.js): `server/controllers/shop/cart-controller.js`
- [Admin order service](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/controllers/admin/order-controller.js): `server/controllers/admin/order-controller.js`
- [Order routes](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/routes/shop/order-routes.js): `server/routes/shop/order-routes.js`
- [Admin order routes](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/routes/admin/order-routes.js): `server/routes/admin/order-routes.js`
- [Address routes](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/routes/shop/address-routes.js): `server/routes/shop/address-routes.js`

### Persistent records

- [Products](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/models/product.js): `server/models/product.js`
- [Users](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/models/user.js): `server/models/user.js`
- [Carts](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/models/cart.js): `server/models/cart.js`
- [Orders](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/models/Order.js): `server/models/Order.js`
- [Addresses](https://github.com/deepak4511/e-commerce_with_mern/blob/main/server/models/address.js): `server/models/address.js`

### Other components

- **Shopper**
- **Administrator**
- **Cloudinary**
- **PayPal**
- **MongoDB**

## Connections

- Shopper → Route application: uses storefront
- Administrator → Route application: uses admin
- Route application → Shop pages: routes to
- Route application → Login and registration: routes to
- Route application → Admin pages: routes to
- Shop pages → Shop state: uses state
- Admin pages → Admin state: uses state
- Route application → API server: checks authentication
- API server → Auth routes: mounts routes
- API server → Admin product routes: mounts routes
- API server → Order routes: mounts routes
- API server → Admin order routes: mounts routes
- API server → Address routes: mounts routes
- Auth routes → Auth service: dispatches
- Admin product routes → Product management: dispatches
- Order routes → Orders: dispatches orders
- Admin order routes → Admin order service: dispatches
- Admin order service → Orders: reads and updates
- Product management → Products: reads and writes
- Product management → Cloudinary: uploads images
- Auth service → Users: reads and writes
- Cart service → Carts: reads and writes
- Cart service → Products: reads products
- API server → MongoDB: connects
