# ritheesh024-hub/cafe-nirvana architecture

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

- Interactive diagram: https://gitdiagram.com/ritheesh024-hub/cafe-nirvana
- Repository: https://github.com/ritheesh024-hub/cafe-nirvana

## Overview

Cafe Nirvana is a customer-facing café ordering app with staff-facing kitchen and administration tools. The main customer journey is browsing the menu, customizing items into a cart, checking out to create an order, then viewing order status. Separate workflows support sign-in and profile management, kitchen order handling, and administration of orders, menu items, offers, customers, and analytics. Firebase provides authentication and Firestore-backed data. The README is empty; connections below rely on excerpts and SOURCE INDEX references, so unsampled feature wiring is not assumed.

Main entry points: [`src/App.tsx`](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/App.tsx) (App routing), [`src/pages/admin/AdminDashboardPage.tsx`](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/pages/admin/AdminDashboardPage.tsx) (Admin dashboard), [`src/lib/firebase.ts`](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/lib/firebase.ts) (Firebase setup), [`src/services/orderService.ts`](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/services/orderService.ts) (Order service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer ordering"]
  node_app["App routing<br/>[App.tsx]"]
  node_menu["Menu browsing<br/>[MenuPage.tsx]"]
  node_catalog["Menu catalog<br/>[menuData.ts]"]
  node_checkout["Checkout<br/>[CheckoutPage.tsx]"]
  node_myorders["Order history<br/>[MyOrdersPage.tsx]"]
  node_offers["Offers<br/>[OffersPage.tsx]"]
end

subgraph group_identity["Identity and state"]
  node_cart["Cart state<br/>[CartContext.tsx]"]
  node_auth["Authentication<br/>[AuthContext.tsx]"]
  node_authui["Sign-in modal<br/>[AuthModal.tsx]"]
  node_role["Role resolution<br/>[useUserRole.ts]"]
end

subgraph group_operations["Staff operations"]
  node_admin["Admin dashboard"]
  node_adminmenu["Menu administration<br/>[AdminMenuTab.tsx]"]
  node_offerops["Offer administration<br/>[AdminOffersTab.tsx]"]
  node_customers["Customer administration"]
  node_analytics["Admin analytics"]
  node_kitchen["Kitchen dashboard"]
  node_kitchenaudio["Kitchen alerts<br/>[kitchenAudio.ts]"]
end

subgraph group_platform["Data platform"]
  node_orders["Order service<br/>[orderService.ts]"]
  node_menuops["Menu service<br/>[menuService.ts]"]
  node_customerdata["Customer service<br/>[customerService.ts]"]
  node_firebase["Firebase setup<br/>[firebase.ts]"]
  node_firestore[("Cloud Firestore")]
  node_firebaseauth["Firebase Auth"]
end

node_customer(("Customer"))

node_customer -->|"opens"| node_app
node_app -->|"routes"| node_menu
node_app -->|"routes"| node_checkout
node_app -->|"routes"| node_admin
node_app -->|"routes"| node_kitchen
node_app -->|"renders"| node_authui
node_app -->|"provides"| node_cart
node_menu -->|"reads"| node_catalog
node_menu -->|"adds items"| node_cart
node_checkout -->|"reads"| node_cart
node_checkout -->|"reads identity"| node_auth
node_checkout -->|"places order"| node_orders
node_myorders -->|"loads orders"| node_orders
node_authui -->|"signs in"| node_auth
node_role -->|"reads role"| node_auth
node_admin -->|"renders tab"| node_adminmenu
node_admin -->|"renders tab"| node_offerops
node_admin -->|"renders tab"| node_customers
node_admin -->|"renders tab"| node_analytics
node_admin -->|"manages orders"| node_orders
node_adminmenu -->|"manages menu"| node_menuops
node_customers -->|"loads customers"| node_customerdata
node_kitchen -->|"updates status"| node_orders
node_kitchen -->|"plays alert"| node_kitchenaudio
node_auth -->|"uses services"| node_firebase
node_orders -->|"uses Firestore"| node_firebase
node_menuops -->|"uses Firestore"| node_firebase
node_customerdata -->|"uses Firestore"| node_firebase
node_firebase -->|"initializes"| node_firestore
node_firebase -->|"initializes"| node_firebaseauth
node_offers -.-> node_offerops

click node_app "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/App.tsx"
click node_menu "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/pages/MenuPage.tsx"
click node_catalog "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/data/menuData.ts"
click node_cart "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/context/CartContext.tsx"
click node_checkout "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/pages/CheckoutPage.tsx"
click node_orders "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/services/orderService.ts"
click node_myorders "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/pages/MyOrdersPage.tsx"
click node_offers "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/pages/OffersPage.tsx"
click node_auth "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/context/AuthContext.tsx"
click node_authui "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/components/auth/AuthModal.tsx"
click node_role "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/hooks/useUserRole.ts"
click node_admin "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/pages/admin/AdminDashboardPage.tsx"
click node_adminmenu "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/components/admin/AdminMenuTab.tsx"
click node_menuops "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/services/menuService.ts"
click node_offerops "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/components/admin/AdminOffersTab.tsx"
click node_customers "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/components/admin/AdminCustomersTab.tsx"
click node_customerdata "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/services/customerService.ts"
click node_analytics "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/components/admin/AdminAnalyticsTab.tsx"
click node_kitchen "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/pages/kitchen/KitchenDashboardPage.tsx"
click node_kitchenaudio "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/services/kitchenAudio.ts"
click node_firebase "https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/lib/firebase.ts"

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_menu,node_catalog,node_checkout,node_myorders,node_offers toneBlue
class node_cart,node_auth,node_authui,node_role toneAmber
class node_admin,node_adminmenu,node_offerops,node_customers,node_analytics,node_kitchen,node_kitchenaudio toneMint
class node_orders,node_menuops,node_customerdata,node_firebase,node_firestore,node_firebaseauth toneRose
class node_customer toneIndigo
```

## Components

### Customer ordering

- [App routing](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/App.tsx): `src/App.tsx`
- [Menu browsing](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/pages/MenuPage.tsx): `src/pages/MenuPage.tsx`
- [Menu catalog](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/data/menuData.ts): `src/data/menuData.ts`
- [Checkout](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/pages/CheckoutPage.tsx): `src/pages/CheckoutPage.tsx`
- [Order history](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/pages/MyOrdersPage.tsx): `src/pages/MyOrdersPage.tsx`
- [Offers](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/pages/OffersPage.tsx): `src/pages/OffersPage.tsx`

### Identity and state

- [Cart state](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/context/CartContext.tsx): `src/context/CartContext.tsx`
- [Authentication](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Sign-in modal](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/components/auth/AuthModal.tsx): `src/components/auth/AuthModal.tsx`
- [Role resolution](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/hooks/useUserRole.ts): `src/hooks/useUserRole.ts`

### Staff operations

- [Admin dashboard](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/pages/admin/AdminDashboardPage.tsx): `src/pages/admin/AdminDashboardPage.tsx`
- [Menu administration](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/components/admin/AdminMenuTab.tsx): `src/components/admin/AdminMenuTab.tsx`
- [Offer administration](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/components/admin/AdminOffersTab.tsx): `src/components/admin/AdminOffersTab.tsx`
- [Customer administration](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/components/admin/AdminCustomersTab.tsx): `src/components/admin/AdminCustomersTab.tsx`
- [Admin analytics](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/components/admin/AdminAnalyticsTab.tsx): `src/components/admin/AdminAnalyticsTab.tsx`
- [Kitchen dashboard](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/pages/kitchen/KitchenDashboardPage.tsx): `src/pages/kitchen/KitchenDashboardPage.tsx`
- [Kitchen alerts](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/services/kitchenAudio.ts): `src/services/kitchenAudio.ts`

### Data platform

- [Order service](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/services/orderService.ts): `src/services/orderService.ts`
- [Menu service](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/services/menuService.ts): `src/services/menuService.ts`
- [Customer service](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/services/customerService.ts): `src/services/customerService.ts`
- [Firebase setup](https://github.com/ritheesh024-hub/cafe-nirvana/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`
- **Cloud Firestore**
- **Firebase Auth**

### Other components

- **Customer**

## Connections

- Customer → App routing: opens (evidence: `src/App.tsx`)
- App routing → Menu browsing: routes (evidence: `src/App.tsx`)
- App routing → Checkout: routes (evidence: `src/App.tsx`)
- App routing → Admin dashboard: routes (evidence: `src/App.tsx`)
- App routing → Kitchen dashboard: routes (evidence: `src/App.tsx`)
- App routing → Sign-in modal: renders (evidence: `src/App.tsx`)
- App routing → Cart state: provides (evidence: `src/App.tsx`)
- Menu browsing → Menu catalog: reads (evidence: `src/pages/MenuPage.tsx`)
- Menu browsing → Cart state: adds items (evidence: `src/pages/MenuPage.tsx`)
- Checkout → Cart state: reads (evidence: `src/pages/CheckoutPage.tsx`)
- Checkout → Authentication: reads identity (evidence: `src/pages/CheckoutPage.tsx`)
- Checkout → Order service: places order (evidence: `src/pages/CheckoutPage.tsx`)
- Order history → Order service: loads orders (evidence: `src/pages/MyOrdersPage.tsx`)
- Sign-in modal → Authentication: signs in (evidence: `src/components/auth/AuthModal.tsx`)
- Role resolution → Authentication: reads role (evidence: `src/hooks/useUserRole.ts`)
- Admin dashboard → Menu administration: renders tab (evidence: `src/pages/admin/AdminDashboardPage.tsx`)
- Admin dashboard → Offer administration: renders tab (evidence: `src/pages/admin/AdminDashboardPage.tsx`)
- Admin dashboard → Customer administration: renders tab (evidence: `src/pages/admin/AdminDashboardPage.tsx`)
- Admin dashboard → Admin analytics: renders tab (evidence: `src/pages/admin/AdminDashboardPage.tsx`)
- Admin dashboard → Order service: manages orders (evidence: `src/pages/admin/AdminDashboardPage.tsx`)
- Menu administration → Menu service: manages menu (evidence: `src/components/admin/AdminMenuTab.tsx`)
- Customer administration → Customer service: loads customers (evidence: `src/components/admin/AdminCustomersTab.tsx`)
- Kitchen dashboard → Order service: updates status (evidence: `src/pages/kitchen/KitchenDashboardPage.tsx`)
- Kitchen dashboard → Kitchen alerts: plays alert (evidence: `src/pages/kitchen/KitchenDashboardPage.tsx`)
- Authentication → Firebase setup: uses services (evidence: `src/context/AuthContext.tsx`)
- Order service → Firebase setup: uses Firestore (evidence: `src/services/orderService.ts`)
- Menu service → Firebase setup: uses Firestore (evidence: `src/services/menuService.ts`)
- Customer service → Firebase setup: uses Firestore (evidence: `src/services/customerService.ts`)
- Firebase setup → Cloud Firestore: initializes (evidence: `src/lib/firebase.ts`)
- Firebase setup → Firebase Auth: initializes (evidence: `src/lib/firebase.ts`)
- Offers → Offer administration
