# muhammad-umer34/web_project architecture

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

- Interactive diagram: https://gitdiagram.com/muhammad-umer34/web_project
- Repository: https://github.com/muhammad-umer34/web_project

## Overview

This is a multi-vendor ecommerce application: customers browse products, manage carts and wishlists, place orders, and review purchases; store owners manage listings, orders, dispatch, and sales dashboards. The frontend routes users to these experiences, while Express routes apply authentication and delegate requests to controllers that read and write MongoDB models. The source excerpts establish server-side calls and frontend routing, but do not show the API client request implementations, so those links are omitted.

Main entry points: [`src/main.jsx`](https://github.com/muhammad-umer34/web_project/blob/main/src/main.jsx) (App routing), [`server/controllers/customerController.js`](https://github.com/muhammad-umer34/web_project/blob/main/server/controllers/customerController.js) (Customer controller), [`server/controllers/storeController.js`](https://github.com/muhammad-umer34/web_project/blob/main/server/controllers/storeController.js) (Store controller), [`server/index.js`](https://github.com/muhammad-umer34/web_project/blob/main/server/index.js) (API server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_web_entry["App routing<br/>[main.jsx]"]
  node_auth_ui["Authentication UI<br/>[authLayout.jsx]"]
  node_auth_state["Auth state<br/>[authSlices.js]"]
  node_auth_client["Auth API client<br/>[authAPI.js]"]
  node_customer_header["Customer navigation<br/>[header.jsx]"]
end

subgraph group_customer["Customer commerce"]
  node_customer_pages["Shopping pages<br/>[home.jsx]"]
  node_product_detail["Product details"]
  node_customer_api["Customer API client<br/>[customerApi.js]"]
  node_checkout["Checkout<br/>[CheckOut.jsx]"]
  node_order_confirmation["Order confirmation"]
  node_reviews["Product reviews<br/>[review.jsx]"]
end

subgraph group_storefront["Store operations"]
  node_store_pages["Store dashboard<br/>[newDashboard.jsx]"]
  node_store_products["Product management<br/>[newAddProduct.jsx]"]
  node_store_order_detail["Store order details<br/>[orderDetails.jsx]"]
  node_store_api["Store API client<br/>[adminApi.js]"]
end

subgraph group_backend["API and persistence"]
  node_server_entry["API server<br/>[index.js]"]
  node_auth_routes["Auth routes<br/>[authRoutes.js]"]
  node_auth_controller["Auth controller<br/>[authController.js]"]
  node_user_routes["Customer routes<br/>[userRoutes.js]"]
  node_customer_controller["Customer controller"]
  node_store_routes["Store routes<br/>[storeRoutes.js]"]
  node_store_controller["Store controller<br/>[storeController.js]"]
  node_user_model[("User records<br/>[user.js]")]
  node_product_model[("Product records<br/>[store.js]")]
  node_cart_model[("Cart records<br/>[cart.js]")]
  node_wishlist_model[("Wishlist records<br/>[wishlist.js]")]
  node_review_model[("Review records<br/>[review.js]")]
  node_order_model[("Customer orders<br/>[order.js]")]
  node_store_order_model[("Store order lines<br/>[storeOrders.js]")]
end

node_shopper(("Shopper"))
node_owner(("Store owner"))

node_shopper -->|"uses"| node_web_entry
node_owner -->|"uses"| node_web_entry
node_web_entry -->|"routes to"| node_auth_ui
node_web_entry -->|"routes to"| node_customer_pages
node_web_entry -->|"routes to"| node_product_detail
node_web_entry -->|"routes to"| node_checkout
node_web_entry -->|"routes to"| node_order_confirmation
node_web_entry -->|"routes to"| node_store_pages
node_web_entry -->|"routes to"| node_store_products
node_web_entry -->|"routes to"| node_store_order_detail
node_auth_ui -->|"calls"| node_auth_client
node_auth_ui -->|"updates"| node_auth_state
node_customer_header -->|"reads"| node_auth_state
node_store_order_detail -->|"calls"| node_store_api
node_server_entry -->|"mounts"| node_auth_routes
node_server_entry -->|"mounts"| node_user_routes
node_server_entry -->|"mounts"| node_store_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_controller -->|"reads and writes"| node_user_model
node_user_routes -->|"dispatches"| node_customer_controller
node_customer_controller -->|"reads and writes"| node_product_model
node_customer_controller -->|"reads and writes"| node_cart_model
node_customer_controller -->|"uses"| node_wishlist_model
node_customer_controller -->|"reads and writes"| node_review_model
node_customer_controller -->|"updates"| node_user_model
node_customer_controller -->|"creates"| node_order_model
node_customer_controller -->|"creates"| node_store_order_model
node_store_routes -->|"dispatches"| node_store_controller
node_store_controller -->|"reads and writes"| node_product_model
node_store_controller -->|"reads and writes"| node_store_order_model
node_store_controller -->|"reads and updates"| node_order_model
node_store_controller -->|"reads"| node_user_model

click node_web_entry "https://github.com/muhammad-umer34/web_project/blob/main/src/main.jsx"
click node_auth_ui "https://github.com/muhammad-umer34/web_project/blob/main/src/features/auth/authLayout.jsx"
click node_auth_state "https://github.com/muhammad-umer34/web_project/blob/main/src/features/auth/authSlices.js"
click node_auth_client "https://github.com/muhammad-umer34/web_project/blob/main/src/features/auth/authAPI.js"
click node_customer_header "https://github.com/muhammad-umer34/web_project/blob/main/src/components/ui/customer/header.jsx"
click node_customer_pages "https://github.com/muhammad-umer34/web_project/blob/main/src/pages/customers/home.jsx"
click node_product_detail "https://github.com/muhammad-umer34/web_project/blob/main/src/pages/customers/productDetailPage.jsx"
click node_customer_api "https://github.com/muhammad-umer34/web_project/blob/main/src/features/customer/customerApi.js"
click node_checkout "https://github.com/muhammad-umer34/web_project/blob/main/src/pages/customers/CheckOut.jsx"
click node_order_confirmation "https://github.com/muhammad-umer34/web_project/blob/main/src/pages/customers/order-confirmation.jsx"
click node_reviews "https://github.com/muhammad-umer34/web_project/blob/main/src/pages/customers/review.jsx"
click node_store_pages "https://github.com/muhammad-umer34/web_project/blob/main/src/pages/storeOwner/newDashboard.jsx"
click node_store_products "https://github.com/muhammad-umer34/web_project/blob/main/src/pages/storeOwner/newAddProduct.jsx"
click node_store_order_detail "https://github.com/muhammad-umer34/web_project/blob/main/src/pages/storeOwner/orderDetails.jsx"
click node_store_api "https://github.com/muhammad-umer34/web_project/blob/main/src/features/admin/adminApi.js"
click node_server_entry "https://github.com/muhammad-umer34/web_project/blob/main/server/index.js"
click node_auth_routes "https://github.com/muhammad-umer34/web_project/blob/main/server/routes/authRoutes.js"
click node_auth_controller "https://github.com/muhammad-umer34/web_project/blob/main/server/controllers/authController.js"
click node_user_routes "https://github.com/muhammad-umer34/web_project/blob/main/server/routes/userRoutes.js"
click node_customer_controller "https://github.com/muhammad-umer34/web_project/blob/main/server/controllers/customerController.js"
click node_store_routes "https://github.com/muhammad-umer34/web_project/blob/main/server/routes/storeRoutes.js"
click node_store_controller "https://github.com/muhammad-umer34/web_project/blob/main/server/controllers/storeController.js"
click node_user_model "https://github.com/muhammad-umer34/web_project/blob/main/server/models/user.js"
click node_product_model "https://github.com/muhammad-umer34/web_project/blob/main/server/models/store.js"
click node_cart_model "https://github.com/muhammad-umer34/web_project/blob/main/server/models/cart.js"
click node_wishlist_model "https://github.com/muhammad-umer34/web_project/blob/main/server/models/wishlist.js"
click node_review_model "https://github.com/muhammad-umer34/web_project/blob/main/server/models/review.js"
click node_order_model "https://github.com/muhammad-umer34/web_project/blob/main/server/models/order.js"
click node_store_order_model "https://github.com/muhammad-umer34/web_project/blob/main/server/models/storeOrders.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_web_entry,node_auth_ui,node_auth_state,node_auth_client,node_customer_header toneBlue
class node_customer_pages,node_product_detail,node_customer_api,node_checkout,node_order_confirmation,node_reviews toneAmber
class node_store_pages,node_store_products,node_store_order_detail,node_store_api toneMint
class node_server_entry,node_auth_routes,node_auth_controller,node_user_routes,node_customer_controller,node_store_routes,node_store_controller,node_user_model,node_product_model,node_cart_model,node_wishlist_model,node_review_model,node_order_model,node_store_order_model toneRose
class node_shopper,node_owner toneIndigo
```

## Components

### Web application

- [App routing](https://github.com/muhammad-umer34/web_project/blob/main/src/main.jsx): `src/main.jsx`
- [Authentication UI](https://github.com/muhammad-umer34/web_project/blob/main/src/features/auth/authLayout.jsx): `src/features/auth/authLayout.jsx`
- [Auth state](https://github.com/muhammad-umer34/web_project/blob/main/src/features/auth/authSlices.js): `src/features/auth/authSlices.js`
- [Auth API client](https://github.com/muhammad-umer34/web_project/blob/main/src/features/auth/authAPI.js): `src/features/auth/authAPI.js`
- [Customer navigation](https://github.com/muhammad-umer34/web_project/blob/main/src/components/ui/customer/header.jsx): `src/components/ui/customer/header.jsx`

### Customer commerce

- [Shopping pages](https://github.com/muhammad-umer34/web_project/blob/main/src/pages/customers/home.jsx): `src/pages/customers/home.jsx`
- [Product details](https://github.com/muhammad-umer34/web_project/blob/main/src/pages/customers/productDetailPage.jsx): `src/pages/customers/productDetailPage.jsx`
- [Customer API client](https://github.com/muhammad-umer34/web_project/blob/main/src/features/customer/customerApi.js): `src/features/customer/customerApi.js`
- [Checkout](https://github.com/muhammad-umer34/web_project/blob/main/src/pages/customers/CheckOut.jsx): `src/pages/customers/CheckOut.jsx`
- [Order confirmation](https://github.com/muhammad-umer34/web_project/blob/main/src/pages/customers/order-confirmation.jsx): `src/pages/customers/order-confirmation.jsx`
- [Product reviews](https://github.com/muhammad-umer34/web_project/blob/main/src/pages/customers/review.jsx): `src/pages/customers/review.jsx`

### Store operations

- [Store dashboard](https://github.com/muhammad-umer34/web_project/blob/main/src/pages/storeOwner/newDashboard.jsx): `src/pages/storeOwner/newDashboard.jsx`
- [Product management](https://github.com/muhammad-umer34/web_project/blob/main/src/pages/storeOwner/newAddProduct.jsx): `src/pages/storeOwner/newAddProduct.jsx`
- [Store order details](https://github.com/muhammad-umer34/web_project/blob/main/src/pages/storeOwner/orderDetails.jsx): `src/pages/storeOwner/orderDetails.jsx`
- [Store API client](https://github.com/muhammad-umer34/web_project/blob/main/src/features/admin/adminApi.js): `src/features/admin/adminApi.js`

### API and persistence

- [API server](https://github.com/muhammad-umer34/web_project/blob/main/server/index.js): `server/index.js`
- [Auth routes](https://github.com/muhammad-umer34/web_project/blob/main/server/routes/authRoutes.js): `server/routes/authRoutes.js`
- [Auth controller](https://github.com/muhammad-umer34/web_project/blob/main/server/controllers/authController.js): `server/controllers/authController.js`
- [Customer routes](https://github.com/muhammad-umer34/web_project/blob/main/server/routes/userRoutes.js): `server/routes/userRoutes.js`
- [Customer controller](https://github.com/muhammad-umer34/web_project/blob/main/server/controllers/customerController.js): `server/controllers/customerController.js`
- [Store routes](https://github.com/muhammad-umer34/web_project/blob/main/server/routes/storeRoutes.js): `server/routes/storeRoutes.js`
- [Store controller](https://github.com/muhammad-umer34/web_project/blob/main/server/controllers/storeController.js): `server/controllers/storeController.js`
- [User records](https://github.com/muhammad-umer34/web_project/blob/main/server/models/user.js): `server/models/user.js`
- [Product records](https://github.com/muhammad-umer34/web_project/blob/main/server/models/store.js): `server/models/store.js`
- [Cart records](https://github.com/muhammad-umer34/web_project/blob/main/server/models/cart.js): `server/models/cart.js`
- [Wishlist records](https://github.com/muhammad-umer34/web_project/blob/main/server/models/wishlist.js): `server/models/wishlist.js`
- [Review records](https://github.com/muhammad-umer34/web_project/blob/main/server/models/review.js): `server/models/review.js`
- [Customer orders](https://github.com/muhammad-umer34/web_project/blob/main/server/models/order.js): `server/models/order.js`
- [Store order lines](https://github.com/muhammad-umer34/web_project/blob/main/server/models/storeOrders.js): `server/models/storeOrders.js`

### Other components

- **Shopper**
- **Store owner**

## Connections

- Shopper → App routing: uses (evidence: `src/main.jsx`)
- Store owner → App routing: uses (evidence: `src/main.jsx`)
- App routing → Authentication UI: routes to (evidence: `src/main.jsx`)
- App routing → Shopping pages: routes to (evidence: `src/main.jsx`)
- App routing → Product details: routes to (evidence: `src/main.jsx`)
- App routing → Checkout: routes to (evidence: `src/main.jsx`)
- App routing → Order confirmation: routes to (evidence: `src/main.jsx`)
- App routing → Store dashboard: routes to (evidence: `src/main.jsx`)
- App routing → Product management: routes to (evidence: `src/main.jsx`)
- App routing → Store order details: routes to (evidence: `src/main.jsx`)
- Authentication UI → Auth API client: calls (evidence: `src/features/auth/authLayout.jsx`)
- Authentication UI → Auth state: updates (evidence: `src/features/auth/authLayout.jsx`)
- Customer navigation → Auth state: reads (evidence: `src/components/ui/customer/header.jsx`)
- Store order details → Store API client: calls (evidence: `src/pages/storeOwner/orderDetails.jsx`)
- API server → Auth routes: mounts (evidence: `server/index.js`)
- API server → Customer routes: mounts (evidence: `server/index.js`)
- API server → Store routes: mounts (evidence: `server/index.js`)
- Auth routes → Auth controller: dispatches (evidence: `server/routes/authRoutes.js`)
- Auth controller → User records: reads and writes (evidence: `server/controllers/authController.js`)
- Customer routes → Customer controller: dispatches (evidence: `server/routes/userRoutes.js`)
- Customer controller → Product records: reads and writes (evidence: `server/controllers/customerController.js`)
- Customer controller → Cart records: reads and writes (evidence: `server/controllers/customerController.js`)
- Customer controller → Wishlist records: uses (evidence: `server/controllers/customerController.js`)
- Customer controller → Review records: reads and writes (evidence: `server/controllers/customerController.js`)
- Customer controller → User records: updates (evidence: `server/controllers/customerController.js`)
- Customer controller → Customer orders: creates (evidence: `server/controllers/customerController.js`)
- Customer controller → Store order lines: creates (evidence: `server/controllers/customerController.js`)
- Store routes → Store controller: dispatches (evidence: `server/routes/storeRoutes.js`)
- Store controller → Product records: reads and writes (evidence: `server/controllers/storeController.js`)
- Store controller → Store order lines: reads and writes (evidence: `server/controllers/storeController.js`)
- Store controller → Customer orders: reads and updates (evidence: `server/controllers/storeController.js`)
- Store controller → User records: reads (evidence: `server/controllers/storeController.js`)
