# kavibalan1904/food-delivery-platform architecture

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

- Interactive diagram: https://gitdiagram.com/kavibalan1904/food-delivery-platform
- Repository: https://github.com/kavibalan1904/food-delivery-platform

## Overview

SwiftBite is a Chennai food-delivery platform. Customers discover restaurants and dishes, browse menus, authenticate, place orders, and track order progress; restaurant partners manage order-status updates. The React app provides these experiences through a FastAPI API, whose route handlers read and write a shared MongoDB or in-memory database. The graph includes the documented customer and partner capabilities, but several page implementations were only partially sampled, so some UI-to-API links rely on the README rather than inspected call sites.

Main entry points: [`frontend/src/App.jsx`](https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/App.jsx) (App Shell), [`backend/app/routes/restaurants.py`](https://github.com/kavibalan1904/food-delivery-platform/blob/main/backend/app/routes/restaurants.py) (Restaurant & Menu Routes), [`backend/app/routes/orders.py`](https://github.com/kavibalan1904/food-delivery-platform/blob/main/backend/app/routes/orders.py) (Order Routes), [`backend/app/database.py`](https://github.com/kavibalan1904/food-delivery-platform/blob/main/backend/app/database.py) (Database & Seed Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Customer Web App"]
  node_app["App Shell<br/>[App.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_home["Restaurant Discovery<br/>[HomePage.jsx]"]
  node_restaurant["Restaurant Menu<br/>[RestaurantPage.jsx]"]
  node_cart["Shopping Cart<br/>[CartSidebar.jsx]"]
  node_authmodal["Authentication UI<br/>[AuthModal.jsx]"]
  node_orderspage["Order Tracking<br/>[OrdersPage.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
  node_toasts["Notifications<br/>[ToastContainer.jsx]"]
end

subgraph group_partner["Partner Operations"]
  node_dashboard["Partner Dashboard"]
end

subgraph group_api["Backend API"]
  node_api["FastAPI Application<br/>[main.py]"]
  node_auth["Authentication Routes<br/>[auth.py]"]
  node_restaurants["Restaurant &amp; Menu Routes<br/>[restaurants.py]"]
  node_orders["Order Routes<br/>[orders.py]"]
end

subgraph group_data["Persistence"]
  node_database["Database &amp; Seed Data<br/>[database.py]"]
end

node_customer(("Customer"))
node_partneruser(("Restaurant Partner"))
node_mongo[("MongoDB")]

node_customer -->|"uses"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_restaurant
node_app -->|"routes to"| node_orderspage
node_app -->|"renders"| node_cart
node_app -->|"renders"| node_authmodal
node_app -->|"renders"| node_footer
node_app -->|"renders"| node_toasts
node_home -->|"fetches listings"| node_restaurants
node_home -->|"fetches trending"| node_restaurants
node_restaurant -.->|"loads menu"| node_restaurants
node_cart -.->|"places order"| node_orders
node_authmodal -->|"registers or logs in"| node_auth
node_orderspage -.->|"loads order history"| node_orders
node_partneruser -->|"manages orders"| node_dashboard
node_dashboard -->|"updates status"| node_orders
node_api -->|"registers router"| node_auth
node_api -->|"registers router"| node_restaurants
node_api -->|"registers router"| node_orders
node_api -->|"connects and seeds"| node_database
node_auth -->|"reads and writes users"| node_database
node_restaurants -->|"reads restaurants and menus"| node_database
node_orders -->|"reads and writes orders"| node_database
node_database -.->|"uses when available"| node_mongo

click node_app "https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/App.jsx"
click node_navbar "https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/components/Navbar.jsx"
click node_home "https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/pages/HomePage.jsx"
click node_restaurant "https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/pages/RestaurantPage.jsx"
click node_cart "https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/components/CartSidebar.jsx"
click node_authmodal "https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/components/AuthModal.jsx"
click node_orderspage "https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/pages/OrdersPage.jsx"
click node_footer "https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/components/Footer.jsx"
click node_toasts "https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/components/ToastContainer.jsx"
click node_dashboard "https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/pages/PartnerDashboard.jsx"
click node_api "https://github.com/kavibalan1904/food-delivery-platform/blob/main/backend/main.py"
click node_auth "https://github.com/kavibalan1904/food-delivery-platform/blob/main/backend/app/routes/auth.py"
click node_restaurants "https://github.com/kavibalan1904/food-delivery-platform/blob/main/backend/app/routes/restaurants.py"
click node_orders "https://github.com/kavibalan1904/food-delivery-platform/blob/main/backend/app/routes/orders.py"
click node_database "https://github.com/kavibalan1904/food-delivery-platform/blob/main/backend/app/database.py"

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_navbar,node_home,node_restaurant,node_cart,node_authmodal,node_orderspage,node_footer,node_toasts toneBlue
class node_dashboard,node_mongo toneAmber
class node_api,node_auth,node_restaurants,node_orders toneMint
class node_database toneRose
class node_customer,node_partneruser toneIndigo
```

## Components

### Customer Web App

- [App Shell](https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Navigation](https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/components/Navbar.jsx): `frontend/src/components/Navbar.jsx`
- [Restaurant Discovery](https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/pages/HomePage.jsx): `frontend/src/pages/HomePage.jsx`
- [Restaurant Menu](https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/pages/RestaurantPage.jsx): `frontend/src/pages/RestaurantPage.jsx`
- [Shopping Cart](https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/components/CartSidebar.jsx): `frontend/src/components/CartSidebar.jsx`
- [Authentication UI](https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/components/AuthModal.jsx): `frontend/src/components/AuthModal.jsx`
- [Order Tracking](https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/pages/OrdersPage.jsx): `frontend/src/pages/OrdersPage.jsx`
- [Footer](https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/components/Footer.jsx): `frontend/src/components/Footer.jsx`
- [Notifications](https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/components/ToastContainer.jsx): `frontend/src/components/ToastContainer.jsx`

### Partner Operations

- [Partner Dashboard](https://github.com/kavibalan1904/food-delivery-platform/blob/main/frontend/src/pages/PartnerDashboard.jsx): `frontend/src/pages/PartnerDashboard.jsx`

### Backend API

- [FastAPI Application](https://github.com/kavibalan1904/food-delivery-platform/blob/main/backend/main.py): `backend/main.py`
- [Authentication Routes](https://github.com/kavibalan1904/food-delivery-platform/blob/main/backend/app/routes/auth.py): `backend/app/routes/auth.py`
- [Restaurant & Menu Routes](https://github.com/kavibalan1904/food-delivery-platform/blob/main/backend/app/routes/restaurants.py): `backend/app/routes/restaurants.py`
- [Order Routes](https://github.com/kavibalan1904/food-delivery-platform/blob/main/backend/app/routes/orders.py): `backend/app/routes/orders.py`

### Persistence

- [Database & Seed Data](https://github.com/kavibalan1904/food-delivery-platform/blob/main/backend/app/database.py): `backend/app/database.py`

### Other components

- **Customer**
- **Restaurant Partner**
- **MongoDB**

## Connections

- Customer → App Shell: uses (evidence: `README.md`)
- App Shell → Navigation: renders (evidence: `frontend/src/App.jsx`)
- App Shell → Restaurant Discovery: routes to (evidence: `frontend/src/App.jsx`)
- App Shell → Restaurant Menu: routes to (evidence: `frontend/src/App.jsx`)
- App Shell → Order Tracking: routes to (evidence: `frontend/src/App.jsx`)
- App Shell → Shopping Cart: renders (evidence: `frontend/src/App.jsx`)
- App Shell → Authentication UI: renders (evidence: `frontend/src/App.jsx`)
- App Shell → Footer: renders (evidence: `frontend/src/App.jsx`)
- App Shell → Notifications: renders (evidence: `frontend/src/App.jsx`)
- Restaurant Discovery → Restaurant & Menu Routes: fetches listings (evidence: `frontend/src/pages/HomePage.jsx`)
- Restaurant Discovery → Restaurant & Menu Routes: fetches trending (evidence: `frontend/src/pages/HomePage.jsx`)
- Restaurant Menu → Restaurant & Menu Routes: loads menu (evidence: `README.md`)
- Shopping Cart → Order Routes: places order (evidence: `README.md`)
- Authentication UI → Authentication Routes: registers or logs in (evidence: `frontend/src/components/AuthModal.jsx`)
- Order Tracking → Order Routes: loads order history (evidence: `README.md`)
- Restaurant Partner → Partner Dashboard: manages orders (evidence: `README.md`)
- Partner Dashboard → Order Routes: updates status (evidence: `frontend/src/pages/PartnerDashboard.jsx`)
- FastAPI Application → Authentication Routes: registers router (evidence: `backend/main.py`)
- FastAPI Application → Restaurant & Menu Routes: registers router (evidence: `backend/main.py`)
- FastAPI Application → Order Routes: registers router (evidence: `backend/main.py`)
- FastAPI Application → Database & Seed Data: connects and seeds (evidence: `backend/main.py`)
- Authentication Routes → Database & Seed Data: reads and writes users (evidence: `backend/app/routes/auth.py`)
- Restaurant & Menu Routes → Database & Seed Data: reads restaurants and menus (evidence: `backend/app/routes/restaurants.py`)
- Order Routes → Database & Seed Data: reads and writes orders (evidence: `backend/app/routes/orders.py`)
- Database & Seed Data → MongoDB: uses when available (evidence: `README.md`)
