# manavdhaye/restaurant-ar architecture

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

- Interactive diagram: https://gitdiagram.com/manavdhaye/restaurant-ar
- Repository: https://github.com/manavdhaye/restaurant-ar

## Overview

CafeAR is a client-side cafe menu and ordering demo. Guests browse and filter dishes, inspect photos or 3D/AR models, add items to a cart, and create a simulated checkout confirmation; a table query parameter supplies table context. A local admin view manages menu entries, while a QR generator supports table-code setup. Source excerpts show the main routing, state, cart, and model-loading links; other component connections are based on the SOURCE INDEX or README, so unsampled details are not expanded.

Main entry points: [`src/App.tsx`](https://github.com/manavdhaye/restaurant-ar/blob/main/src/App.tsx) (App Router), [`src/context/MenuContext.tsx`](https://github.com/manavdhaye/restaurant-ar/blob/main/src/context/MenuContext.tsx) (Menu State), [`src/context/CartContext.tsx`](https://github.com/manavdhaye/restaurant-ar/blob/main/src/context/CartContext.tsx) (Cart State), [`src/components/AdminView.tsx`](https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/AdminView.tsx) (Demo Admin)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Guest Menu"]
  node_app["App Router<br/>[App.tsx]"]
  node_header["Header and Table<br/>[Header.tsx]"]
  node_hero["Featured Dishes<br/>[Hero.tsx]"]
  node_search["Menu Search<br/>[SearchBar.tsx]"]
  node_categories["Category Filter<br/>[CategoryFilter.tsx]"]
  node_productcard["Dish Cards<br/>[ProductCard.tsx]"]
  node_details["Dish Details"]
end

subgraph group_ordering["Cart and Checkout"]
  node_cart["Cart State<br/>[CartContext.tsx]"]
  node_drawer["Cart and Checkout<br/>[CartDrawer.tsx]"]
end

subgraph group_management["Menu Management"]
  node_menu["Menu State<br/>[MenuContext.tsx]"]
  node_sampledata["Sample Menu<br/>[initialProducts.ts]"]
  node_admin["Demo Admin<br/>[AdminView.tsx]"]
  node_qr["Table QR Generator"]
  node_localstorage[("Browser LocalStorage")]
end

subgraph group_platform["3D and Assets"]
  node_viewer["3D and AR Viewer<br/>[ARDishViewer.tsx]"]
  node_cache["Model Cache<br/>[modelCache.ts]"]
  node_asseturl["Asset URL Resolver<br/>[assetUrl.ts]"]
  node_models["Dish Models"]
  node_modelviewer["Model Viewer and AR"]
end

node_guest(("Cafe Guest"))

node_guest -->|"opens menu"| node_app
node_app -->|"renders"| node_header
node_app -->|"renders"| node_hero
node_app -->|"renders"| node_search
node_app -->|"renders"| node_categories
node_app -->|"renders"| node_productcard
node_app -->|"renders"| node_details
node_app -->|"routes to"| node_admin
node_app -->|"opens"| node_qr
node_search -->|"updates query"| node_menu
node_categories -->|"sets category"| node_menu
node_menu -->|"loads defaults"| node_sampledata
node_menu -->|"reads and writes"| node_localstorage
node_menu -->|"reads table query"| node_guest
node_header -->|"reads menu context"| node_menu
node_header -->|"reads cart state"| node_cart
node_productcard -->|"adds dish"| node_cart
node_details -->|"adds quantity"| node_cart
node_details -->|"renders viewer"| node_viewer
node_app -->|"renders drawer"| node_cart
node_drawer -->|"updates and checks out"| node_cart
node_drawer -->|"reads table context"| node_menu
node_admin -->|"manages dishes"| node_menu
node_admin -->|"previews model"| node_viewer
node_admin -->|"resolves image paths"| node_asseturl
node_qr -->|"reads table context"| node_menu
node_viewer -->|"preloads model"| node_cache
node_cache -->|"resolves model URL"| node_asseturl
node_cache -->|"fetches model assets"| node_models
node_viewer -->|"renders 3D and AR"| node_modelviewer
node_modelviewer -->|"loads GLB assets"| node_models

click node_app "https://github.com/manavdhaye/restaurant-ar/blob/main/src/App.tsx"
click node_header "https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/Header.tsx"
click node_hero "https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/Hero.tsx"
click node_search "https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/SearchBar.tsx"
click node_categories "https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/CategoryFilter.tsx"
click node_productcard "https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/ProductCard.tsx"
click node_details "https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/ProductDetailsModal.tsx"
click node_menu "https://github.com/manavdhaye/restaurant-ar/blob/main/src/context/MenuContext.tsx"
click node_sampledata "https://github.com/manavdhaye/restaurant-ar/blob/main/src/data/initialProducts.ts"
click node_admin "https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/AdminView.tsx"
click node_qr "https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/QRGeneratorModal.tsx"
click node_cart "https://github.com/manavdhaye/restaurant-ar/blob/main/src/context/CartContext.tsx"
click node_drawer "https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/CartDrawer.tsx"
click node_viewer "https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/ARDishViewer.tsx"
click node_cache "https://github.com/manavdhaye/restaurant-ar/blob/main/src/utils/modelCache.ts"
click node_asseturl "https://github.com/manavdhaye/restaurant-ar/blob/main/src/utils/assetUrl.ts"
click node_models "https://github.com/manavdhaye/restaurant-ar/tree/main/public/models"

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_header,node_hero,node_search,node_categories,node_productcard,node_details toneBlue
class node_cart,node_drawer toneAmber
class node_menu,node_sampledata,node_admin,node_qr,node_localstorage toneMint
class node_viewer,node_cache,node_asseturl,node_models,node_modelviewer toneRose
class node_guest toneIndigo
```

## Components

### Guest Menu

- [App Router](https://github.com/manavdhaye/restaurant-ar/blob/main/src/App.tsx): `src/App.tsx`
- [Header and Table](https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [Featured Dishes](https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/Hero.tsx): `src/components/Hero.tsx`
- [Menu Search](https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/SearchBar.tsx): `src/components/SearchBar.tsx`
- [Category Filter](https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/CategoryFilter.tsx): `src/components/CategoryFilter.tsx`
- [Dish Cards](https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/ProductCard.tsx): `src/components/ProductCard.tsx`
- [Dish Details](https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/ProductDetailsModal.tsx): `src/components/ProductDetailsModal.tsx`

### Cart and Checkout

- [Cart State](https://github.com/manavdhaye/restaurant-ar/blob/main/src/context/CartContext.tsx): `src/context/CartContext.tsx`
- [Cart and Checkout](https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/CartDrawer.tsx): `src/components/CartDrawer.tsx`

### Menu Management

- [Menu State](https://github.com/manavdhaye/restaurant-ar/blob/main/src/context/MenuContext.tsx): `src/context/MenuContext.tsx`
- [Sample Menu](https://github.com/manavdhaye/restaurant-ar/blob/main/src/data/initialProducts.ts): `src/data/initialProducts.ts`
- [Demo Admin](https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/AdminView.tsx): `src/components/AdminView.tsx`
- [Table QR Generator](https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/QRGeneratorModal.tsx): `src/components/QRGeneratorModal.tsx`
- **Browser LocalStorage**

### 3D and Assets

- [3D and AR Viewer](https://github.com/manavdhaye/restaurant-ar/blob/main/src/components/ARDishViewer.tsx): `src/components/ARDishViewer.tsx`
- [Model Cache](https://github.com/manavdhaye/restaurant-ar/blob/main/src/utils/modelCache.ts): `src/utils/modelCache.ts`
- [Asset URL Resolver](https://github.com/manavdhaye/restaurant-ar/blob/main/src/utils/assetUrl.ts): `src/utils/assetUrl.ts`
- [Dish Models](https://github.com/manavdhaye/restaurant-ar/tree/main/public/models): `public/models`
- **Model Viewer and AR**

### Other components

- **Cafe Guest**

## Connections

- Cafe Guest → App Router: opens menu (evidence: `README.md`)
- App Router → Header and Table: renders (evidence: `src/App.tsx`)
- App Router → Featured Dishes: renders (evidence: `src/App.tsx`)
- App Router → Menu Search: renders (evidence: `src/App.tsx`)
- App Router → Category Filter: renders (evidence: `src/App.tsx`)
- App Router → Dish Cards: renders (evidence: `src/App.tsx`)
- App Router → Dish Details: renders (evidence: `src/App.tsx`)
- App Router → Demo Admin: routes to (evidence: `src/App.tsx`)
- App Router → Table QR Generator: opens (evidence: `src/App.tsx`)
- Menu Search → Menu State: updates query (evidence: `src/components/SearchBar.tsx`)
- Category Filter → Menu State: sets category (evidence: `src/components/CategoryFilter.tsx`)
- Menu State → Sample Menu: loads defaults (evidence: `src/context/MenuContext.tsx`)
- Menu State → Browser LocalStorage: reads and writes (evidence: `src/context/MenuContext.tsx`)
- Menu State → Cafe Guest: reads table query (evidence: `src/context/MenuContext.tsx`)
- Header and Table → Menu State: reads menu context (evidence: `src/components/Header.tsx`)
- Header and Table → Cart State: reads cart state (evidence: `src/components/Header.tsx`)
- Dish Cards → Cart State: adds dish (evidence: `src/components/ProductCard.tsx`)
- Dish Details → Cart State: adds quantity (evidence: `src/components/ProductDetailsModal.tsx`)
- Dish Details → 3D and AR Viewer: renders viewer (evidence: `src/components/ProductDetailsModal.tsx`)
- App Router → Cart State: renders drawer (evidence: `src/App.tsx`)
- Cart and Checkout → Cart State: updates and checks out (evidence: `src/components/CartDrawer.tsx`)
- Cart and Checkout → Menu State: reads table context (evidence: `src/components/CartDrawer.tsx`)
- Demo Admin → Menu State: manages dishes (evidence: `src/components/AdminView.tsx`)
- Demo Admin → 3D and AR Viewer: previews model (evidence: `src/components/AdminView.tsx`)
- Demo Admin → Asset URL Resolver: resolves image paths (evidence: `src/components/AdminView.tsx`)
- Table QR Generator → Menu State: reads table context (evidence: `src/components/QRGeneratorModal.tsx`)
- 3D and AR Viewer → Model Cache: preloads model (evidence: `src/components/ARDishViewer.tsx`)
- Model Cache → Asset URL Resolver: resolves model URL (evidence: `src/utils/modelCache.ts`)
- Model Cache → Dish Models: fetches model assets (evidence: `src/utils/modelCache.ts`)
- 3D and AR Viewer → Model Viewer and AR: renders 3D and AR (evidence: `README.md`)
- Model Viewer and AR → Dish Models: loads GLB assets (evidence: `README.md`)
