# allencodess/huntleys-website architecture

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

- Interactive diagram: https://gitdiagram.com/allencodess/huntleys-website
- Repository: https://github.com/allencodess/huntleys-website

## Overview

Huntley’s Sauces is a full-stack storefront whose main journey is product discovery, cart management, authenticated shipping and payment, order creation, and order history. Admins additionally manage products, orders, and users; shoppers can contact the business. The graph combines documented capabilities with visible source references. Several route handlers, checkout screens, and integrations were not excerpted, so their links are cited to the README rather than presented as inspected call chains.

Main entry points: [`frontend/src/App.jsx`](https://github.com/allencodess/huntleys-website/blob/main/frontend/src/App.jsx) (Web app routing), [`backend/routes`](https://github.com/allencodess/huntleys-website/tree/main/backend/routes) (API routes), [`backend/models`](https://github.com/allencodess/huntleys-website/tree/main/backend/models) (MongoDB models), [`frontend/src/Screens/ProductDetails.jsx`](https://github.com/allencodess/huntleys-website/blob/main/frontend/src/Screens/ProductDetails.jsx) (Product details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["Web app routing<br/>[App.jsx]"]
  node_catalog["Product browsing<br/>[Products.jsx]"]
  node_product["Product details<br/>[ProductDetails.jsx]"]
  node_productapi["Product API client<br/>[productApiSlice.js]"]
  node_contact["Contact form<br/>[ContactForm.jsx]"]
end

subgraph group_commerce["Commerce"]
  node_cart["Persistent cart<br/>[cartSlice.js]"]
  node_checkout["Checkout steps<br/>[Shipping.jsx]"]
  node_payment["Payment screen<br/>[PaymentScreen.jsx]"]
  node_paypal["PayPal payments"]
  node_orderscreen["Order history<br/>[OrderScreen.jsx]"]
  node_orderapi["Order API client<br/>[ordersApiSlice.js]"]
end

subgraph group_identity["Identity &amp; Admin"]
  node_authscreens["Account screens<br/>[Login.jsx]"]
  node_authstate["Authentication state<br/>[authSlice.js]"]
  node_userapi["User API client<br/>[usersApiSlice.js]"]
  node_admin["Admin dashboard"]
end

subgraph group_platform["Backend Platform"]
  node_server["Express API server<br/>[server.js]"]
  node_routes["API routes"]
  node_products["Product operations"]
  node_users["User operations<br/>[userController.js]"]
  node_orderops["Order operations<br/>[orderController.js]"]
  node_authguard["Authentication guard<br/>[authMiddleware.js]"]
  node_models["MongoDB models"]
  node_upload["Image upload<br/>[uploadRoutes.js]"]
end

node_shopper(("Shopper"))
node_mongo[("MongoDB")]
node_cloudinary["Cloudinary"]
node_email["Transactional email"]

node_shopper -->|"visits"| node_app
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_product
node_product -->|"requests products"| node_productapi
node_product -->|"adds items"| node_cart
node_shopper -->|"manages items"| node_cart
node_app -->|"routes to"| node_checkout
node_checkout -->|"continues checkout"| node_payment
node_payment -->|"pays with"| node_paypal
node_payment -->|"reads cart"| node_cart
node_app -->|"routes to"| node_orderscreen
node_orderscreen -->|"requests orders"| node_orderapi
node_app -->|"routes to"| node_authscreens
node_authscreens -->|"calls account API"| node_userapi
node_authscreens -->|"sets credentials"| node_authstate
node_app -->|"routes to"| node_admin
node_admin -->|"manages products"| node_productapi
node_server -->|"mounts routes"| node_routes
node_routes -->|"dispatches product requests"| node_products
node_routes -->|"dispatches user requests"| node_users
node_routes -->|"dispatches order requests"| node_orderops
node_routes -->|"protects endpoints"| node_authguard
node_products -->|"reads and writes"| node_models
node_users -->|"reads and writes"| node_models
node_orderops -->|"reads and writes"| node_models
node_authguard -->|"loads user"| node_models
node_models -.->|"persists records"| node_mongo
node_routes -->|"exposes upload endpoint"| node_upload
node_upload -->|"stores images"| node_cloudinary
node_shopper -->|"submits inquiry"| node_contact
node_contact -->|"delivers message"| node_email

click node_app "https://github.com/allencodess/huntleys-website/blob/main/frontend/src/App.jsx"
click node_catalog "https://github.com/allencodess/huntleys-website/blob/main/frontend/src/Screens/Products.jsx"
click node_product "https://github.com/allencodess/huntleys-website/blob/main/frontend/src/Screens/ProductDetails.jsx"
click node_cart "https://github.com/allencodess/huntleys-website/blob/main/frontend/src/slices/cartSlice.js"
click node_checkout "https://github.com/allencodess/huntleys-website/blob/main/frontend/src/Screens/Shipping.jsx"
click node_payment "https://github.com/allencodess/huntleys-website/blob/main/frontend/src/Screens/PaymentScreen.jsx"
click node_orderscreen "https://github.com/allencodess/huntleys-website/blob/main/frontend/src/Screens/OrderScreen.jsx"
click node_orderapi "https://github.com/allencodess/huntleys-website/blob/main/frontend/src/slices/ordersApiSlice.js"
click node_productapi "https://github.com/allencodess/huntleys-website/blob/main/frontend/src/slices/productApiSlice.js"
click node_authscreens "https://github.com/allencodess/huntleys-website/blob/main/frontend/src/Screens/Login.jsx"
click node_authstate "https://github.com/allencodess/huntleys-website/blob/main/frontend/src/slices/authSlice.js"
click node_userapi "https://github.com/allencodess/huntleys-website/blob/main/frontend/src/slices/usersApiSlice.js"
click node_admin "https://github.com/allencodess/huntleys-website/blob/main/frontend/src/Screens/admin/ProductEditScreen.jsx"
click node_server "https://github.com/allencodess/huntleys-website/blob/main/backend/server.js"
click node_routes "https://github.com/allencodess/huntleys-website/tree/main/backend/routes"
click node_products "https://github.com/allencodess/huntleys-website/blob/main/backend/controllers/productController.js"
click node_users "https://github.com/allencodess/huntleys-website/blob/main/backend/controllers/userController.js"
click node_orderops "https://github.com/allencodess/huntleys-website/blob/main/backend/controllers/orderController.js"
click node_authguard "https://github.com/allencodess/huntleys-website/blob/main/backend/middleware/authMiddleware.js"
click node_models "https://github.com/allencodess/huntleys-website/tree/main/backend/models"
click node_upload "https://github.com/allencodess/huntleys-website/blob/main/backend/routes/uploadRoutes.js"
click node_contact "https://github.com/allencodess/huntleys-website/blob/main/frontend/src/components/ContactForm.jsx"

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_product,node_productapi,node_contact toneBlue
class node_cart,node_checkout,node_payment,node_paypal,node_orderscreen,node_orderapi,node_mongo toneAmber
class node_authscreens,node_authstate,node_userapi,node_admin toneMint
class node_server,node_routes,node_products,node_users,node_orderops,node_authguard,node_models,node_upload toneRose
class node_shopper,node_cloudinary,node_email toneIndigo
```

## Components

### Storefront

- [Web app routing](https://github.com/allencodess/huntleys-website/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Product browsing](https://github.com/allencodess/huntleys-website/blob/main/frontend/src/Screens/Products.jsx): `frontend/src/Screens/Products.jsx`
- [Product details](https://github.com/allencodess/huntleys-website/blob/main/frontend/src/Screens/ProductDetails.jsx): `frontend/src/Screens/ProductDetails.jsx`
- [Product API client](https://github.com/allencodess/huntleys-website/blob/main/frontend/src/slices/productApiSlice.js): `frontend/src/slices/productApiSlice.js`
- [Contact form](https://github.com/allencodess/huntleys-website/blob/main/frontend/src/components/ContactForm.jsx): `frontend/src/components/ContactForm.jsx`

### Commerce

- [Persistent cart](https://github.com/allencodess/huntleys-website/blob/main/frontend/src/slices/cartSlice.js): `frontend/src/slices/cartSlice.js`
- [Checkout steps](https://github.com/allencodess/huntleys-website/blob/main/frontend/src/Screens/Shipping.jsx): `frontend/src/Screens/Shipping.jsx`
- [Payment screen](https://github.com/allencodess/huntleys-website/blob/main/frontend/src/Screens/PaymentScreen.jsx): `frontend/src/Screens/PaymentScreen.jsx`
- **PayPal payments**
- [Order history](https://github.com/allencodess/huntleys-website/blob/main/frontend/src/Screens/OrderScreen.jsx): `frontend/src/Screens/OrderScreen.jsx`
- [Order API client](https://github.com/allencodess/huntleys-website/blob/main/frontend/src/slices/ordersApiSlice.js): `frontend/src/slices/ordersApiSlice.js`

### Identity & Admin

- [Account screens](https://github.com/allencodess/huntleys-website/blob/main/frontend/src/Screens/Login.jsx): `frontend/src/Screens/Login.jsx`
- [Authentication state](https://github.com/allencodess/huntleys-website/blob/main/frontend/src/slices/authSlice.js): `frontend/src/slices/authSlice.js`
- [User API client](https://github.com/allencodess/huntleys-website/blob/main/frontend/src/slices/usersApiSlice.js): `frontend/src/slices/usersApiSlice.js`
- [Admin dashboard](https://github.com/allencodess/huntleys-website/blob/main/frontend/src/Screens/admin/ProductEditScreen.jsx): `frontend/src/Screens/admin/ProductEditScreen.jsx`

### Backend Platform

- [Express API server](https://github.com/allencodess/huntleys-website/blob/main/backend/server.js): `backend/server.js`
- [API routes](https://github.com/allencodess/huntleys-website/tree/main/backend/routes): `backend/routes`
- [Product operations](https://github.com/allencodess/huntleys-website/blob/main/backend/controllers/productController.js): `backend/controllers/productController.js`
- [User operations](https://github.com/allencodess/huntleys-website/blob/main/backend/controllers/userController.js): `backend/controllers/userController.js`
- [Order operations](https://github.com/allencodess/huntleys-website/blob/main/backend/controllers/orderController.js): `backend/controllers/orderController.js`
- [Authentication guard](https://github.com/allencodess/huntleys-website/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`
- [MongoDB models](https://github.com/allencodess/huntleys-website/tree/main/backend/models): `backend/models`
- [Image upload](https://github.com/allencodess/huntleys-website/blob/main/backend/routes/uploadRoutes.js): `backend/routes/uploadRoutes.js`

### Other components

- **Shopper**
- **MongoDB**
- **Cloudinary**
- **Transactional email**

## Connections

- Shopper → Web app routing: visits
- Web app routing → Product browsing: routes to (evidence: `frontend/src/App.jsx`)
- Web app routing → Product details: routes to (evidence: `frontend/src/App.jsx`)
- Product details → Product API client: requests products (evidence: `frontend/src/Screens/ProductDetails.jsx`)
- Product details → Persistent cart: adds items (evidence: `frontend/src/Screens/ProductDetails.jsx`)
- Shopper → Persistent cart: manages items
- Web app routing → Checkout steps: routes to (evidence: `frontend/src/App.jsx`)
- Checkout steps → Payment screen: continues checkout
- Payment screen → PayPal payments: pays with
- Payment screen → Persistent cart: reads cart (evidence: `frontend/src/Screens/PaymentScreen.jsx`)
- Web app routing → Order history: routes to (evidence: `frontend/src/App.jsx`)
- Order history → Order API client: requests orders (evidence: `frontend/src/Screens/OrderScreen.jsx`)
- Web app routing → Account screens: routes to (evidence: `frontend/src/App.jsx`)
- Account screens → User API client: calls account API (evidence: `frontend/src/Screens/Login.jsx`)
- Account screens → Authentication state: sets credentials (evidence: `frontend/src/Screens/Login.jsx`)
- Web app routing → Admin dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Admin dashboard → Product API client: manages products (evidence: `frontend/src/Screens/admin/ProductEditScreen.jsx`)
- Express API server → API routes: mounts routes (evidence: `backend/server.js`)
- API routes → Product operations: dispatches product requests (evidence: `backend/routes/productRoutes.js`)
- API routes → User operations: dispatches user requests (evidence: `backend/routes/userRoutes.js`)
- API routes → Order operations: dispatches order requests (evidence: `backend/routes/orderRoutes.js`)
- API routes → Authentication guard: protects endpoints (evidence: `backend/routes/orderRoutes.js`)
- Product operations → MongoDB models: reads and writes (evidence: `backend/controllers/productController.js`)
- User operations → MongoDB models: reads and writes (evidence: `backend/controllers/userController.js`)
- Order operations → MongoDB models: reads and writes (evidence: `backend/controllers/orderController.js`)
- Authentication guard → MongoDB models: loads user (evidence: `backend/middleware/authMiddleware.js`)
- MongoDB models → MongoDB: persists records
- API routes → Image upload: exposes upload endpoint (evidence: `backend/server.js`)
- Image upload → Cloudinary: stores images (evidence: `backend/routes/uploadRoutes.js`)
- Shopper → Contact form: submits inquiry
- Contact form → Transactional email: delivers message
