# m3lfx/itcp318-ns-2026 architecture

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

- Interactive diagram: https://gitdiagram.com/m3lfx/itcp318-ns-2026
- Repository: https://github.com/m3lfx/itcp318-ns-2026

## Overview

ShopIT is a full-stack ecommerce application. Shoppers browse and inspect products, manage a cart, proceed through shipping and payment, and view orders; account and administration routes provide profile, catalog, order, user, and review management. The frontend is a routed React application, while an Express API dispatches product, authentication, and order requests to controllers and Mongo-backed models. The README is empty, so capabilities come from the route map and sampled source; frontend API-to-backend wiring is not asserted where it was not shown.

Main entry points: [`frontend/src/App.jsx`](https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/App.jsx) (React Routes), [`backend/controllers/auth.js`](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/controllers/auth.js) (Auth Controller), [`backend/app.js`](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/app.js) (API Router), [`backend/controllers/product.js`](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/controllers/product.js) (Product Controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["React Routes<br/>[App.jsx]"]
  node_home["Product Browse<br/>[Home.jsx]"]
  node_product_detail["Product Detail<br/>[ProductDetails.jsx]"]
end

subgraph group_checkout["Checkout &amp; Accounts"]
  node_cart["Cart<br/>[Cart.jsx]"]
  node_shipping["Shipping<br/>[Shipping.jsx]"]
  node_confirm["Order Confirmation<br/>[ConfirmOrder.jsx]"]
  node_payment["Payment<br/>[Payment.jsx]"]
  node_order_views["Order Views<br/>[ListOrders.jsx]"]
  node_account["Account<br/>[Register.jsx]"]
end

subgraph group_admin["Administration"]
  node_admin_dashboard["Sales Dashboard<br/>[Dashboard.jsx]"]
  node_admin_catalog["Catalog Admin<br/>[NewProduct.jsx]"]
  node_admin_orders["Order Admin<br/>[OrdersList.jsx]"]
  node_admin_users["User Admin<br/>[UsersList.jsx]"]
  node_admin_reviews["Review Admin<br/>[ProductReviews.jsx]"]
end

subgraph group_api["Backend API"]
  node_server["API Server<br/>[server.js]"]
  node_express_app["API Router<br/>[app.js]"]
  node_auth_routes["Auth Routes<br/>[auth.js]"]
  node_auth_controller["Auth Controller<br/>[auth.js]"]
  node_auth_middleware["Access Control<br/>[auth.js]"]
  node_user_model[("User Model<br/>[user.js]")]
  node_product_routes["Product Routes<br/>[product.js]"]
  node_product_controller["Product Controller<br/>[product.js]"]
  node_product_model[("Product Model<br/>[product.js]")]
  node_order_routes["Order Routes<br/>[order.js]"]
  node_order_controller["Order Controller<br/>[order.js]"]
  node_order_model[("Order Model<br/>[order.js]")]
  node_db_config["Database Connection<br/>[database.js]"]
  node_send_email["Email Utility<br/>[sendEmail.js]"]
  node_jwt_util["Token Utility<br/>[jwtToken.js]"]
  node_api_features["Product Query Features<br/>[apiFeatures.js]"]
end

node_shopper(("Shopper"))
node_mongo[("MongoDB")]
node_cloudinary["Cloudinary"]
node_email["Email Service"]

node_shopper -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_product_detail
node_app -->|"routes to"| node_cart
node_app -->|"routes to"| node_shipping
node_app -->|"routes to"| node_confirm
node_app -->|"routes to"| node_payment
node_app -->|"routes to"| node_order_views
node_app -->|"routes to"| node_account
node_app -->|"routes to"| node_admin_dashboard
node_app -->|"routes to"| node_admin_catalog
node_app -->|"routes to"| node_admin_orders
node_app -->|"routes to"| node_admin_users
node_app -->|"routes to"| node_admin_reviews
node_server -->|"starts"| node_express_app
node_server -->|"connects"| node_db_config
node_db_config -->|"connects"| node_mongo
node_express_app -->|"mounts"| node_product_routes
node_express_app -->|"mounts"| node_auth_routes
node_express_app -->|"mounts"| node_order_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_routes -->|"guards"| node_auth_middleware
node_auth_controller -->|"reads and writes"| node_user_model
node_auth_middleware -->|"loads user"| node_user_model
node_auth_controller -->|"sends reset email"| node_send_email
node_send_email -->|"delivers"| node_email
node_auth_controller -->|"issues token"| node_jwt_util
node_auth_controller -->|"uploads avatar"| node_cloudinary
node_product_routes -->|"dispatches"| node_product_controller
node_product_routes -->|"guards"| node_auth_middleware
node_product_controller -->|"reads and writes"| node_product_model
node_product_controller -->|"reads sales data"| node_order_model
node_product_controller -->|"uses query features"| node_api_features
node_order_routes -->|"dispatches"| node_order_controller
node_order_routes -->|"guards"| node_auth_middleware
node_order_controller -->|"reads and writes"| node_order_model
node_order_controller -->|"updates stock"| node_product_model

click node_app "https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/App.jsx"
click node_home "https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Home.jsx"
click node_product_detail "https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Product/ProductDetails.jsx"
click node_cart "https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Cart/Cart.jsx"
click node_shipping "https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Cart/Shipping.jsx"
click node_confirm "https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Cart/ConfirmOrder.jsx"
click node_payment "https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Cart/Payment.jsx"
click node_order_views "https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Order/ListOrders.jsx"
click node_account "https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/User/Register.jsx"
click node_admin_dashboard "https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Admin/Dashboard.jsx"
click node_admin_catalog "https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Admin/NewProduct.jsx"
click node_admin_orders "https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Admin/OrdersList.jsx"
click node_admin_users "https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Admin/UsersList.jsx"
click node_admin_reviews "https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Admin/ProductReviews.jsx"
click node_server "https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/server.js"
click node_express_app "https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/app.js"
click node_auth_routes "https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/routes/auth.js"
click node_auth_controller "https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/controllers/auth.js"
click node_auth_middleware "https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/middleware/auth.js"
click node_user_model "https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/models/user.js"
click node_product_routes "https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/routes/product.js"
click node_product_controller "https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/controllers/product.js"
click node_product_model "https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/models/product.js"
click node_order_routes "https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/routes/order.js"
click node_order_controller "https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/controllers/order.js"
click node_order_model "https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/models/order.js"
click node_db_config "https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/config/database.js"
click node_send_email "https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/utils/sendEmail.js"
click node_jwt_util "https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/utils/jwtToken.js"
click node_api_features "https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/utils/apiFeatures.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_product_detail toneBlue
class node_cart,node_shipping,node_confirm,node_payment,node_order_views,node_account,node_mongo toneAmber
class node_admin_dashboard,node_admin_catalog,node_admin_orders,node_admin_users,node_admin_reviews toneMint
class node_server,node_express_app,node_auth_routes,node_auth_controller,node_auth_middleware,node_user_model,node_product_routes,node_product_controller,node_product_model,node_order_routes,node_order_controller,node_order_model,node_db_config,node_send_email,node_jwt_util,node_api_features toneRose
class node_shopper,node_cloudinary,node_email toneIndigo
```

## Components

### Storefront

- [React Routes](https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Product Browse](https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Home.jsx): `frontend/src/Components/Home.jsx`
- [Product Detail](https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Product/ProductDetails.jsx): `frontend/src/Components/Product/ProductDetails.jsx`

### Checkout & Accounts

- [Cart](https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Cart/Cart.jsx): `frontend/src/Components/Cart/Cart.jsx`
- [Shipping](https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Cart/Shipping.jsx): `frontend/src/Components/Cart/Shipping.jsx`
- [Order Confirmation](https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Cart/ConfirmOrder.jsx): `frontend/src/Components/Cart/ConfirmOrder.jsx`
- [Payment](https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Cart/Payment.jsx): `frontend/src/Components/Cart/Payment.jsx`
- [Order Views](https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Order/ListOrders.jsx): `frontend/src/Components/Order/ListOrders.jsx`
- [Account](https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/User/Register.jsx): `frontend/src/Components/User/Register.jsx`

### Administration

- [Sales Dashboard](https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Admin/Dashboard.jsx): `frontend/src/Components/Admin/Dashboard.jsx`
- [Catalog Admin](https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Admin/NewProduct.jsx): `frontend/src/Components/Admin/NewProduct.jsx`
- [Order Admin](https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Admin/OrdersList.jsx): `frontend/src/Components/Admin/OrdersList.jsx`
- [User Admin](https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Admin/UsersList.jsx): `frontend/src/Components/Admin/UsersList.jsx`
- [Review Admin](https://github.com/m3lfx/itcp318-ns-2026/blob/master/frontend/src/Components/Admin/ProductReviews.jsx): `frontend/src/Components/Admin/ProductReviews.jsx`

### Backend API

- [API Server](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/server.js): `backend/server.js`
- [API Router](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/app.js): `backend/app.js`
- [Auth Routes](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/routes/auth.js): `backend/routes/auth.js`
- [Auth Controller](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/controllers/auth.js): `backend/controllers/auth.js`
- [Access Control](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/middleware/auth.js): `backend/middleware/auth.js`
- [User Model](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/models/user.js): `backend/models/user.js`
- [Product Routes](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/routes/product.js): `backend/routes/product.js`
- [Product Controller](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/controllers/product.js): `backend/controllers/product.js`
- [Product Model](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/models/product.js): `backend/models/product.js`
- [Order Routes](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/routes/order.js): `backend/routes/order.js`
- [Order Controller](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/controllers/order.js): `backend/controllers/order.js`
- [Order Model](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/models/order.js): `backend/models/order.js`
- [Database Connection](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/config/database.js): `backend/config/database.js`
- [Email Utility](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/utils/sendEmail.js): `backend/utils/sendEmail.js`
- [Token Utility](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/utils/jwtToken.js): `backend/utils/jwtToken.js`
- [Product Query Features](https://github.com/m3lfx/itcp318-ns-2026/blob/master/backend/utils/apiFeatures.js): `backend/utils/apiFeatures.js`

### Other components

- **Shopper**
- **MongoDB**
- **Cloudinary**
- **Email Service**

## Connections

- Shopper → React Routes: opens
- React Routes → Product Browse: routes to (evidence: `frontend/src/App.jsx`)
- React Routes → Product Detail: routes to (evidence: `frontend/src/App.jsx`)
- React Routes → Cart: routes to (evidence: `frontend/src/App.jsx`)
- React Routes → Shipping: routes to (evidence: `frontend/src/App.jsx`)
- React Routes → Order Confirmation: routes to (evidence: `frontend/src/App.jsx`)
- React Routes → Payment: routes to (evidence: `frontend/src/App.jsx`)
- React Routes → Order Views: routes to (evidence: `frontend/src/App.jsx`)
- React Routes → Account: routes to (evidence: `frontend/src/App.jsx`)
- React Routes → Sales Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- React Routes → Catalog Admin: routes to (evidence: `frontend/src/App.jsx`)
- React Routes → Order Admin: routes to (evidence: `frontend/src/App.jsx`)
- React Routes → User Admin: routes to (evidence: `frontend/src/App.jsx`)
- React Routes → Review Admin: routes to (evidence: `frontend/src/App.jsx`)
- API Server → API Router: starts (evidence: `backend/server.js`)
- API Server → Database Connection: connects (evidence: `backend/server.js`)
- Database Connection → MongoDB: connects (evidence: `backend/config/database.js`)
- API Router → Product Routes: mounts (evidence: `backend/app.js`)
- API Router → Auth Routes: mounts (evidence: `backend/app.js`)
- API Router → Order Routes: mounts (evidence: `backend/app.js`)
- Auth Routes → Auth Controller: dispatches (evidence: `backend/routes/auth.js`)
- Auth Routes → Access Control: guards (evidence: `backend/routes/auth.js`)
- Auth Controller → User Model: reads and writes (evidence: `backend/controllers/auth.js`)
- Access Control → User Model: loads user (evidence: `backend/middleware/auth.js`)
- Auth Controller → Email Utility: sends reset email (evidence: `backend/controllers/auth.js`)
- Email Utility → Email Service: delivers (evidence: `backend/utils/sendEmail.js`)
- Auth Controller → Token Utility: issues token (evidence: `backend/controllers/auth.js`)
- Auth Controller → Cloudinary: uploads avatar (evidence: `backend/controllers/auth.js`)
- Product Routes → Product Controller: dispatches (evidence: `backend/routes/product.js`)
- Product Routes → Access Control: guards (evidence: `backend/routes/product.js`)
- Product Controller → Product Model: reads and writes (evidence: `backend/controllers/product.js`)
- Product Controller → Order Model: reads sales data (evidence: `backend/controllers/product.js`)
- Product Controller → Product Query Features: uses query features (evidence: `backend/controllers/product.js`)
- Order Routes → Order Controller: dispatches (evidence: `backend/routes/order.js`)
- Order Routes → Access Control: guards (evidence: `backend/routes/order.js`)
- Order Controller → Order Model: reads and writes (evidence: `backend/controllers/order.js`)
- Order Controller → Product Model: updates stock (evidence: `backend/controllers/order.js`)
