# shiwani2006/e-commerce-shopping-website architecture

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

- Interactive diagram: https://gitdiagram.com/shiwani2006/e-commerce-shopping-website
- Repository: https://github.com/shiwani2006/e-commerce-shopping-website

## Overview

ShopSphere is a multi-vendor marketplace: customers discover products, manage carts and wishlists, place orders, and handle payments; vendors manage shops and products; administrators oversee marketplace operations. The tree also includes reviews, rewards, coupons, analytics, and support features. The graph shows sampled routing, state, controller, and model relationships. Many feature pages and backend routes are listed but unsampled, and the README gives no further architecture details, so their connections are not inferred.

Main entry points: [`routes/AppRoutes.jsx`](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/routes/AppRoutes.jsx) (App routes), [`controllers/vendor.controller.js`](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/controllers/vendor.controller.js) (Vendor operations), [`pages/public/Home.jsx`](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/pages/public/Home.jsx) (Marketplace home), [`controllers/review.controller.js`](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/controllers/review.controller.js) (Review service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app_routes["App routes<br/>[AppRoutes.jsx]"]
  node_home["Marketplace home<br/>[Home.jsx]"]
  node_admin_ui["Admin console<br/>[AdminDashboard.jsx]"]
end

subgraph group_customer["Customer commerce"]
  node_ai_assistant["AI assistant<br/>[AIAssistant.jsx]"]
  node_customer_dashboard["Customer dashboard"]
  node_customer_profile["Customer profile"]
  node_customer_orders["Customer orders<br/>[Orders.jsx]"]
  node_customer_payments["Customer payments<br/>[Payments.jsx]"]
  node_cart_state["Cart state<br/>[CartContext.jsx]"]
  node_wishlist_state["Wishlist state"]
  node_wishlist_api["Wishlist API client<br/>[wishlistApi.js]"]
  node_payments_api["Payments API client<br/>[paymentsApi.js]"]
  node_security_api["Security API client<br/>[securityApi.js]"]
  node_product_api["Product API client<br/>[productApi.js]"]
end

subgraph group_operations["Marketplace operations"]
  node_admin_controller["Admin operations"]
  node_vendor_controller["Vendor operations"]
end

subgraph group_server["API services"]
  node_review_routes["Review endpoints<br/>[review.routes.js]"]
  node_review_controller["Review service"]
  node_product_routes["Product endpoints<br/>[product.routes.js]"]
  node_product_controller["Product service"]
  node_vendor_routes["Vendor endpoints<br/>[vendor.routes.js]"]
  node_auth_middleware["Token authentication<br/>[auth.middleware.js]"]
  node_order_controller["Order service"]
end

subgraph group_data["Marketplace data"]
  node_review_store[("Review records<br/>[Review.model.js]")]
  node_product_store[("Product records<br/>[Product.model.js]")]
  node_order_store[("Order records<br/>[Order.model.js]")]
  node_user_store[("User records<br/>[User.model.js]")]
  node_vendor_store[("Vendor records<br/>[Vendor.model.js]")]
end

node_shopper(("Shopper"))

node_shopper -->|"opens"| node_app_routes
node_app_routes -->|"routes to"| node_home
node_app_routes -->|"routes to"| node_admin_ui
node_app_routes -->|"routes to"| node_ai_assistant
node_app_routes -->|"routes to"| node_customer_dashboard
node_app_routes -->|"routes to"| node_customer_profile
node_app_routes -->|"routes to"| node_customer_orders
node_app_routes -->|"routes to"| node_customer_payments
node_home -->|"uses"| node_cart_state
node_home -->|"uses"| node_wishlist_state
node_home -->|"requests products"| node_product_api
node_customer_profile -->|"uses"| node_wishlist_state
node_customer_profile -->|"requests wishlist"| node_wishlist_api
node_customer_payments -->|"requests payments"| node_payments_api
node_customer_payments -->|"requests security"| node_security_api
node_review_routes -->|"authenticates"| node_auth_middleware
node_review_routes -->|"dispatches"| node_review_controller
node_product_routes -->|"dispatches"| node_product_controller
node_vendor_routes -->|"dispatches"| node_vendor_controller
node_review_controller -->|"reads and writes"| node_review_store
node_review_controller -->|"updates ratings"| node_product_store
node_review_controller -->|"checks purchases"| node_order_store
node_product_controller -->|"reads and writes"| node_product_store
node_order_controller -->|"reads and writes"| node_order_store
node_admin_controller -->|"reads and writes"| node_user_store
node_admin_controller -->|"reads and writes"| node_order_store
node_admin_controller -->|"reads and writes"| node_product_store
node_vendor_controller -->|"reads and writes"| node_user_store
node_vendor_controller -->|"reads and writes"| node_vendor_store
node_vendor_controller -->|"queries products"| node_product_store
node_vendor_controller -->|"queries orders"| node_order_store

click node_app_routes "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/routes/AppRoutes.jsx"
click node_home "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/pages/public/Home.jsx"
click node_admin_ui "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/pages/admin/AdminDashboard.jsx"
click node_ai_assistant "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/pages/customer/AIAssistant.jsx"
click node_customer_dashboard "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/pages/customer/CustomerDashboard.jsx"
click node_customer_profile "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/pages/customer/CustomerProfile.jsx"
click node_customer_orders "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/pages/customer/Orders.jsx"
click node_customer_payments "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/pages/customer/Payments.jsx"
click node_cart_state "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/context/CartContext.jsx"
click node_wishlist_state "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/context/WishlistContext.jsx"
click node_wishlist_api "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/api/wishlistApi.js"
click node_payments_api "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/api/paymentsApi.js"
click node_security_api "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/api/securityApi.js"
click node_product_api "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/api/productApi.js"
click node_admin_controller "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/controllers/admin.controller.js"
click node_vendor_controller "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/controllers/vendor.controller.js"
click node_review_routes "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/routes/review.routes.js"
click node_review_controller "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/controllers/review.controller.js"
click node_product_routes "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/routes/product.routes.js"
click node_product_controller "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/controllers/product.controller.js"
click node_vendor_routes "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/routes/vendor.routes.js"
click node_auth_middleware "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/middlewares/auth.middleware.js"
click node_order_controller "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/controllers/order.controller.js"
click node_review_store "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/models/Review.model.js"
click node_product_store "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/models/Product.model.js"
click node_order_store "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/models/Order.model.js"
click node_user_store "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/models/User.model.js"
click node_vendor_store "https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/models/Vendor.model.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_routes,node_home,node_admin_ui toneBlue
class node_ai_assistant,node_customer_dashboard,node_customer_profile,node_customer_orders,node_customer_payments,node_cart_state,node_wishlist_state,node_wishlist_api,node_payments_api,node_security_api,node_product_api toneAmber
class node_admin_controller,node_vendor_controller toneMint
class node_review_routes,node_review_controller,node_product_routes,node_product_controller,node_vendor_routes,node_auth_middleware,node_order_controller toneRose
class node_review_store,node_product_store,node_order_store,node_user_store,node_vendor_store,node_shopper toneIndigo
```

## Components

### Web experience

- [App routes](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/routes/AppRoutes.jsx): `routes/AppRoutes.jsx`
- [Marketplace home](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/pages/public/Home.jsx): `pages/public/Home.jsx`
- [Admin console](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/pages/admin/AdminDashboard.jsx): `pages/admin/AdminDashboard.jsx`

### Customer commerce

- [AI assistant](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/pages/customer/AIAssistant.jsx): `pages/customer/AIAssistant.jsx`
- [Customer dashboard](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/pages/customer/CustomerDashboard.jsx): `pages/customer/CustomerDashboard.jsx`
- [Customer profile](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/pages/customer/CustomerProfile.jsx): `pages/customer/CustomerProfile.jsx`
- [Customer orders](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/pages/customer/Orders.jsx): `pages/customer/Orders.jsx`
- [Customer payments](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/pages/customer/Payments.jsx): `pages/customer/Payments.jsx`
- [Cart state](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/context/CartContext.jsx): `context/CartContext.jsx`
- [Wishlist state](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/context/WishlistContext.jsx): `context/WishlistContext.jsx`
- [Wishlist API client](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/api/wishlistApi.js): `api/wishlistApi.js`
- [Payments API client](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/api/paymentsApi.js): `api/paymentsApi.js`
- [Security API client](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/api/securityApi.js): `api/securityApi.js`
- [Product API client](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/api/productApi.js): `api/productApi.js`

### Marketplace operations

- [Admin operations](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/controllers/admin.controller.js): `controllers/admin.controller.js`
- [Vendor operations](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/controllers/vendor.controller.js): `controllers/vendor.controller.js`

### API services

- [Review endpoints](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/routes/review.routes.js): `routes/review.routes.js`
- [Review service](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/controllers/review.controller.js): `controllers/review.controller.js`
- [Product endpoints](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/routes/product.routes.js): `routes/product.routes.js`
- [Product service](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/controllers/product.controller.js): `controllers/product.controller.js`
- [Vendor endpoints](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/routes/vendor.routes.js): `routes/vendor.routes.js`
- [Token authentication](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/middlewares/auth.middleware.js): `middlewares/auth.middleware.js`
- [Order service](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/controllers/order.controller.js): `controllers/order.controller.js`

### Marketplace data

- [Review records](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/models/Review.model.js): `models/Review.model.js`
- [Product records](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/models/Product.model.js): `models/Product.model.js`
- [Order records](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/models/Order.model.js): `models/Order.model.js`
- [User records](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/models/User.model.js): `models/User.model.js`
- [Vendor records](https://github.com/shiwani2006/e-commerce-shopping-website/blob/main/models/Vendor.model.js): `models/Vendor.model.js`

### Other components

- **Shopper**

## Connections

- Shopper → App routes: opens (evidence: `routes/AppRoutes.jsx`)
- App routes → Marketplace home: routes to (evidence: `routes/AppRoutes.jsx`)
- App routes → Admin console: routes to (evidence: `routes/AppRoutes.jsx`)
- App routes → AI assistant: routes to (evidence: `routes/AppRoutes.jsx`)
- App routes → Customer dashboard: routes to (evidence: `routes/AppRoutes.jsx`)
- App routes → Customer profile: routes to (evidence: `routes/AppRoutes.jsx`)
- App routes → Customer orders: routes to (evidence: `routes/AppRoutes.jsx`)
- App routes → Customer payments: routes to (evidence: `routes/AppRoutes.jsx`)
- Marketplace home → Cart state: uses (evidence: `pages/public/Home.jsx`)
- Marketplace home → Wishlist state: uses (evidence: `pages/public/Home.jsx`)
- Marketplace home → Product API client: requests products (evidence: `pages/public/Home.jsx`)
- Customer profile → Wishlist state: uses (evidence: `pages/customer/CustomerProfile.jsx`)
- Customer profile → Wishlist API client: requests wishlist
- Customer payments → Payments API client: requests payments (evidence: `pages/customer/Payments.jsx`)
- Customer payments → Security API client: requests security (evidence: `pages/customer/Payments.jsx`)
- Review endpoints → Token authentication: authenticates (evidence: `routes/review.routes.js`)
- Review endpoints → Review service: dispatches (evidence: `routes/review.routes.js`)
- Product endpoints → Product service: dispatches (evidence: `routes/product.routes.js`)
- Vendor endpoints → Vendor operations: dispatches (evidence: `routes/vendor.routes.js`)
- Review service → Review records: reads and writes (evidence: `controllers/review.controller.js`)
- Review service → Product records: updates ratings (evidence: `controllers/review.controller.js`)
- Review service → Order records: checks purchases (evidence: `controllers/review.controller.js`)
- Product service → Product records: reads and writes (evidence: `controllers/product.controller.js`)
- Order service → Order records: reads and writes (evidence: `controllers/order.controller.js`)
- Admin operations → User records: reads and writes (evidence: `controllers/admin.controller.js`)
- Admin operations → Order records: reads and writes (evidence: `controllers/admin.controller.js`)
- Admin operations → Product records: reads and writes (evidence: `controllers/admin.controller.js`)
- Vendor operations → User records: reads and writes (evidence: `controllers/vendor.controller.js`)
- Vendor operations → Vendor records: reads and writes (evidence: `controllers/vendor.controller.js`)
- Vendor operations → Product records: queries products (evidence: `controllers/vendor.controller.js`)
- Vendor operations → Order records: queries orders (evidence: `controllers/vendor.controller.js`)
