# ramashishyadav01/e-shop architecture

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

- Interactive diagram: https://gitdiagram.com/ramashishyadav01/e-shop
- Repository: https://github.com/ramashishyadav01/e-shop

## Overview

E-Shop is a full-stack storefront with customer purchasing and role-based seller/admin management. The customer path runs from browsing and cart through address/payment checkout to order confirmation; the backend provides authentication, catalog, cart, address, and order APIs backed by MongoDB models. The README documents multiple payment options and admin capabilities, while sampled code confirms selected frontend routing, API actions, and backend dispatch/storage links. Some frontend and backend integrations are documented or indexed but not fully sampled, so those links are dashed where their wiring is unverified.

Main entry points: [`Ecom-Frontend/src/App.jsx`](https://github.com/ramashishyadav01/e-shop/blob/main/Ecom-Frontend/src/App.jsx) (App Routes), [`Ecom-Frontend/src/store/actions/index.js`](https://github.com/ramashishyadav01/e-shop/blob/main/Ecom-Frontend/src/store/actions/index.js) (Redux Actions), [`ecom-node/src/models`](https://github.com/ramashishyadav01/e-shop/tree/main/ecom-node/src/models) (MongoDB Models), [`ecom-node/src/index.js`](https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/index.js) (API Server & Routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["App Routes<br/>[App.jsx]"]
  node_catalog["Product Browse<br/>[Products.jsx]"]
  node_cart["Shopping Cart<br/>[Cart.jsx]"]
  node_checkout["Checkout &amp; Payments<br/>[Checkout.jsx]"]
  node_profile["Profile &amp; Addresses<br/>[Profile.jsx]"]
end

subgraph group_management["Seller &amp; Admin"]
  node_adminui["Admin &amp; Seller Panel"]
  node_authui["Authentication UI"]
end

subgraph group_frontendcore["Frontend Core"]
  node_actions["Redux Actions<br/>[index.js]"]
  node_api["Axios API Client<br/>[api.js]"]
end

subgraph group_backend["Backend API"]
  node_backendentry["API Server &amp; Routes<br/>[index.js]"]
  node_authroutes["Auth Routes<br/>[auth.routes.js]"]
  node_productroutes["Product Routes<br/>[product.routes.js]"]
  node_categoryroutes["Category Routes<br/>[category.routes.js]"]
  node_authcontroller["Auth Controller<br/>[auth.controller.js]"]
  node_productcontroller["Product Controller"]
  node_cartcontroller["Cart Controller<br/>[cart.controller.js]"]
  node_ordercontroller["Order Controller"]
  node_authmw["Token &amp; Role Guard<br/>[auth.middleware.js]"]
end

subgraph group_data["Persistent Data"]
  node_models[("MongoDB Models")]
end

node_customer(("Customer"))
node_payments["Payment Providers"]

node_customer -->|"uses"| node_app
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_cart
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_adminui
node_app -->|"routes to"| node_authui
node_catalog -.->|"requests data"| node_actions
node_cart -.->|"updates cart"| node_actions
node_checkout -->|"submits checkout"| node_actions
node_profile -->|"requests profile"| node_api
node_authui -->|"dispatches auth"| node_actions
node_adminui -.->|"manages data"| node_actions
node_actions -->|"calls"| node_api
node_api -.->|"calls API"| node_backendentry
node_backendentry -->|"mounts"| node_authroutes
node_backendentry -->|"mounts"| node_productroutes
node_backendentry -->|"mounts"| node_categoryroutes
node_backendentry -.->|"connects database"| node_models
node_authroutes -->|"dispatches"| node_authcontroller
node_authroutes -->|"guards routes"| node_authmw
node_productroutes -->|"dispatches"| node_productcontroller
node_productroutes -->|"guards routes"| node_authmw
node_categoryroutes -->|"guards writes"| node_authmw
node_authcontroller -->|"reads/writes users"| node_models
node_authmw -->|"loads user"| node_models
node_productcontroller -->|"reads/writes catalog"| node_models
node_cartcontroller -->|"reads/writes cart"| node_models
node_ordercontroller -->|"creates orders"| node_models
node_checkout -.->|"offers payment"| node_payments
node_ordercontroller -->|"creates payment intent"| node_payments

click node_app "https://github.com/ramashishyadav01/e-shop/blob/main/Ecom-Frontend/src/App.jsx"
click node_catalog "https://github.com/ramashishyadav01/e-shop/blob/main/Ecom-Frontend/src/components/products/Products.jsx"
click node_cart "https://github.com/ramashishyadav01/e-shop/blob/main/Ecom-Frontend/src/components/cart/Cart.jsx"
click node_checkout "https://github.com/ramashishyadav01/e-shop/blob/main/Ecom-Frontend/src/components/checkout/Checkout.jsx"
click node_profile "https://github.com/ramashishyadav01/e-shop/blob/main/Ecom-Frontend/src/components/Profile.jsx"
click node_adminui "https://github.com/ramashishyadav01/e-shop/tree/main/Ecom-Frontend/src/components/admin"
click node_authui "https://github.com/ramashishyadav01/e-shop/tree/main/Ecom-Frontend/src/components/auth"
click node_actions "https://github.com/ramashishyadav01/e-shop/blob/main/Ecom-Frontend/src/store/actions/index.js"
click node_api "https://github.com/ramashishyadav01/e-shop/blob/main/Ecom-Frontend/src/api/api.js"
click node_backendentry "https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/index.js"
click node_authroutes "https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/routes/auth.routes.js"
click node_productroutes "https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/routes/product.routes.js"
click node_categoryroutes "https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/routes/category.routes.js"
click node_authcontroller "https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/controllers/auth.controller.js"
click node_productcontroller "https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/controllers/product.controller.js"
click node_cartcontroller "https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/controllers/cart.controller.js"
click node_ordercontroller "https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/controllers/order.controller.js"
click node_authmw "https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/middleware/auth.middleware.js"
click node_models "https://github.com/ramashishyadav01/e-shop/tree/main/ecom-node/src/models"

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,node_cart,node_checkout,node_profile toneBlue
class node_adminui,node_authui toneAmber
class node_actions,node_api toneMint
class node_backendentry,node_authroutes,node_productroutes,node_categoryroutes,node_authcontroller,node_productcontroller,node_cartcontroller,node_ordercontroller,node_authmw toneRose
class node_models,node_customer,node_payments toneIndigo
```

## Components

### Storefront

- [App Routes](https://github.com/ramashishyadav01/e-shop/blob/main/Ecom-Frontend/src/App.jsx): `Ecom-Frontend/src/App.jsx`
- [Product Browse](https://github.com/ramashishyadav01/e-shop/blob/main/Ecom-Frontend/src/components/products/Products.jsx): `Ecom-Frontend/src/components/products/Products.jsx`
- [Shopping Cart](https://github.com/ramashishyadav01/e-shop/blob/main/Ecom-Frontend/src/components/cart/Cart.jsx): `Ecom-Frontend/src/components/cart/Cart.jsx`
- [Checkout & Payments](https://github.com/ramashishyadav01/e-shop/blob/main/Ecom-Frontend/src/components/checkout/Checkout.jsx): `Ecom-Frontend/src/components/checkout/Checkout.jsx`
- [Profile & Addresses](https://github.com/ramashishyadav01/e-shop/blob/main/Ecom-Frontend/src/components/Profile.jsx): `Ecom-Frontend/src/components/Profile.jsx`

### Seller & Admin

- [Admin & Seller Panel](https://github.com/ramashishyadav01/e-shop/tree/main/Ecom-Frontend/src/components/admin): `Ecom-Frontend/src/components/admin`
- [Authentication UI](https://github.com/ramashishyadav01/e-shop/tree/main/Ecom-Frontend/src/components/auth): `Ecom-Frontend/src/components/auth`

### Frontend Core

- [Redux Actions](https://github.com/ramashishyadav01/e-shop/blob/main/Ecom-Frontend/src/store/actions/index.js): `Ecom-Frontend/src/store/actions/index.js`
- [Axios API Client](https://github.com/ramashishyadav01/e-shop/blob/main/Ecom-Frontend/src/api/api.js): `Ecom-Frontend/src/api/api.js`

### Backend API

- [API Server & Routes](https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/index.js): `ecom-node/src/index.js`
- [Auth Routes](https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/routes/auth.routes.js): `ecom-node/src/routes/auth.routes.js`
- [Product Routes](https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/routes/product.routes.js): `ecom-node/src/routes/product.routes.js`
- [Category Routes](https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/routes/category.routes.js): `ecom-node/src/routes/category.routes.js`
- [Auth Controller](https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/controllers/auth.controller.js): `ecom-node/src/controllers/auth.controller.js`
- [Product Controller](https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/controllers/product.controller.js): `ecom-node/src/controllers/product.controller.js`
- [Cart Controller](https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/controllers/cart.controller.js): `ecom-node/src/controllers/cart.controller.js`
- [Order Controller](https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/controllers/order.controller.js): `ecom-node/src/controllers/order.controller.js`
- [Token & Role Guard](https://github.com/ramashishyadav01/e-shop/blob/main/ecom-node/src/middleware/auth.middleware.js): `ecom-node/src/middleware/auth.middleware.js`

### Persistent Data

- [MongoDB Models](https://github.com/ramashishyadav01/e-shop/tree/main/ecom-node/src/models): `ecom-node/src/models`

### Other components

- **Customer**
- **Payment Providers**

## Connections

- Customer → App Routes: uses (evidence: `Ecom-Frontend/src/App.jsx`)
- App Routes → Product Browse: routes to (evidence: `Ecom-Frontend/src/App.jsx`)
- App Routes → Shopping Cart: routes to (evidence: `Ecom-Frontend/src/App.jsx`)
- App Routes → Checkout & Payments: routes to (evidence: `Ecom-Frontend/src/App.jsx`)
- App Routes → Profile & Addresses: routes to (evidence: `Ecom-Frontend/src/App.jsx`)
- App Routes → Admin & Seller Panel: routes to (evidence: `Ecom-Frontend/src/App.jsx`)
- App Routes → Authentication UI: routes to (evidence: `Ecom-Frontend/src/App.jsx`)
- Product Browse → Redux Actions: requests data
- Shopping Cart → Redux Actions: updates cart
- Checkout & Payments → Redux Actions: submits checkout (evidence: `Ecom-Frontend/src/components/checkout/Checkout.jsx`)
- Profile & Addresses → Axios API Client: requests profile (evidence: `Ecom-Frontend/src/components/Profile.jsx`)
- Authentication UI → Redux Actions: dispatches auth (evidence: `Ecom-Frontend/src/components/auth/Register.jsx`)
- Admin & Seller Panel → Redux Actions: manages data (evidence: `Ecom-Frontend/src/components/admin/sellers/useSellerFilter.jsx`)
- Redux Actions → Axios API Client: calls (evidence: `Ecom-Frontend/src/store/actions/index.js`)
- Axios API Client → API Server & Routes: calls API
- API Server & Routes → Auth Routes: mounts (evidence: `ecom-node/src/index.js`)
- API Server & Routes → Product Routes: mounts (evidence: `ecom-node/src/index.js`)
- API Server & Routes → Category Routes: mounts (evidence: `ecom-node/src/index.js`)
- API Server & Routes → MongoDB Models: connects database
- Auth Routes → Auth Controller: dispatches (evidence: `ecom-node/src/routes/auth.routes.js`)
- Auth Routes → Token & Role Guard: guards routes (evidence: `ecom-node/src/routes/auth.routes.js`)
- Product Routes → Product Controller: dispatches (evidence: `ecom-node/src/routes/product.routes.js`)
- Product Routes → Token & Role Guard: guards routes (evidence: `ecom-node/src/routes/product.routes.js`)
- Category Routes → Token & Role Guard: guards writes (evidence: `ecom-node/src/routes/category.routes.js`)
- Auth Controller → MongoDB Models: reads/writes users (evidence: `ecom-node/src/controllers/auth.controller.js`)
- Token & Role Guard → MongoDB Models: loads user (evidence: `ecom-node/src/middleware/auth.middleware.js`)
- Product Controller → MongoDB Models: reads/writes catalog (evidence: `ecom-node/src/controllers/product.controller.js`)
- Cart Controller → MongoDB Models: reads/writes cart (evidence: `ecom-node/src/controllers/cart.controller.js`)
- Order Controller → MongoDB Models: creates orders (evidence: `ecom-node/src/controllers/order.controller.js`)
- Checkout & Payments → Payment Providers: offers payment
- Order Controller → Payment Providers: creates payment intent (evidence: `ecom-node/src/controllers/order.controller.js`)
