# alsonma/shopzone architecture

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

- Interactive diagram: https://gitdiagram.com/alsonma/shopzone
- Repository: https://github.com/alsonma/shopzone

## Overview

ShopZone is a marketplace with customer shopping, seller storefront and catalog management, and admin operations. A customer browses or searches products, views details, manages a cart and checkout, then tracks orders; account, address, wishlist, and review features support that journey. Sellers create stores and products and review sales analytics, while administrators manage marketplace activity. The graph separates frontend routing, API transport, backend request handling, and domain data. Several backend routes and frontend pages are unsampled, so their internal interactions are not inferred.

Main entry points: [`frontend/src/App.jsx`](https://github.com/alsonma/shopzone/blob/main/frontend/src/App.jsx) (App Router), [`backend/server.js`](https://github.com/alsonma/shopzone/blob/main/backend/server.js) (HTTP API Server), [`backend/src/controller/admin.controller.js`](https://github.com/alsonma/shopzone/blob/main/backend/src/controller/admin.controller.js) (Admin Operations), [`backend/src/controller/product.controller.js`](https://github.com/alsonma/shopzone/blob/main/backend/src/controller/product.controller.js) (Product Catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Customer and Seller UI"]
  node_app["App Router<br/>[App.jsx]"]
  node_home["Product Discovery<br/>[Home.jsx]"]
  node_search["Search Results<br/>[SearchResults.jsx]"]
  node_details["Product Details<br/>[ProductDetails.jsx]"]
  node_cart["Shopping Cart<br/>[Cart.jsx]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_payment["Payment<br/>[Payment.jsx]"]
  node_orders["Order History<br/>[MyOrders.jsx]"]
  node_customer["Customer Account"]
  node_addresses["Customer Addresses"]
  node_customerorders["Customer Orders<br/>[CustomerOrders.jsx]"]
  node_wishlist["Wishlist<br/>[Wishlist.jsx]"]
  node_seller["Seller Dashboard"]
  node_store["Store Setup<br/>[CreateStore.jsx]"]
  node_addproduct["Product Entry<br/>[AddProduct.jsx]"]
  node_authui["Sign-in and Signup<br/>[Login.jsx]"]
end

subgraph group_transport["API Transport"]
  node_api["API Client<br/>[axios.js]"]
end

subgraph group_backend["Backend Services"]
  node_server["HTTP API Server<br/>[server.js]"]
  node_auth["Authentication<br/>[auth.controller.js]"]
  node_catalog["Product Catalog"]
  node_cartservice["Cart Operations<br/>[cart.controller.js]"]
  node_customerops["Customer Operations"]
  node_reviewops["Reviews"]
  node_orderops["Order Processing"]
  node_storeops["Store Management"]
end

subgraph group_data["Marketplace Data"]
  node_userdb[("User Records<br/>[user.model.js]")]
  node_productdb[("Product Records<br/>[product.model.js]")]
  node_cartdb[("Cart Records<br/>[cart.model.js]")]
  node_orderdb[("Order Records<br/>[order.model.js]")]
  node_reviewdb[("Review Records<br/>[review.model.js]")]
  node_storedb[("Store Records<br/>[store.model.js]")]
end

subgraph group_admin["Administration"]
  node_adminops["Admin Operations"]
end

node_shopper(("Shopper"))

node_shopper -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_search
node_app -->|"routes to"| node_details
node_app -->|"routes to"| node_cart
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_payment
node_app -->|"routes to"| node_orders
node_app -->|"routes to"| node_customer
node_app -->|"routes to"| node_addresses
node_app -->|"routes to"| node_customerorders
node_app -->|"routes to"| node_wishlist
node_app -->|"routes to"| node_seller
node_app -->|"routes to"| node_store
node_app -->|"routes to"| node_authui
node_search -->|"requests products"| node_api
node_api -->|"sends API requests"| node_server
node_server -->|"mounts routes"| node_catalog
node_server -->|"mounts routes"| node_auth
node_server -->|"mounts routes"| node_cartservice
node_server -->|"mounts routes"| node_customerops
node_server -->|"mounts routes"| node_orderops
node_server -->|"mounts routes"| node_reviewops
node_server -->|"mounts routes"| node_storeops
node_server -->|"mounts routes"| node_adminops
node_auth -->|"reads and writes"| node_userdb
node_catalog -->|"reads and writes"| node_productdb
node_catalog -->|"reads"| node_storedb
node_catalog -->|"aggregates ratings"| node_reviewdb
node_catalog -->|"reads sales"| node_orderdb
node_cartservice -->|"reads and writes"| node_cartdb
node_cartservice -->|"reads"| node_productdb
node_customerops -->|"reads and writes"| node_userdb
node_customerops -->|"reads"| node_productdb
node_customerops -->|"reads"| node_orderdb
node_reviewops -->|"reads and writes"| node_reviewdb
node_reviewops -->|"checks products"| node_productdb
node_reviewops -->|"checks delivery"| node_orderdb
node_orderops -.->|"manages"| node_orderdb
node_storeops -.->|"manages"| node_storedb
node_adminops -->|"manages"| node_storedb
node_adminops -->|"manages"| node_productdb
node_adminops -->|"manages"| node_orderdb
node_adminops -->|"manages"| node_userdb
node_adminops -->|"manages"| node_cartdb
node_adminops -->|"manages"| node_reviewdb

click node_app "https://github.com/alsonma/shopzone/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/Home/Home.jsx"
click node_search "https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/SearchResults/SearchResults.jsx"
click node_details "https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/ProductDetails/ProductDetails.jsx"
click node_cart "https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/Cart/Cart.jsx"
click node_checkout "https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/Checkout/Checkout.jsx"
click node_payment "https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/Payment/Payment.jsx"
click node_orders "https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/MyOrders/MyOrders.jsx"
click node_addresses "https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/CustomerAddresses/CustomerAddresses.jsx"
click node_customerorders "https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/CustomerOrders/CustomerOrders.jsx"
click node_wishlist "https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/Wishlist/Wishlist.jsx"
click node_seller "https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/SellerDashboard/SellerDashboard.jsx"
click node_store "https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/CreateStore/CreateStore.jsx"
click node_addproduct "https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/AddProducts/AddProduct.jsx"
click node_authui "https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/Login/Login.jsx"
click node_api "https://github.com/alsonma/shopzone/blob/main/frontend/src/api/axios.js"
click node_server "https://github.com/alsonma/shopzone/blob/main/backend/server.js"
click node_auth "https://github.com/alsonma/shopzone/blob/main/backend/src/controller/auth.controller.js"
click node_catalog "https://github.com/alsonma/shopzone/blob/main/backend/src/controller/product.controller.js"
click node_cartservice "https://github.com/alsonma/shopzone/blob/main/backend/src/controller/cart.controller.js"
click node_customerops "https://github.com/alsonma/shopzone/blob/main/backend/src/controller/customer.controller.js"
click node_reviewops "https://github.com/alsonma/shopzone/blob/main/backend/src/controller/review.controller.js"
click node_orderops "https://github.com/alsonma/shopzone/blob/main/backend/src/controller/order.controller.js"
click node_storeops "https://github.com/alsonma/shopzone/blob/main/backend/src/controller/store.controller.js"
click node_adminops "https://github.com/alsonma/shopzone/blob/main/backend/src/controller/admin.controller.js"
click node_userdb "https://github.com/alsonma/shopzone/blob/main/backend/src/model/user.model.js"
click node_productdb "https://github.com/alsonma/shopzone/blob/main/backend/src/model/product.model.js"
click node_cartdb "https://github.com/alsonma/shopzone/blob/main/backend/src/model/cart.model.js"
click node_orderdb "https://github.com/alsonma/shopzone/blob/main/backend/src/model/order.model.js"
click node_reviewdb "https://github.com/alsonma/shopzone/blob/main/backend/src/model/review.model.js"
click node_storedb "https://github.com/alsonma/shopzone/blob/main/backend/src/model/store.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,node_home,node_search,node_details,node_cart,node_checkout,node_payment,node_orders,node_customer,node_addresses,node_customerorders,node_wishlist,node_seller,node_store,node_addproduct,node_authui toneBlue
class node_api toneAmber
class node_server,node_auth,node_catalog,node_cartservice,node_customerops,node_reviewops,node_orderops,node_storeops toneMint
class node_userdb,node_productdb,node_cartdb,node_orderdb,node_reviewdb,node_storedb toneRose
class node_adminops,node_shopper toneIndigo
```

## Components

### Customer and Seller UI

- [App Router](https://github.com/alsonma/shopzone/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Product Discovery](https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/Home/Home.jsx): `frontend/src/pages/Home/Home.jsx`
- [Search Results](https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/SearchResults/SearchResults.jsx): `frontend/src/pages/SearchResults/SearchResults.jsx`
- [Product Details](https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/ProductDetails/ProductDetails.jsx): `frontend/src/pages/ProductDetails/ProductDetails.jsx`
- [Shopping Cart](https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/Cart/Cart.jsx): `frontend/src/pages/Cart/Cart.jsx`
- [Checkout](https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/Checkout/Checkout.jsx): `frontend/src/pages/Checkout/Checkout.jsx`
- [Payment](https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/Payment/Payment.jsx): `frontend/src/pages/Payment/Payment.jsx`
- [Order History](https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/MyOrders/MyOrders.jsx): `frontend/src/pages/MyOrders/MyOrders.jsx`
- **Customer Account**
- [Customer Addresses](https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/CustomerAddresses/CustomerAddresses.jsx): `frontend/src/pages/CustomerAddresses/CustomerAddresses.jsx`
- [Customer Orders](https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/CustomerOrders/CustomerOrders.jsx): `frontend/src/pages/CustomerOrders/CustomerOrders.jsx`
- [Wishlist](https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/Wishlist/Wishlist.jsx): `frontend/src/pages/Wishlist/Wishlist.jsx`
- [Seller Dashboard](https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/SellerDashboard/SellerDashboard.jsx): `frontend/src/pages/SellerDashboard/SellerDashboard.jsx`
- [Store Setup](https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/CreateStore/CreateStore.jsx): `frontend/src/pages/CreateStore/CreateStore.jsx`
- [Product Entry](https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/AddProducts/AddProduct.jsx): `frontend/src/pages/AddProducts/AddProduct.jsx`
- [Sign-in and Signup](https://github.com/alsonma/shopzone/blob/main/frontend/src/pages/Login/Login.jsx): `frontend/src/pages/Login/Login.jsx`

### API Transport

- [API Client](https://github.com/alsonma/shopzone/blob/main/frontend/src/api/axios.js): `frontend/src/api/axios.js`

### Backend Services

- [HTTP API Server](https://github.com/alsonma/shopzone/blob/main/backend/server.js): `backend/server.js`
- [Authentication](https://github.com/alsonma/shopzone/blob/main/backend/src/controller/auth.controller.js): `backend/src/controller/auth.controller.js`
- [Product Catalog](https://github.com/alsonma/shopzone/blob/main/backend/src/controller/product.controller.js): `backend/src/controller/product.controller.js`
- [Cart Operations](https://github.com/alsonma/shopzone/blob/main/backend/src/controller/cart.controller.js): `backend/src/controller/cart.controller.js`
- [Customer Operations](https://github.com/alsonma/shopzone/blob/main/backend/src/controller/customer.controller.js): `backend/src/controller/customer.controller.js`
- [Reviews](https://github.com/alsonma/shopzone/blob/main/backend/src/controller/review.controller.js): `backend/src/controller/review.controller.js`
- [Order Processing](https://github.com/alsonma/shopzone/blob/main/backend/src/controller/order.controller.js): `backend/src/controller/order.controller.js`
- [Store Management](https://github.com/alsonma/shopzone/blob/main/backend/src/controller/store.controller.js): `backend/src/controller/store.controller.js`

### Marketplace Data

- [User Records](https://github.com/alsonma/shopzone/blob/main/backend/src/model/user.model.js): `backend/src/model/user.model.js`
- [Product Records](https://github.com/alsonma/shopzone/blob/main/backend/src/model/product.model.js): `backend/src/model/product.model.js`
- [Cart Records](https://github.com/alsonma/shopzone/blob/main/backend/src/model/cart.model.js): `backend/src/model/cart.model.js`
- [Order Records](https://github.com/alsonma/shopzone/blob/main/backend/src/model/order.model.js): `backend/src/model/order.model.js`
- [Review Records](https://github.com/alsonma/shopzone/blob/main/backend/src/model/review.model.js): `backend/src/model/review.model.js`
- [Store Records](https://github.com/alsonma/shopzone/blob/main/backend/src/model/store.model.js): `backend/src/model/store.model.js`

### Administration

- [Admin Operations](https://github.com/alsonma/shopzone/blob/main/backend/src/controller/admin.controller.js): `backend/src/controller/admin.controller.js`

### Other components

- **Shopper**

## Connections

- Shopper → App Router: opens (evidence: `frontend/src/App.jsx`)
- App Router → Product Discovery: routes to (evidence: `frontend/src/App.jsx`)
- App Router → Search Results: routes to (evidence: `frontend/src/App.jsx`)
- App Router → Product Details: routes to (evidence: `frontend/src/App.jsx`)
- App Router → Shopping Cart: routes to (evidence: `frontend/src/App.jsx`)
- App Router → Checkout: routes to (evidence: `frontend/src/App.jsx`)
- App Router → Payment: routes to (evidence: `frontend/src/App.jsx`)
- App Router → Order History: routes to (evidence: `frontend/src/App.jsx`)
- App Router → Customer Account: routes to (evidence: `frontend/src/App.jsx`)
- App Router → Customer Addresses: routes to (evidence: `frontend/src/App.jsx`)
- App Router → Customer Orders: routes to (evidence: `frontend/src/App.jsx`)
- App Router → Wishlist: routes to (evidence: `frontend/src/App.jsx`)
- App Router → Seller Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- App Router → Store Setup: routes to (evidence: `frontend/src/App.jsx`)
- App Router → Sign-in and Signup: routes to (evidence: `frontend/src/App.jsx`)
- Search Results → API Client: requests products (evidence: `frontend/src/pages/SearchResults/SearchResults.jsx`)
- API Client → HTTP API Server: sends API requests
- HTTP API Server → Product Catalog: mounts routes (evidence: `backend/server.js`)
- HTTP API Server → Authentication: mounts routes (evidence: `backend/server.js`)
- HTTP API Server → Cart Operations: mounts routes (evidence: `backend/server.js`)
- HTTP API Server → Customer Operations: mounts routes (evidence: `backend/server.js`)
- HTTP API Server → Order Processing: mounts routes (evidence: `backend/server.js`)
- HTTP API Server → Reviews: mounts routes (evidence: `backend/server.js`)
- HTTP API Server → Store Management: mounts routes (evidence: `backend/server.js`)
- HTTP API Server → Admin Operations: mounts routes (evidence: `backend/server.js`)
- Authentication → User Records: reads and writes (evidence: `backend/src/controller/auth.controller.js`)
- Product Catalog → Product Records: reads and writes (evidence: `backend/src/controller/product.controller.js`)
- Product Catalog → Store Records: reads (evidence: `backend/src/controller/product.controller.js`)
- Product Catalog → Review Records: aggregates ratings (evidence: `backend/src/controller/product.controller.js`)
- Product Catalog → Order Records: reads sales (evidence: `backend/src/controller/product.controller.js`)
- Cart Operations → Cart Records: reads and writes (evidence: `backend/src/controller/cart.controller.js`)
- Cart Operations → Product Records: reads (evidence: `backend/src/controller/cart.controller.js`)
- Customer Operations → User Records: reads and writes (evidence: `backend/src/controller/customer.controller.js`)
- Customer Operations → Product Records: reads (evidence: `backend/src/controller/customer.controller.js`)
- Customer Operations → Order Records: reads (evidence: `backend/src/controller/customer.controller.js`)
- Reviews → Review Records: reads and writes (evidence: `backend/src/controller/review.controller.js`)
- Reviews → Product Records: checks products (evidence: `backend/src/controller/review.controller.js`)
- Reviews → Order Records: checks delivery (evidence: `backend/src/controller/review.controller.js`)
- Order Processing → Order Records: manages
- Store Management → Store Records: manages
- Admin Operations → Store Records: manages (evidence: `backend/src/controller/admin.controller.js`)
- Admin Operations → Product Records: manages (evidence: `backend/src/controller/admin.controller.js`)
- Admin Operations → Order Records: manages (evidence: `backend/src/controller/admin.controller.js`)
- Admin Operations → User Records: manages (evidence: `backend/src/controller/admin.controller.js`)
- Admin Operations → Cart Records: manages (evidence: `backend/src/controller/admin.controller.js`)
- Admin Operations → Review Records: manages (evidence: `backend/src/controller/admin.controller.js`)
