# youssef-atef-20/abonagy-menu architecture

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

- Interactive diagram: https://gitdiagram.com/youssef-atef-20/abonagy-menu
- Repository: https://github.com/youssef-atef-20/abonagy-menu

## Overview

Abo Nagy Menu is a read-only, Arabic RTL customer menu, typically opened after scanning the restaurant QR code. Its workflow loads active restaurant, category, product, and available-variant data from Supabase, assembles a sorted hierarchy, then presents category navigation and priced product variants. The page also provides theme switching and loading, error/retry, and empty states. The README documents responsive layouts and animations; sampled page code confirms AOS use. Components and calls below are supported by the excerpts or README; the external QR entry is documented as the customer access pattern.

Main entry points: [`src/pages/MenuPage.tsx`](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/pages/MenuPage.tsx) (Menu page), [`src/lib/supabase.ts`](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/lib/supabase.ts) (Supabase client), [`src/hooks/useMenu.ts`](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/hooks/useMenu.ts) (Menu loader), [`src/App.tsx`](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/App.tsx) (App entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Menu data"]
  node_supabase["Supabase client<br/>[supabase.ts]"]
  node_menuhook["Menu loader<br/>[useMenu.ts]"]
end

subgraph group_experience["Menu experience"]
  node_app["App entry<br/>[App.tsx]"]
  node_page["Menu page<br/>[MenuPage.tsx]"]
  node_theme["Theme preference<br/>[useTheme.ts]"]
end

subgraph group_presentation["Menu presentation"]
  node_header["Menu header<br/>[MenuHeader.tsx]"]
  node_nav["Category navigation<br/>[CategoryNav.tsx]"]
  node_section["Category section"]
  node_product["Product card<br/>[ProductCard.tsx]"]
  node_variants["Variant prices<br/>[VariantList.tsx]"]
  node_price["Price display<br/>[Price.tsx]"]
end

subgraph group_feedback["Page states"]
  node_loading["Loading state<br/>[LoadingState.tsx]"]
  node_error["Error state<br/>[ErrorState.tsx]"]
  node_empty["Empty state<br/>[EmptyState.tsx]"]
end

node_customer(("Customer"))
node_supabase_service[("Supabase")]

node_customer -.->|"opens menu"| node_app
node_app -->|"renders"| node_page
node_page -->|"loads data"| node_menuhook
node_menuhook -->|"queries through"| node_supabase
node_supabase -.->|"reads menu"| node_supabase_service
node_page -->|"uses theme"| node_theme
node_page -->|"renders"| node_header
node_page -->|"renders"| node_nav
node_page -->|"renders"| node_section
node_section -->|"renders"| node_product
node_product -->|"renders"| node_variants
node_variants -->|"renders"| node_price
node_page -->|"shows while loading"| node_loading
node_page -->|"shows on failure"| node_error
node_page -->|"shows when empty"| node_empty

click node_app "https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/App.tsx"
click node_page "https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/pages/MenuPage.tsx"
click node_theme "https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/hooks/useTheme.ts"
click node_supabase "https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/lib/supabase.ts"
click node_menuhook "https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/hooks/useMenu.ts"
click node_header "https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/menu/MenuHeader.tsx"
click node_nav "https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/menu/CategoryNav.tsx"
click node_section "https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/menu/CategorySection.tsx"
click node_product "https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/menu/ProductCard.tsx"
click node_variants "https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/menu/VariantList.tsx"
click node_price "https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/ui/Price.tsx"
click node_loading "https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/ui/LoadingState.tsx"
click node_error "https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/ui/ErrorState.tsx"
click node_empty "https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/ui/EmptyState.tsx"

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_supabase,node_menuhook toneBlue
class node_app,node_page,node_theme,node_supabase_service toneAmber
class node_header,node_nav,node_section,node_product,node_variants,node_price toneMint
class node_loading,node_error,node_empty toneRose
class node_customer toneIndigo
```

## Components

### Menu data

- [Supabase client](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Menu loader](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/hooks/useMenu.ts): `src/hooks/useMenu.ts`

### Menu experience

- [App entry](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/App.tsx): `src/App.tsx`
- [Menu page](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/pages/MenuPage.tsx): `src/pages/MenuPage.tsx`
- [Theme preference](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/hooks/useTheme.ts): `src/hooks/useTheme.ts`

### Menu presentation

- [Menu header](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/menu/MenuHeader.tsx): `src/components/menu/MenuHeader.tsx`
- [Category navigation](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/menu/CategoryNav.tsx): `src/components/menu/CategoryNav.tsx`
- [Category section](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/menu/CategorySection.tsx): `src/components/menu/CategorySection.tsx`
- [Product card](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/menu/ProductCard.tsx): `src/components/menu/ProductCard.tsx`
- [Variant prices](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/menu/VariantList.tsx): `src/components/menu/VariantList.tsx`
- [Price display](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/ui/Price.tsx): `src/components/ui/Price.tsx`

### Page states

- [Loading state](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/ui/LoadingState.tsx): `src/components/ui/LoadingState.tsx`
- [Error state](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/ui/ErrorState.tsx): `src/components/ui/ErrorState.tsx`
- [Empty state](https://github.com/youssef-atef-20/abonagy-menu/blob/main/src/components/ui/EmptyState.tsx): `src/components/ui/EmptyState.tsx`

### Other components

- **Customer**
- **Supabase**

## Connections

- Customer → App entry: opens menu (evidence: `README.md`)
- App entry → Menu page: renders (evidence: `src/App.tsx`)
- Menu page → Menu loader: loads data (evidence: `src/pages/MenuPage.tsx`)
- Menu loader → Supabase client: queries through (evidence: `src/hooks/useMenu.ts`)
- Supabase client → Supabase: reads menu
- Menu page → Theme preference: uses theme (evidence: `src/pages/MenuPage.tsx`)
- Menu page → Menu header: renders (evidence: `src/pages/MenuPage.tsx`)
- Menu page → Category navigation: renders (evidence: `src/pages/MenuPage.tsx`)
- Menu page → Category section: renders (evidence: `src/pages/MenuPage.tsx`)
- Category section → Product card: renders (evidence: `src/components/menu/CategorySection.tsx`)
- Product card → Variant prices: renders (evidence: `src/components/menu/ProductCard.tsx`)
- Variant prices → Price display: renders (evidence: `src/components/menu/VariantList.tsx`)
- Menu page → Loading state: shows while loading (evidence: `src/pages/MenuPage.tsx`)
- Menu page → Error state: shows on failure (evidence: `src/pages/MenuPage.tsx`)
- Menu page → Empty state: shows when empty (evidence: `src/pages/MenuPage.tsx`)
