# babireddy009/restaurant-app-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/babireddy009/restaurant-app-frontend
- Repository: https://github.com/babireddy009/restaurant-app-frontend

## Overview

This is a restaurant ordering frontend with customer, staff, and driver experiences. Customers browse the menu, add food to a persistent cart, check out and pay, then track orders and contact delivery; staff manage orders and analytics, while drivers handle delivery workflows. The sampled code establishes routing, shared auth/cart state, API access, and several page-to-feature calls. Other page and integration details are represented only where the source index or excerpts support them; the README is still the generic Vite template.

Main entry points: [`src/App.jsx`](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/App.jsx) (Routes and layouts), [`src/api/endpoints.js`](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/api/endpoints.js) (API operations), [`src/context/AuthContext.jsx`](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/context/AuthContext.jsx) (Authentication state), [`src/pages/CheckoutPage.jsx`](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/CheckoutPage.jsx) (Checkout and payment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app["Routes and layouts<br/>[App.jsx]"]
  node_driver_layout["Driver layout<br/>[DriverLayout.jsx]"]
end

subgraph group_customer["Customer ordering"]
  node_home["Home<br/>[HomePage.jsx]"]
  node_menu["Menu<br/>[MenuPage.jsx]"]
  node_gallery["Gallery<br/>[GalleryPage.jsx]"]
  node_food_card["Food card<br/>[FoodCard.jsx]"]
  node_cart_drawer["Cart drawer<br/>[CartDrawer.jsx]"]
  node_checkout["Checkout and payment<br/>[CheckoutPage.jsx]"]
  node_success["Order confirmation<br/>[SuccessOverlay.jsx]"]
  node_orders["Order history<br/>[OrdersPage.jsx]"]
  node_order_detail["Order tracking"]
end

subgraph group_operations["Order operations"]
  node_delivery_chat["Delivery chat<br/>[DeliveryChat.jsx]"]
  node_staff_dashboard["Staff order desk<br/>[StaffDashboard.jsx]"]
  node_analytics["Staff analytics<br/>[AnalyticsPage.jsx]"]
  node_driver_login["Driver login<br/>[DriverLogin.jsx]"]
  node_driver_register["Driver registration<br/>[DriverRegister.jsx]"]
  node_driver_dashboard["Driver dashboard"]
  node_driver_portal["Driver order view<br/>[DriverPortal.jsx]"]
end

subgraph group_platform["Shared platform"]
  node_cart_state["Cart state<br/>[CartContext.jsx]"]
  node_login["Customer login<br/>[LoginPage.jsx]"]
  node_register["Customer registration<br/>[RegisterPage.jsx]"]
  node_auth_state["Authentication state<br/>[AuthContext.jsx]"]
  node_endpoints["API operations<br/>[endpoints.js]"]
  node_api_client["HTTP client<br/>[client.js]"]
  node_notification_sound["Notification sound<br/>[audio.js]"]
end

node_customer_actor(("Customer"))
node_staff_actor(("Staff"))
node_driver_actor(("Driver"))
node_backend{{"Restaurant API"}}
node_payment_provider{{"Razorpay"}}

node_customer_actor -.->|"uses"| node_app
node_staff_actor -.->|"uses"| node_app
node_driver_actor -.->|"uses"| node_app
node_app -->|"routes"| node_home
node_app -->|"routes"| node_menu
node_app -->|"routes"| node_gallery
node_app -->|"routes"| node_checkout
node_app -->|"routes"| node_orders
node_app -->|"routes"| node_order_detail
node_app -->|"routes"| node_login
node_app -->|"routes"| node_register
node_app -->|"routes"| node_staff_dashboard
node_app -->|"routes"| node_analytics
node_app -->|"routes"| node_driver_layout
node_app -->|"routes"| node_driver_login
node_app -->|"routes"| node_driver_register
node_app -->|"routes"| node_driver_dashboard
node_app -->|"routes"| node_driver_portal
node_app -->|"provides"| node_auth_state
node_app -->|"provides"| node_cart_state
node_home -->|"loads menu"| node_endpoints
node_home -->|"renders"| node_food_card
node_menu -->|"loads menu"| node_endpoints
node_menu -->|"renders"| node_food_card
node_gallery -->|"loads images"| node_endpoints
node_food_card -->|"adds items"| node_cart_state
node_cart_drawer -->|"reads and updates"| node_cart_state
node_checkout -->|"reads and clears"| node_cart_state
node_checkout -->|"reads user"| node_auth_state
node_checkout -->|"creates and verifies"| node_endpoints
node_checkout -->|"shows"| node_success
node_checkout -.->|"initiates payment"| node_payment_provider
node_orders -->|"loads orders"| node_endpoints
node_orders -->|"uses"| node_cart_state
node_order_detail -->|"loads and updates"| node_endpoints
node_order_detail -->|"opens"| node_delivery_chat
node_delivery_chat -->|"plays"| node_notification_sound
node_login -->|"authenticates"| node_auth_state
node_register -->|"registers"| node_endpoints
node_register -->|"uses"| node_auth_state
node_auth_state -->|"loads profile"| node_endpoints
node_auth_state -->|"auth requests"| node_api_client
node_staff_dashboard -->|"loads and updates"| node_endpoints
node_staff_dashboard -->|"opens"| node_delivery_chat
node_staff_dashboard -->|"plays"| node_notification_sound
node_analytics -->|"loads analytics"| node_endpoints
node_driver_login -->|"authenticates"| node_auth_state
node_driver_register -->|"registers driver"| node_endpoints

click node_app "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/App.jsx"
click node_home "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/HomePage.jsx"
click node_menu "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/MenuPage.jsx"
click node_gallery "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/GalleryPage.jsx"
click node_food_card "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/components/FoodCard.jsx"
click node_cart_state "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/context/CartContext.jsx"
click node_cart_drawer "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/components/CartDrawer.jsx"
click node_checkout "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/CheckoutPage.jsx"
click node_success "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/components/SuccessOverlay.jsx"
click node_orders "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/OrdersPage.jsx"
click node_order_detail "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/OrderDetailPage.jsx"
click node_delivery_chat "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/components/DeliveryChat.jsx"
click node_login "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/LoginPage.jsx"
click node_register "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/RegisterPage.jsx"
click node_auth_state "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/context/AuthContext.jsx"
click node_staff_dashboard "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/StaffDashboard.jsx"
click node_analytics "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/AnalyticsPage.jsx"
click node_driver_login "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/DriverLogin.jsx"
click node_driver_register "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/DriverRegister.jsx"
click node_driver_dashboard "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/DriverDashboard.jsx"
click node_driver_portal "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/DriverPortal.jsx"
click node_driver_layout "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/components/DriverLayout.jsx"
click node_endpoints "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/api/endpoints.js"
click node_api_client "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/api/client.js"
click node_notification_sound "https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/utils/audio.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_app,node_driver_layout toneBlue
class node_home,node_menu,node_gallery,node_food_card,node_cart_drawer,node_checkout,node_success,node_orders,node_order_detail toneAmber
class node_delivery_chat,node_staff_dashboard,node_analytics,node_driver_login,node_driver_register,node_driver_dashboard,node_driver_portal,node_backend toneMint
class node_cart_state,node_login,node_register,node_auth_state,node_endpoints,node_api_client,node_notification_sound toneRose
class node_customer_actor,node_staff_actor,node_driver_actor,node_payment_provider toneIndigo
```

## Components

### Application shell

- [Routes and layouts](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/App.jsx): `src/App.jsx`
- [Driver layout](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/components/DriverLayout.jsx): `src/components/DriverLayout.jsx`

### Customer ordering

- [Home](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/HomePage.jsx): `src/pages/HomePage.jsx`
- [Menu](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/MenuPage.jsx): `src/pages/MenuPage.jsx`
- [Gallery](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/GalleryPage.jsx): `src/pages/GalleryPage.jsx`
- [Food card](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/components/FoodCard.jsx): `src/components/FoodCard.jsx`
- [Cart drawer](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/components/CartDrawer.jsx): `src/components/CartDrawer.jsx`
- [Checkout and payment](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/CheckoutPage.jsx): `src/pages/CheckoutPage.jsx`
- [Order confirmation](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/components/SuccessOverlay.jsx): `src/components/SuccessOverlay.jsx`
- [Order history](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/OrdersPage.jsx): `src/pages/OrdersPage.jsx`
- [Order tracking](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/OrderDetailPage.jsx): `src/pages/OrderDetailPage.jsx`

### Order operations

- [Delivery chat](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/components/DeliveryChat.jsx): `src/components/DeliveryChat.jsx`
- [Staff order desk](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/StaffDashboard.jsx): `src/pages/StaffDashboard.jsx`
- [Staff analytics](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/AnalyticsPage.jsx): `src/pages/AnalyticsPage.jsx`
- [Driver login](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/DriverLogin.jsx): `src/pages/DriverLogin.jsx`
- [Driver registration](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/DriverRegister.jsx): `src/pages/DriverRegister.jsx`
- [Driver dashboard](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/DriverDashboard.jsx): `src/pages/DriverDashboard.jsx`
- [Driver order view](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/DriverPortal.jsx): `src/pages/DriverPortal.jsx`

### Shared platform

- [Cart state](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/context/CartContext.jsx): `src/context/CartContext.jsx`
- [Customer login](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/LoginPage.jsx): `src/pages/LoginPage.jsx`
- [Customer registration](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/pages/RegisterPage.jsx): `src/pages/RegisterPage.jsx`
- [Authentication state](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [API operations](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/api/endpoints.js): `src/api/endpoints.js`
- [HTTP client](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/api/client.js): `src/api/client.js`
- [Notification sound](https://github.com/babireddy009/restaurant-app-frontend/blob/main/src/utils/audio.js): `src/utils/audio.js`

### Other components

- **Customer**
- **Staff**
- **Driver**
- **Restaurant API**
- **Razorpay**

## Connections

- Customer → Routes and layouts: uses
- Staff → Routes and layouts: uses
- Driver → Routes and layouts: uses
- Routes and layouts → Home: routes (evidence: `src/App.jsx`)
- Routes and layouts → Menu: routes (evidence: `src/App.jsx`)
- Routes and layouts → Gallery: routes (evidence: `src/App.jsx`)
- Routes and layouts → Checkout and payment: routes (evidence: `src/App.jsx`)
- Routes and layouts → Order history: routes (evidence: `src/App.jsx`)
- Routes and layouts → Order tracking: routes (evidence: `src/App.jsx`)
- Routes and layouts → Customer login: routes (evidence: `src/App.jsx`)
- Routes and layouts → Customer registration: routes (evidence: `src/App.jsx`)
- Routes and layouts → Staff order desk: routes (evidence: `src/App.jsx`)
- Routes and layouts → Staff analytics: routes (evidence: `src/App.jsx`)
- Routes and layouts → Driver layout: routes (evidence: `src/App.jsx`)
- Routes and layouts → Driver login: routes (evidence: `src/App.jsx`)
- Routes and layouts → Driver registration: routes (evidence: `src/App.jsx`)
- Routes and layouts → Driver dashboard: routes (evidence: `src/App.jsx`)
- Routes and layouts → Driver order view: routes (evidence: `src/App.jsx`)
- Routes and layouts → Authentication state: provides (evidence: `src/App.jsx`)
- Routes and layouts → Cart state: provides (evidence: `src/App.jsx`)
- Home → API operations: loads menu (evidence: `src/pages/HomePage.jsx`)
- Home → Food card: renders (evidence: `src/pages/HomePage.jsx`)
- Menu → API operations: loads menu (evidence: `src/pages/MenuPage.jsx`)
- Menu → Food card: renders (evidence: `src/pages/MenuPage.jsx`)
- Gallery → API operations: loads images (evidence: `src/pages/GalleryPage.jsx`)
- Food card → Cart state: adds items (evidence: `src/components/FoodCard.jsx`)
- Cart drawer → Cart state: reads and updates (evidence: `src/components/CartDrawer.jsx`)
- Checkout and payment → Cart state: reads and clears (evidence: `src/pages/CheckoutPage.jsx`)
- Checkout and payment → Authentication state: reads user (evidence: `src/pages/CheckoutPage.jsx`)
- Checkout and payment → API operations: creates and verifies (evidence: `src/pages/CheckoutPage.jsx`)
- Checkout and payment → Order confirmation: shows (evidence: `src/pages/CheckoutPage.jsx`)
- Checkout and payment → Razorpay: initiates payment
- Order history → API operations: loads orders (evidence: `src/pages/OrdersPage.jsx`)
- Order history → Cart state: uses (evidence: `src/pages/OrdersPage.jsx`)
- Order tracking → API operations: loads and updates (evidence: `src/pages/OrderDetailPage.jsx`)
- Order tracking → Delivery chat: opens (evidence: `src/pages/OrderDetailPage.jsx`)
- Delivery chat → Notification sound: plays (evidence: `src/components/DeliveryChat.jsx`)
- Customer login → Authentication state: authenticates (evidence: `src/pages/LoginPage.jsx`)
- Customer registration → API operations: registers (evidence: `src/pages/RegisterPage.jsx`)
- Customer registration → Authentication state: uses (evidence: `src/pages/RegisterPage.jsx`)
- Authentication state → API operations: loads profile (evidence: `src/context/AuthContext.jsx`)
- Authentication state → HTTP client: auth requests (evidence: `src/context/AuthContext.jsx`)
- Staff order desk → API operations: loads and updates (evidence: `src/pages/StaffDashboard.jsx`)
- Staff order desk → Delivery chat: opens (evidence: `src/pages/StaffDashboard.jsx`)
- Staff order desk → Notification sound: plays (evidence: `src/pages/StaffDashboard.jsx`)
- Staff analytics → API operations: loads analytics (evidence: `src/pages/AnalyticsPage.jsx`)
- Driver login → Authentication state: authenticates (evidence: `src/pages/DriverLogin.jsx`)
- Driver registration → API operations: registers driver (evidence: `src/pages/DriverRegister.jsx`)
