# dipandhali2021/ecommerce architecture

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

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

## Overview

ByteBazaar is an electronics storefront with customer shopping and a separate administrator interface. Customers browse and filter products, manage a cart or wishlist, authenticate, and can place orders and review their history; administrators manage catalog, transactions, customers, coupons, messages, and dashboard analytics. The frontend routes through React and uses Redux state/API layers; the Express backend mounts domain routes, with MongoDB-backed models and shared cache, stock, and analytics utilities. Unsampled route and order internals limit some relationship details; optional frontend-to-backend links are dashed where the cross-service call is not shown.

Main entry points: [`ecommerce_frontend/src/redux/store.ts`](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/store.ts) (Redux store), [`ecommerce_backend/src/app.ts`](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/app.ts) (Express API), [`ecommerce_frontend/src/App.tsx`](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/App.tsx) (App routing), [`ecommerce_frontend/src/pages/Search.tsx`](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/pages/Search.tsx) (Product discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Customer storefront"]
  node_app["App routing<br/>[App.tsx]"]
  node_catalog["Product discovery<br/>[Search.tsx]"]
  node_cart["Cart and checkout<br/>[Cart.tsx]"]
  node_orderhistory["Order history<br/>[Orders.tsx]"]
  node_wishlist["Wishlist<br/>[WishList.tsx]"]
  node_authpages["Account pages<br/>[Login.tsx]"]
end

subgraph group_admin["Admin console"]
  node_adminroutes["Admin pages"]
  node_dashboard["Analytics dashboard<br/>[dashboard.tsx]"]
  node_productadmin["Product management"]
  node_couponadmin["Coupon management<br/>[coupon.tsx]"]
end

subgraph group_state["Frontend state and API"]
  node_redux["Redux store<br/>[store.ts]"]
  node_cartstate["Cart state<br/>[cartReducer.ts]"]
  node_userstate["User state<br/>[userReducer.ts]"]
  node_wishstate["Wishlist state<br/>[wishlistReducer.ts]"]
  node_productapi["Product API<br/>[productAPI.ts]"]
  node_userapi["User API<br/>[userAPI.ts]"]
  node_orderapi["Order API<br/>[orderAPI.ts]"]
  node_dashboardapi["Dashboard API<br/>[dashboardAPI.ts]"]
  node_couponapi["Coupon API<br/>[couponAPI.ts]"]
end

subgraph group_backend["Backend services"]
  node_server["Express API<br/>[app.ts]"]
  node_productroutes["Product routes<br/>[product.ts]"]
  node_orderroutes["Order routes<br/>[order.ts]"]
  node_paymentroutes["Payment routes<br/>[payment.ts]"]
  node_userroutes["User routes<br/>[user.ts]"]
  node_statsroutes["Dashboard routes<br/>[stats.ts]"]
  node_messageroutes["Message routes<br/>[message.ts]"]
  node_productcontroller["Product operations<br/>[product.ts]"]
  node_ordercontroller["Order operations<br/>[order.ts]"]
  node_statscontroller["Analytics operations<br/>[stats.ts]"]
  node_cacheutils["Cache and metrics<br/>[features.ts]"]
end

subgraph group_domain["Domain data"]
  node_productmodel["Product model<br/>[product.ts]"]
  node_ordermodel["Order model<br/>[order.ts]"]
end

node_shopper(("Shopper"))
node_administrator(("Administrator"))

node_shopper -->|"uses"| node_app
node_administrator -->|"uses"| node_app
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_cart
node_app -->|"routes to"| node_orderhistory
node_app -->|"routes to"| node_wishlist
node_app -->|"routes to"| node_authpages
node_app -->|"routes to"| node_adminroutes
node_adminroutes -->|"includes"| node_dashboard
node_adminroutes -->|"includes"| node_productadmin
node_adminroutes -->|"includes"| node_couponadmin
node_catalog -->|"queries"| node_productapi
node_catalog -->|"dispatches"| node_cartstate
node_catalog -->|"dispatches"| node_wishstate
node_dashboard -->|"queries"| node_dashboardapi
node_redux -->|"registers"| node_productapi
node_redux -->|"registers"| node_userapi
node_redux -->|"registers"| node_orderapi
node_redux -->|"registers"| node_dashboardapi
node_redux -->|"registers"| node_couponapi
node_redux -->|"registers"| node_cartstate
node_redux -->|"registers"| node_userstate
node_redux -->|"registers"| node_wishstate
node_server -->|"mounts"| node_productroutes
node_server -->|"mounts"| node_orderroutes
node_server -->|"mounts"| node_paymentroutes
node_server -->|"mounts"| node_userroutes
node_server -->|"mounts"| node_statsroutes
node_server -->|"mounts"| node_messageroutes
node_productroutes -->|"routes to"| node_productcontroller
node_paymentroutes -.->|"routes to"| node_ordercontroller
node_statsroutes -.->|"routes to"| node_statscontroller
node_productcontroller -->|"queries"| node_productmodel
node_statscontroller -->|"queries"| node_productmodel
node_statscontroller -->|"queries"| node_ordermodel
node_productcontroller -->|"uses"| node_cacheutils
node_server -->|"connects database"| node_cacheutils
node_productapi -.->|"HTTP requests"| node_productroutes
node_orderapi -.->|"HTTP requests"| node_orderroutes
node_dashboardapi -.->|"HTTP requests"| node_statsroutes
node_userapi -.->|"HTTP requests"| node_userroutes
node_couponapi -.->|"HTTP requests"| node_server

click node_app "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/App.tsx"
click node_catalog "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/pages/Search.tsx"
click node_cart "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/pages/Cart.tsx"
click node_orderhistory "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/pages/Orders.tsx"
click node_wishlist "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/pages/WishList.tsx"
click node_authpages "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/pages/Login.tsx"
click node_adminroutes "https://github.com/dipandhali2021/ecommerce/tree/master/ecommerce_frontend/src/pages/admin"
click node_dashboard "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/pages/admin/dashboard.tsx"
click node_productadmin "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/pages/admin/management/productmanagement.tsx"
click node_couponadmin "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/pages/admin/apps/coupon.tsx"
click node_redux "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/store.ts"
click node_cartstate "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/reducer/cartReducer.ts"
click node_userstate "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/reducer/userReducer.ts"
click node_wishstate "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/reducer/wishlistReducer.ts"
click node_productapi "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/api/productAPI.ts"
click node_userapi "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/api/userAPI.ts"
click node_orderapi "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/api/orderAPI.ts"
click node_dashboardapi "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/api/dashboardAPI.ts"
click node_couponapi "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/api/couponAPI.ts"
click node_server "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/app.ts"
click node_productroutes "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/routes/product.ts"
click node_orderroutes "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/routes/order.ts"
click node_paymentroutes "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/routes/payment.ts"
click node_userroutes "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/routes/user.ts"
click node_statsroutes "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/routes/stats.ts"
click node_messageroutes "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/routes/message.ts"
click node_productcontroller "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/controllers/product.ts"
click node_ordercontroller "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/controllers/order.ts"
click node_statscontroller "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/controllers/stats.ts"
click node_cacheutils "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/utils/features.ts"
click node_productmodel "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/models/product.ts"
click node_ordermodel "https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/models/order.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_app,node_catalog,node_cart,node_orderhistory,node_wishlist,node_authpages toneBlue
class node_adminroutes,node_dashboard,node_productadmin,node_couponadmin toneAmber
class node_redux,node_cartstate,node_userstate,node_wishstate,node_productapi,node_userapi,node_orderapi,node_dashboardapi,node_couponapi toneMint
class node_server,node_productroutes,node_orderroutes,node_paymentroutes,node_userroutes,node_statsroutes,node_messageroutes,node_productcontroller,node_ordercontroller,node_statscontroller,node_cacheutils toneRose
class node_productmodel,node_ordermodel,node_shopper,node_administrator toneIndigo
```

## Components

### Customer storefront

- [App routing](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/App.tsx): `ecommerce_frontend/src/App.tsx`
- [Product discovery](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/pages/Search.tsx): `ecommerce_frontend/src/pages/Search.tsx`
- [Cart and checkout](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/pages/Cart.tsx): `ecommerce_frontend/src/pages/Cart.tsx`
- [Order history](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/pages/Orders.tsx): `ecommerce_frontend/src/pages/Orders.tsx`
- [Wishlist](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/pages/WishList.tsx): `ecommerce_frontend/src/pages/WishList.tsx`
- [Account pages](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/pages/Login.tsx): `ecommerce_frontend/src/pages/Login.tsx`

### Admin console

- [Admin pages](https://github.com/dipandhali2021/ecommerce/tree/master/ecommerce_frontend/src/pages/admin): `ecommerce_frontend/src/pages/admin`
- [Analytics dashboard](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/pages/admin/dashboard.tsx): `ecommerce_frontend/src/pages/admin/dashboard.tsx`
- [Product management](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/pages/admin/management/productmanagement.tsx): `ecommerce_frontend/src/pages/admin/management/productmanagement.tsx`
- [Coupon management](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/pages/admin/apps/coupon.tsx): `ecommerce_frontend/src/pages/admin/apps/coupon.tsx`

### Frontend state and API

- [Redux store](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/store.ts): `ecommerce_frontend/src/redux/store.ts`
- [Cart state](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/reducer/cartReducer.ts): `ecommerce_frontend/src/redux/reducer/cartReducer.ts`
- [User state](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/reducer/userReducer.ts): `ecommerce_frontend/src/redux/reducer/userReducer.ts`
- [Wishlist state](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/reducer/wishlistReducer.ts): `ecommerce_frontend/src/redux/reducer/wishlistReducer.ts`
- [Product API](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/api/productAPI.ts): `ecommerce_frontend/src/redux/api/productAPI.ts`
- [User API](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/api/userAPI.ts): `ecommerce_frontend/src/redux/api/userAPI.ts`
- [Order API](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/api/orderAPI.ts): `ecommerce_frontend/src/redux/api/orderAPI.ts`
- [Dashboard API](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/api/dashboardAPI.ts): `ecommerce_frontend/src/redux/api/dashboardAPI.ts`
- [Coupon API](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_frontend/src/redux/api/couponAPI.ts): `ecommerce_frontend/src/redux/api/couponAPI.ts`

### Backend services

- [Express API](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/app.ts): `ecommerce_backend/src/app.ts`
- [Product routes](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/routes/product.ts): `ecommerce_backend/src/routes/product.ts`
- [Order routes](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/routes/order.ts): `ecommerce_backend/src/routes/order.ts`
- [Payment routes](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/routes/payment.ts): `ecommerce_backend/src/routes/payment.ts`
- [User routes](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/routes/user.ts): `ecommerce_backend/src/routes/user.ts`
- [Dashboard routes](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/routes/stats.ts): `ecommerce_backend/src/routes/stats.ts`
- [Message routes](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/routes/message.ts): `ecommerce_backend/src/routes/message.ts`
- [Product operations](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/controllers/product.ts): `ecommerce_backend/src/controllers/product.ts`
- [Order operations](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/controllers/order.ts): `ecommerce_backend/src/controllers/order.ts`
- [Analytics operations](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/controllers/stats.ts): `ecommerce_backend/src/controllers/stats.ts`
- [Cache and metrics](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/utils/features.ts): `ecommerce_backend/src/utils/features.ts`

### Domain data

- [Product model](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/models/product.ts): `ecommerce_backend/src/models/product.ts`
- [Order model](https://github.com/dipandhali2021/ecommerce/blob/master/ecommerce_backend/src/models/order.ts): `ecommerce_backend/src/models/order.ts`

### Other components

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

## Connections

- Shopper → App routing: uses (evidence: `ecommerce_frontend/src/App.tsx`)
- Administrator → App routing: uses (evidence: `ecommerce_frontend/src/App.tsx`)
- App routing → Product discovery: routes to (evidence: `ecommerce_frontend/src/App.tsx`)
- App routing → Cart and checkout: routes to (evidence: `ecommerce_frontend/src/App.tsx`)
- App routing → Order history: routes to (evidence: `ecommerce_frontend/src/App.tsx`)
- App routing → Wishlist: routes to (evidence: `ecommerce_frontend/src/App.tsx`)
- App routing → Account pages: routes to (evidence: `ecommerce_frontend/src/App.tsx`)
- App routing → Admin pages: routes to (evidence: `ecommerce_frontend/src/App.tsx`)
- Admin pages → Analytics dashboard: includes (evidence: `ecommerce_frontend/src/App.tsx`)
- Admin pages → Product management: includes (evidence: `ecommerce_frontend/src/App.tsx`)
- Admin pages → Coupon management: includes (evidence: `ecommerce_frontend/src/App.tsx`)
- Product discovery → Product API: queries (evidence: `ecommerce_frontend/src/pages/Search.tsx`)
- Product discovery → Cart state: dispatches (evidence: `ecommerce_frontend/src/pages/Search.tsx`)
- Product discovery → Wishlist state: dispatches (evidence: `ecommerce_frontend/src/pages/Search.tsx`)
- Analytics dashboard → Dashboard API: queries (evidence: `ecommerce_frontend/src/pages/admin/dashboard.tsx`)
- Redux store → Product API: registers (evidence: `ecommerce_frontend/src/redux/store.ts`)
- Redux store → User API: registers (evidence: `ecommerce_frontend/src/redux/store.ts`)
- Redux store → Order API: registers (evidence: `ecommerce_frontend/src/redux/store.ts`)
- Redux store → Dashboard API: registers (evidence: `ecommerce_frontend/src/redux/store.ts`)
- Redux store → Coupon API: registers (evidence: `ecommerce_frontend/src/redux/store.ts`)
- Redux store → Cart state: registers (evidence: `ecommerce_frontend/src/redux/store.ts`)
- Redux store → User state: registers (evidence: `ecommerce_frontend/src/redux/store.ts`)
- Redux store → Wishlist state: registers (evidence: `ecommerce_frontend/src/redux/store.ts`)
- Express API → Product routes: mounts (evidence: `ecommerce_backend/src/app.ts`)
- Express API → Order routes: mounts (evidence: `ecommerce_backend/src/app.ts`)
- Express API → Payment routes: mounts (evidence: `ecommerce_backend/src/app.ts`)
- Express API → User routes: mounts (evidence: `ecommerce_backend/src/app.ts`)
- Express API → Dashboard routes: mounts (evidence: `ecommerce_backend/src/app.ts`)
- Express API → Message routes: mounts (evidence: `ecommerce_backend/src/app.ts`)
- Product routes → Product operations: routes to (evidence: `ecommerce_backend/src/routes/product.ts`)
- Payment routes → Order operations: routes to
- Dashboard routes → Analytics operations: routes to
- Product operations → Product model: queries (evidence: `ecommerce_backend/src/controllers/product.ts`)
- Analytics operations → Product model: queries (evidence: `ecommerce_backend/src/controllers/stats.ts`)
- Analytics operations → Order model: queries (evidence: `ecommerce_backend/src/controllers/stats.ts`)
- Product operations → Cache and metrics: uses (evidence: `ecommerce_backend/src/controllers/product.ts`)
- Express API → Cache and metrics: connects database (evidence: `ecommerce_backend/src/app.ts`)
- Product API → Product routes: HTTP requests
- Order API → Order routes: HTTP requests
- Dashboard API → Dashboard routes: HTTP requests
- User API → User routes: HTTP requests
- Coupon API → Express API: HTTP requests
