# shashwat-raj-420/food_delivery_app architecture

> Architecture diagram of the GitHub repository shashwat-raj-420/food_delivery_app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shashwat-raj-420/food_delivery_app
- Repository: https://github.com/shashwat-raj-420/food_delivery_app

## Overview

This is a Flutter food-delivery app backed by Firebase. The documented customer flow is authentication, menu browsing, cart management, and order placement; the repository also includes payment and delivery-progress pages, plus settings and theme support. Restaurant/admin product and order management and Firebase-driven updates are documented capabilities, but the supplied source excerpts do not show their wiring. The graph uses README claims and exact paths from the tree; uncertain implementation links are omitted.

Main entry points: [`lib/pages/food_page.dart`](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/pages/food_page.dart) (Food Menu), [`lib/pages/home_page.dart`](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/pages/home_page.dart) (Home Page), [`lib/pages/cart_page.dart`](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/pages/cart_page.dart) (Cart), [`lib/services/database/firestore.dart`](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/services/database/firestore.dart) (Firestore Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Identity"]
  node_auth_flow["Auth Gate<br/>[auth_gate.dart]"]
  node_login_register["Login / Register"]
  node_auth_service["Auth Service<br/>[auth_service.dart]"]
end

subgraph group_ordering["Customer Ordering"]
  node_home["Home Page<br/>[home_page.dart]"]
  node_food_page["Food Menu<br/>[food_page.dart]"]
  node_restaurant_model["Restaurant Model<br/>[restaurant.dart]"]
  node_food_model["Food Model<br/>[food.dart]"]
  node_cart_page["Cart<br/>[cart_page.dart]"]
  node_cart_item["Cart Item<br/>[cart_item.dart]"]
  node_payment_page["Payment<br/>[payment_page.dart]"]
  node_delivery_page["Delivery Progress"]
end

subgraph group_operations["Restaurant Operations"]
  node_admin_management["Product / Order Management"]
end

subgraph group_shared["App Services"]
  node_app_entry["App Entry<br/>[main.dart]"]
  node_firestore_service["Firestore Service<br/>[firestore.dart]"]
  node_settings["Settings<br/>[settings_page.dart]"]
  node_theme_provider["Theme Provider"]
  node_theme_modes["Theme Modes<br/>[light_mode.dart]"]
  node_ui_components["Shared UI Components"]
end

node_customer(("Customer"))
node_restaurant_admin(("Restaurant Admin"))
node_firebase_auth{{"Firebase Auth"}}
node_firestore[("Firestore")]

node_customer -->|"opens app"| node_app_entry
node_app_entry -->|"starts auth"| node_auth_flow
node_auth_flow -->|"routes unauthenticated"| node_login_register
node_login_register -->|"authenticates"| node_auth_service
node_auth_service -->|"uses"| node_firebase_auth
node_auth_flow -->|"opens authenticated"| node_home
node_home -->|"browses menu"| node_food_page
node_food_page -->|"loads menu"| node_firestore_service
node_firestore_service -->|"reads and writes"| node_firestore
node_food_page -->|"displays items"| node_food_model
node_home -->|"uses restaurant data"| node_restaurant_model
node_food_page -->|"adds items"| node_cart_page
node_cart_page -->|"manages quantities"| node_cart_item
node_cart_page -->|"continues to payment"| node_payment_page
node_payment_page -->|"places order"| node_firestore_service
node_customer -->|"views progress"| node_delivery_page
node_restaurant_admin -.->|"manages products and orders"| node_admin_management
node_admin_management -.->|"uses database service"| node_firestore_service
node_firestore -.->|"provides order updates"| node_delivery_page
node_app_entry -->|"provides settings"| node_settings
node_settings -->|"changes theme"| node_theme_provider
node_theme_provider -->|"selects mode"| node_theme_modes
node_home -->|"renders shared UI"| node_ui_components
node_food_page -->|"renders shared UI"| node_ui_components
node_cart_page -->|"renders shared UI"| node_ui_components

click node_app_entry "https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/main.dart"
click node_auth_flow "https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/services/auth/auth_gate.dart"
click node_login_register "https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/services/auth/login_or_register.dart"
click node_auth_service "https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/services/auth/auth_service.dart"
click node_home "https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/pages/home_page.dart"
click node_food_page "https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/pages/food_page.dart"
click node_restaurant_model "https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/models/restaurant.dart"
click node_food_model "https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/models/food.dart"
click node_cart_page "https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/pages/cart_page.dart"
click node_cart_item "https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/models/cart_item.dart"
click node_payment_page "https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/pages/payment_page.dart"
click node_delivery_page "https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/pages/delivery_progess_page.dart"
click node_firestore_service "https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/services/database/firestore.dart"
click node_admin_management "https://github.com/shashwat-raj-420/food_delivery_app/tree/main/lib/services/database"
click node_settings "https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/pages/settings_page.dart"
click node_theme_provider "https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/themes/theme_provider.dart"
click node_theme_modes "https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/themes/light_mode.dart"
click node_ui_components "https://github.com/shashwat-raj-420/food_delivery_app/tree/main/lib/components"

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_auth_flow,node_login_register,node_auth_service toneBlue
class node_home,node_food_page,node_restaurant_model,node_food_model,node_cart_page,node_cart_item,node_payment_page,node_delivery_page,node_firestore toneAmber
class node_admin_management toneMint
class node_app_entry,node_firestore_service,node_settings,node_theme_provider,node_theme_modes,node_ui_components toneRose
class node_customer,node_restaurant_admin,node_firebase_auth toneIndigo
```

## Components

### Identity

- [Auth Gate](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/services/auth/auth_gate.dart): `lib/services/auth/auth_gate.dart`
- [Login / Register](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/services/auth/login_or_register.dart): `lib/services/auth/login_or_register.dart`
- [Auth Service](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/services/auth/auth_service.dart): `lib/services/auth/auth_service.dart`

### Customer Ordering

- [Home Page](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/pages/home_page.dart): `lib/pages/home_page.dart`
- [Food Menu](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/pages/food_page.dart): `lib/pages/food_page.dart`
- [Restaurant Model](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/models/restaurant.dart): `lib/models/restaurant.dart`
- [Food Model](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/models/food.dart): `lib/models/food.dart`
- [Cart](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/pages/cart_page.dart): `lib/pages/cart_page.dart`
- [Cart Item](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/models/cart_item.dart): `lib/models/cart_item.dart`
- [Payment](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/pages/payment_page.dart): `lib/pages/payment_page.dart`
- [Delivery Progress](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/pages/delivery_progess_page.dart): `lib/pages/delivery_progess_page.dart`

### Restaurant Operations

- [Product / Order Management](https://github.com/shashwat-raj-420/food_delivery_app/tree/main/lib/services/database): `lib/services/database`

### App Services

- [App Entry](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/main.dart): `lib/main.dart`
- [Firestore Service](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/services/database/firestore.dart): `lib/services/database/firestore.dart`
- [Settings](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/pages/settings_page.dart): `lib/pages/settings_page.dart`
- [Theme Provider](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/themes/theme_provider.dart): `lib/themes/theme_provider.dart`
- [Theme Modes](https://github.com/shashwat-raj-420/food_delivery_app/blob/main/lib/themes/light_mode.dart): `lib/themes/light_mode.dart`
- [Shared UI Components](https://github.com/shashwat-raj-420/food_delivery_app/tree/main/lib/components): `lib/components`

### Other components

- **Customer**
- **Restaurant Admin**
- **Firebase Auth**
- **Firestore**

## Connections

- Customer → App Entry: opens app
- App Entry → Auth Gate: starts auth
- Auth Gate → Login / Register: routes unauthenticated
- Login / Register → Auth Service: authenticates
- Auth Service → Firebase Auth: uses
- Auth Gate → Home Page: opens authenticated
- Home Page → Food Menu: browses menu
- Food Menu → Firestore Service: loads menu
- Firestore Service → Firestore: reads and writes
- Food Menu → Food Model: displays items
- Home Page → Restaurant Model: uses restaurant data
- Food Menu → Cart: adds items
- Cart → Cart Item: manages quantities
- Cart → Payment: continues to payment
- Payment → Firestore Service: places order
- Customer → Delivery Progress: views progress
- Restaurant Admin → Product / Order Management: manages products and orders
- Product / Order Management → Firestore Service: uses database service
- Firestore → Delivery Progress: provides order updates
- App Entry → Settings: provides settings
- Settings → Theme Provider: changes theme
- Theme Provider → Theme Modes: selects mode
- Home Page → Shared UI Components: renders shared UI
- Food Menu → Shared UI Components: renders shared UI
- Cart → Shared UI Components: renders shared UI
