How manavdhaye/restaurant-ar works
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: App.tsx App Router · MenuContext.tsx Menu State · CartContext.tsx Cart State · AdminView.tsx Demo Admin
Components 20
Guest Menu
- App Router
src/App.tsx - Header and Table
src/components/Header.tsx - Featured Dishes
src/components/Hero.tsx - Menu Search
src/components/SearchBar.tsx - Category Filter
src/components/CategoryFilter.tsx - Dish Cards
src/components/ProductCard.tsx - Dish Details
src/components/ProductDetailsModal.tsx
Cart and Checkout
- Cart State
src/context/CartContext.tsx - Cart and Checkout
src/components/CartDrawer.tsx
Menu Management
- Menu State
src/context/MenuContext.tsx - Sample Menu
src/data/initialProducts.ts - Demo Admin
src/components/AdminView.tsx - Table QR Generator
src/components/QRGeneratorModal.tsx - Browser LocalStorage
3D and Assets
- 3D and AR Viewer
src/components/ARDishViewer.tsx - Model Cache
src/utils/modelCache.ts - Asset URL Resolver
src/utils/assetUrl.ts - Dish Models
public/models - Model Viewer and AR
Other components
- Cafe Guest
Connections 31
- Cafe Guest → App Router: opens menu
README.md - App Router → Header and Table: renders
src/App.tsx - App Router → Featured Dishes: renders
src/App.tsx - App Router → Menu Search: renders
src/App.tsx - App Router → Category Filter: renders
src/App.tsx - App Router → Dish Cards: renders
src/App.tsx - App Router → Dish Details: renders
src/App.tsx - App Router → Demo Admin: routes to
src/App.tsx - App Router → Table QR Generator: opens
src/App.tsx - Menu Search → Menu State: updates query
src/components/SearchBar.tsx - Category Filter → Menu State: sets category
src/components/CategoryFilter.tsx - Menu State → Sample Menu: loads defaults
src/context/MenuContext.tsx - Menu State → Browser LocalStorage: reads and writes
src/context/MenuContext.tsx - Menu State → Cafe Guest: reads table query
src/context/MenuContext.tsx - Header and Table → Menu State: reads menu context
src/components/Header.tsx - Header and Table → Cart State: reads cart state
src/components/Header.tsx - Dish Cards → Cart State: adds dish
src/components/ProductCard.tsx - Dish Details → Cart State: adds quantity
src/components/ProductDetailsModal.tsx - Dish Details → 3D and AR Viewer: renders viewer
src/components/ProductDetailsModal.tsx - App Router → Cart State: renders drawer
src/App.tsx - Cart and Checkout → Cart State: updates and checks out
src/components/CartDrawer.tsx - Cart and Checkout → Menu State: reads table context
src/components/CartDrawer.tsx - Demo Admin → Menu State: manages dishes
src/components/AdminView.tsx - Demo Admin → 3D and AR Viewer: previews model
src/components/AdminView.tsx - Demo Admin → Asset URL Resolver: resolves image paths
src/components/AdminView.tsx - Table QR Generator → Menu State: reads table context
src/components/QRGeneratorModal.tsx - 3D and AR Viewer → Model Cache: preloads model
src/components/ARDishViewer.tsx - Model Cache → Asset URL Resolver: resolves model URL
src/utils/modelCache.ts - Model Cache → Dish Models: fetches model assets
src/utils/modelCache.ts - 3D and AR Viewer → Model Viewer and AR: renders 3D and AR
README.md - Model Viewer and AR → Dish Models: loads GLB assets
README.md