# 3mrjarrar/thedonutstop architecture

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

- Interactive diagram: https://gitdiagram.com/3mrjarrar/thedonutstop
- Repository: https://github.com/3mrjarrar/thedonutstop

## Overview

The Donut Stop is a bilingual donut storefront with branch-specific menus, promotions, cart checkout and guest order tracking, alongside staff administration for orders, inventory and offers. Routes feed the home, menu, cart and admin experiences; storefront data and ordering depend on Supabase. The graph combines sampled call relationships with capabilities explicitly described in the README. Some admin, tracking and menu implementation details were not excerpted, so their links are limited to documented or indexed evidence.

Main entry points: [`src/lib/supabase.js`](https://github.com/3mrjarrar/thedonutstop/blob/main/src/lib/supabase.js) (Supabase services), [`src/app/routes.jsx`](https://github.com/3mrjarrar/thedonutstop/blob/main/src/app/routes.jsx) (Route selection), [`src/pages/Admin/Admin.jsx`](https://github.com/3mrjarrar/thedonutstop/blob/main/src/pages/Admin/Admin.jsx) (Admin console), [`src/pages/Cart/CartPage.jsx`](https://github.com/3mrjarrar/thedonutstop/blob/main/src/pages/Cart/CartPage.jsx) (Cart page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_store["Storefront"]
  node_home["Home sections<br/>[Home.jsx]"]
  node_featured["Featured products"]
  node_menu_page["Menu page<br/>[Menu.jsx]"]
  node_branch_menu["Branch menu<br/>[BranchMenu.jsx]"]
  node_menu_data["Product catalog<br/>[menuData.js]"]
  node_offers_ui["Offer display<br/>[Offers.jsx]"]
end

subgraph group_order["Ordering"]
  node_cart_page["Cart page<br/>[CartPage.jsx]"]
  node_cart_state["Cart state and quote<br/>[CartContext.jsx]"]
  node_checkout["Checkout<br/>[Cart.jsx]"]
  node_tracking["Guest tracking"]
  node_tracker_ui["Tracking card<br/>[OrderTracker.jsx]"]
end

subgraph group_staff["Staff operations"]
  node_admin["Admin console<br/>[Admin.jsx]"]
  node_admin_orders["Order management<br/>[Orders.jsx]"]
  node_admin_offers["Offer management<br/>[AdminOffers.jsx]"]
  node_admin_inventory["Inventory management"]
end

subgraph group_shared["Shared services"]
  node_routes["Route selection<br/>[routes.jsx]"]
  node_layout["Shared layout<br/>[MainLayout.jsx]"]
  node_language["Language context"]
  node_supabase[("Supabase services<br/>[supabase.js]")]
  node_offers_data["Offer data and rules<br/>[offerCatalog.js]"]
  node_browser_storage[("Browser storage")]
end

node_guest(("Shopper"))
node_staff_user(("Staff user"))

node_guest -->|"opens pages"| node_routes
node_staff_user -->|"opens admin"| node_routes
node_routes -->|"wraps storefront"| node_layout
node_routes -->|"routes home"| node_home
node_routes -->|"routes menu"| node_menu_page
node_routes -->|"routes cart"| node_cart_page
node_routes -->|"routes admin"| node_admin
node_home -->|"renders section"| node_featured
node_home -->|"renders section"| node_offers_ui
node_featured -->|"reads products"| node_menu_data
node_menu_page -->|"renders menu"| node_branch_menu
node_branch_menu -->|"uses catalog"| node_menu_data
node_branch_menu -->|"reads availability"| node_supabase
node_offers_ui -->|"formats offers"| node_offers_data
node_cart_page -->|"uses cart"| node_cart_state
node_cart_page -->|"renders checkout"| node_checkout
node_cart_page -->|"refreshes menu"| node_supabase
node_cart_state -->|"requests quote"| node_supabase
node_cart_state -->|"prices offers"| node_offers_data
node_checkout -->|"submits order"| node_supabase
node_checkout -->|"records order"| node_tracking
node_tracker_ui -->|"reads tracking state"| node_tracking
node_tracking -->|"persists tokens"| node_browser_storage
node_tracking -.->|"fetches status"| node_supabase
node_admin -->|"renders orders"| node_admin_orders
node_admin -->|"renders offers"| node_admin_offers
node_admin -->|"renders inventory"| node_admin_inventory
node_admin -->|"manages records"| node_supabase
node_admin_orders -->|"reads orders"| node_supabase
node_admin_offers -->|"updates campaigns"| node_supabase
node_admin_offers -->|"uses definitions"| node_offers_data
node_admin_inventory -.->|"updates stock"| node_supabase
node_layout -->|"uses language"| node_language

click node_routes "https://github.com/3mrjarrar/thedonutstop/blob/main/src/app/routes.jsx"
click node_layout "https://github.com/3mrjarrar/thedonutstop/blob/main/src/app/MainLayout.jsx"
click node_language "https://github.com/3mrjarrar/thedonutstop/blob/main/src/i18n/LanguageContext.jsx"
click node_home "https://github.com/3mrjarrar/thedonutstop/blob/main/src/pages/Home/Home.jsx"
click node_featured "https://github.com/3mrjarrar/thedonutstop/blob/main/src/components/FeaturedProducts/FeaturedProducts.jsx"
click node_menu_page "https://github.com/3mrjarrar/thedonutstop/blob/main/src/pages/Menu/Menu.jsx"
click node_branch_menu "https://github.com/3mrjarrar/thedonutstop/blob/main/src/components/menu/BranchMenu.jsx"
click node_menu_data "https://github.com/3mrjarrar/thedonutstop/blob/main/src/components/menu/menuData.js"
click node_offers_ui "https://github.com/3mrjarrar/thedonutstop/blob/main/src/components/Offers/Offers.jsx"
click node_cart_page "https://github.com/3mrjarrar/thedonutstop/blob/main/src/pages/Cart/CartPage.jsx"
click node_cart_state "https://github.com/3mrjarrar/thedonutstop/blob/main/src/components/cart/CartContext.jsx"
click node_checkout "https://github.com/3mrjarrar/thedonutstop/blob/main/src/components/cart/Cart.jsx"
click node_tracking "https://github.com/3mrjarrar/thedonutstop/blob/main/src/components/orders/OrderTrackingContext.jsx"
click node_tracker_ui "https://github.com/3mrjarrar/thedonutstop/blob/main/src/components/orders/OrderTracker.jsx"
click node_admin "https://github.com/3mrjarrar/thedonutstop/blob/main/src/pages/Admin/Admin.jsx"
click node_admin_orders "https://github.com/3mrjarrar/thedonutstop/blob/main/src/pages/Admin/Orders.jsx"
click node_admin_offers "https://github.com/3mrjarrar/thedonutstop/blob/main/src/pages/Admin/AdminOffers.jsx"
click node_admin_inventory "https://github.com/3mrjarrar/thedonutstop/blob/main/src/pages/Admin/InventoryEditor.jsx"
click node_supabase "https://github.com/3mrjarrar/thedonutstop/blob/main/src/lib/supabase.js"
click node_offers_data "https://github.com/3mrjarrar/thedonutstop/blob/main/src/lib/offerCatalog.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_home,node_featured,node_menu_page,node_branch_menu,node_menu_data,node_offers_ui,node_staff_user toneBlue
class node_cart_page,node_cart_state,node_checkout,node_tracking,node_tracker_ui toneAmber
class node_admin,node_admin_orders,node_admin_offers,node_admin_inventory toneMint
class node_routes,node_layout,node_language,node_supabase,node_offers_data,node_browser_storage toneRose
class node_guest toneIndigo
```

## Components

### Storefront

- [Home sections](https://github.com/3mrjarrar/thedonutstop/blob/main/src/pages/Home/Home.jsx): `src/pages/Home/Home.jsx`
- [Featured products](https://github.com/3mrjarrar/thedonutstop/blob/main/src/components/FeaturedProducts/FeaturedProducts.jsx): `src/components/FeaturedProducts/FeaturedProducts.jsx`
- [Menu page](https://github.com/3mrjarrar/thedonutstop/blob/main/src/pages/Menu/Menu.jsx): `src/pages/Menu/Menu.jsx`
- [Branch menu](https://github.com/3mrjarrar/thedonutstop/blob/main/src/components/menu/BranchMenu.jsx): `src/components/menu/BranchMenu.jsx`
- [Product catalog](https://github.com/3mrjarrar/thedonutstop/blob/main/src/components/menu/menuData.js): `src/components/menu/menuData.js`
- [Offer display](https://github.com/3mrjarrar/thedonutstop/blob/main/src/components/Offers/Offers.jsx): `src/components/Offers/Offers.jsx`

### Ordering

- [Cart page](https://github.com/3mrjarrar/thedonutstop/blob/main/src/pages/Cart/CartPage.jsx): `src/pages/Cart/CartPage.jsx`
- [Cart state and quote](https://github.com/3mrjarrar/thedonutstop/blob/main/src/components/cart/CartContext.jsx): `src/components/cart/CartContext.jsx`
- [Checkout](https://github.com/3mrjarrar/thedonutstop/blob/main/src/components/cart/Cart.jsx): `src/components/cart/Cart.jsx`
- [Guest tracking](https://github.com/3mrjarrar/thedonutstop/blob/main/src/components/orders/OrderTrackingContext.jsx): `src/components/orders/OrderTrackingContext.jsx`
- [Tracking card](https://github.com/3mrjarrar/thedonutstop/blob/main/src/components/orders/OrderTracker.jsx): `src/components/orders/OrderTracker.jsx`

### Staff operations

- [Admin console](https://github.com/3mrjarrar/thedonutstop/blob/main/src/pages/Admin/Admin.jsx): `src/pages/Admin/Admin.jsx`
- [Order management](https://github.com/3mrjarrar/thedonutstop/blob/main/src/pages/Admin/Orders.jsx): `src/pages/Admin/Orders.jsx`
- [Offer management](https://github.com/3mrjarrar/thedonutstop/blob/main/src/pages/Admin/AdminOffers.jsx): `src/pages/Admin/AdminOffers.jsx`
- [Inventory management](https://github.com/3mrjarrar/thedonutstop/blob/main/src/pages/Admin/InventoryEditor.jsx): `src/pages/Admin/InventoryEditor.jsx`

### Shared services

- [Route selection](https://github.com/3mrjarrar/thedonutstop/blob/main/src/app/routes.jsx): `src/app/routes.jsx`
- [Shared layout](https://github.com/3mrjarrar/thedonutstop/blob/main/src/app/MainLayout.jsx): `src/app/MainLayout.jsx`
- [Language context](https://github.com/3mrjarrar/thedonutstop/blob/main/src/i18n/LanguageContext.jsx): `src/i18n/LanguageContext.jsx`
- [Supabase services](https://github.com/3mrjarrar/thedonutstop/blob/main/src/lib/supabase.js): `src/lib/supabase.js`
- [Offer data and rules](https://github.com/3mrjarrar/thedonutstop/blob/main/src/lib/offerCatalog.js): `src/lib/offerCatalog.js`
- **Browser storage**

### Other components

- **Shopper**
- **Staff user**

## Connections

- Shopper → Route selection: opens pages (evidence: `src/app/routes.jsx`)
- Staff user → Route selection: opens admin (evidence: `src/app/routes.jsx`)
- Route selection → Shared layout: wraps storefront (evidence: `src/app/routes.jsx`)
- Route selection → Home sections: routes home (evidence: `src/app/routes.jsx`)
- Route selection → Menu page: routes menu (evidence: `src/app/routes.jsx`)
- Route selection → Cart page: routes cart (evidence: `src/app/routes.jsx`)
- Route selection → Admin console: routes admin (evidence: `src/app/routes.jsx`)
- Home sections → Featured products: renders section (evidence: `src/pages/Home/Home.jsx`)
- Home sections → Offer display: renders section (evidence: `src/pages/Home/Home.jsx`)
- Featured products → Product catalog: reads products (evidence: `src/components/FeaturedProducts/FeaturedProducts.jsx`)
- Menu page → Branch menu: renders menu (evidence: `src/pages/Menu/Menu.jsx`)
- Branch menu → Product catalog: uses catalog (evidence: `src/components/menu/BranchMenu.jsx`)
- Branch menu → Supabase services: reads availability (evidence: `src/components/menu/BranchMenu.jsx`)
- Offer display → Offer data and rules: formats offers (evidence: `src/components/Offers/Offers.jsx`)
- Cart page → Cart state and quote: uses cart (evidence: `src/pages/Cart/CartPage.jsx`)
- Cart page → Checkout: renders checkout (evidence: `src/pages/Cart/CartPage.jsx`)
- Cart page → Supabase services: refreshes menu (evidence: `src/pages/Cart/CartPage.jsx`)
- Cart state and quote → Supabase services: requests quote (evidence: `src/components/cart/CartContext.jsx`)
- Cart state and quote → Offer data and rules: prices offers (evidence: `src/components/cart/CartContext.jsx`)
- Checkout → Supabase services: submits order (evidence: `src/components/cart/Cart.jsx`)
- Checkout → Guest tracking: records order (evidence: `src/components/cart/Cart.jsx`)
- Tracking card → Guest tracking: reads tracking state
- Guest tracking → Browser storage: persists tokens (evidence: `src/components/orders/OrderTrackingContext.jsx`)
- Guest tracking → Supabase services: fetches status (evidence: `README.md`)
- Admin console → Order management: renders orders (evidence: `src/pages/Admin/Admin.jsx`)
- Admin console → Offer management: renders offers (evidence: `src/pages/Admin/Admin.jsx`)
- Admin console → Inventory management: renders inventory (evidence: `src/pages/Admin/Admin.jsx`)
- Admin console → Supabase services: manages records (evidence: `src/pages/Admin/Admin.jsx`)
- Order management → Supabase services: reads orders (evidence: `src/pages/Admin/Orders.jsx`)
- Offer management → Supabase services: updates campaigns (evidence: `src/pages/Admin/AdminOffers.jsx`)
- Offer management → Offer data and rules: uses definitions (evidence: `src/pages/Admin/AdminOffers.jsx`)
- Inventory management → Supabase services: updates stock (evidence: `README.md`)
- Shared layout → Language context: uses language (evidence: `src/app/MainLayout.jsx`)
