# soumadip-dev/bitebox architecture

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

- Interactive diagram: https://gitdiagram.com/soumadip-dev/bitebox
- Repository: https://github.com/soumadip-dev/bitebox

## Overview

BiteBox is a role-based food-delivery application: customers discover restaurants and items, check out and track orders; owners maintain menus and order status; delivery workers accept assignments and complete deliveries. The server exposes these domains through Express routes and controller/service layers, with MongoDB-backed models and Socket.IO for realtime updates. The README documents payment, email, OAuth, image hosting, and map capabilities; where their wiring was not sampled, links are limited to explicit evidence.

Main entry points: [`client/src/App.jsx`](https://github.com/soumadip-dev/bitebox/blob/main/client/src/App.jsx) (React application), [`server/src/model/order.model.js`](https://github.com/soumadip-dev/bitebox/blob/main/server/src/model/order.model.js) (Domain models), [`server/src/app.js`](https://github.com/soumadip-dev/bitebox/blob/main/server/src/app.js) (Express application), [`server/src/controller/item.controller.js`](https://github.com/soumadip-dev/bitebox/blob/main/server/src/controller/item.controller.js) (Item controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_app["React application<br/>[App.jsx]"]
  node_browse["Restaurant and item discovery<br/>[Home.jsx]"]
  node_checkout["Cart and checkout<br/>[CheckOut.jsx]"]
  node_customer_orders["Order history and tracking<br/>[TrackOrderPage.jsx]"]
  node_owner_ui["Owner management<br/>[OwnerDashboard.jsx]"]
  node_courier_ui["Delivery dashboard and tracking"]
  node_client_api["Client API modules<br/>[orderApi.js]"]
end

subgraph group_api["Backend API"]
  node_backend["Express application<br/>[app.js]"]
  node_auth_routes["Authentication routes<br/>[auth.routes.js]"]
  node_item_routes["Item routes<br/>[item.routes.js]"]
  node_order_routes["Order routes<br/>[order.routes.js]"]
  node_auth_controller["Authentication controller<br/>[auth.controller.js]"]
  node_item_controller["Item controller<br/>[item.controller.js]"]
  node_order_controller["Order controller"]
end

subgraph group_domain["Order and catalog"]
  node_auth_service["Authentication service<br/>[auth.service.js]"]
  node_item_service["Item service<br/>[item.service.js]"]
  node_order_service["Order service<br/>[order.service.js]"]
  node_models["Domain models<br/>[order.model.js]"]
end

subgraph group_integrations["External services"]
  node_mongo[("MongoDB")]
  node_socket["Socket.IO server<br/>[socket.js]"]
  node_payment["Razorpay"]
  node_cloudinary["Cloudinary image storage"]
  node_mail["Brevo mail service"]
  node_geo["Geoapify geocoding"]
end

node_customer(("Customer"))
node_owner(("Restaurant owner"))
node_courier(("Delivery worker"))

node_customer -->|"uses"| node_app
node_owner -->|"uses"| node_app
node_courier -->|"uses"| node_app
node_app -->|"routes to"| node_browse
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_customer_orders
node_app -->|"loads dashboard"| node_owner_ui
node_app -->|"loads dashboard"| node_courier_ui
node_app -->|"connects"| node_socket
node_app -.->|"geocodes location"| node_geo
node_backend -->|"mounts"| node_auth_routes
node_backend -->|"mounts"| node_item_routes
node_backend -->|"mounts"| node_order_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_item_routes -->|"dispatches"| node_item_controller
node_order_routes -->|"dispatches"| node_order_controller
node_auth_controller -->|"calls"| node_auth_service
node_item_controller -->|"calls"| node_item_service
node_order_controller -->|"calls"| node_order_service
node_auth_service -->|"reads and writes"| node_models
node_item_service -->|"reads and writes"| node_models
node_order_service -->|"reads and writes"| node_models
node_models -->|"persists"| node_mongo
node_item_controller -.->|"uploads images"| node_cloudinary
node_order_controller -.->|"sends OTP mail"| node_mail
node_checkout -.->|"supports payment"| node_payment

click node_app "https://github.com/soumadip-dev/bitebox/blob/main/client/src/App.jsx"
click node_browse "https://github.com/soumadip-dev/bitebox/blob/main/client/src/pages/Home.jsx"
click node_checkout "https://github.com/soumadip-dev/bitebox/blob/main/client/src/pages/CheckOut.jsx"
click node_customer_orders "https://github.com/soumadip-dev/bitebox/blob/main/client/src/pages/TrackOrderPage.jsx"
click node_owner_ui "https://github.com/soumadip-dev/bitebox/blob/main/client/src/components/OwnerDashboard.jsx"
click node_courier_ui "https://github.com/soumadip-dev/bitebox/blob/main/client/src/components/DeliveryBoyDashboard.jsx"
click node_client_api "https://github.com/soumadip-dev/bitebox/blob/main/client/src/api/orderApi.js"
click node_backend "https://github.com/soumadip-dev/bitebox/blob/main/server/src/app.js"
click node_auth_routes "https://github.com/soumadip-dev/bitebox/blob/main/server/src/routes/auth.routes.js"
click node_item_routes "https://github.com/soumadip-dev/bitebox/blob/main/server/src/routes/item.routes.js"
click node_order_routes "https://github.com/soumadip-dev/bitebox/blob/main/server/src/routes/order.routes.js"
click node_auth_controller "https://github.com/soumadip-dev/bitebox/blob/main/server/src/controller/auth.controller.js"
click node_item_controller "https://github.com/soumadip-dev/bitebox/blob/main/server/src/controller/item.controller.js"
click node_order_controller "https://github.com/soumadip-dev/bitebox/blob/main/server/src/controller/order.controller.js"
click node_auth_service "https://github.com/soumadip-dev/bitebox/blob/main/server/src/services/auth.service.js"
click node_item_service "https://github.com/soumadip-dev/bitebox/blob/main/server/src/services/item.service.js"
click node_order_service "https://github.com/soumadip-dev/bitebox/blob/main/server/src/services/order.service.js"
click node_models "https://github.com/soumadip-dev/bitebox/blob/main/server/src/model/order.model.js"
click node_socket "https://github.com/soumadip-dev/bitebox/blob/main/server/src/socket.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_browse,node_checkout,node_customer_orders,node_owner_ui,node_courier_ui,node_client_api toneBlue
class node_backend,node_auth_routes,node_item_routes,node_order_routes,node_auth_controller,node_item_controller,node_order_controller toneAmber
class node_auth_service,node_item_service,node_order_service,node_models toneMint
class node_mongo,node_socket,node_payment,node_cloudinary,node_mail,node_geo,node_courier toneRose
class node_customer,node_owner toneIndigo
```

## Components

### Client experience

- [React application](https://github.com/soumadip-dev/bitebox/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Restaurant and item discovery](https://github.com/soumadip-dev/bitebox/blob/main/client/src/pages/Home.jsx): `client/src/pages/Home.jsx`
- [Cart and checkout](https://github.com/soumadip-dev/bitebox/blob/main/client/src/pages/CheckOut.jsx): `client/src/pages/CheckOut.jsx`
- [Order history and tracking](https://github.com/soumadip-dev/bitebox/blob/main/client/src/pages/TrackOrderPage.jsx): `client/src/pages/TrackOrderPage.jsx`
- [Owner management](https://github.com/soumadip-dev/bitebox/blob/main/client/src/components/OwnerDashboard.jsx): `client/src/components/OwnerDashboard.jsx`
- [Delivery dashboard and tracking](https://github.com/soumadip-dev/bitebox/blob/main/client/src/components/DeliveryBoyDashboard.jsx): `client/src/components/DeliveryBoyDashboard.jsx`
- [Client API modules](https://github.com/soumadip-dev/bitebox/blob/main/client/src/api/orderApi.js): `client/src/api/orderApi.js`

### Backend API

- [Express application](https://github.com/soumadip-dev/bitebox/blob/main/server/src/app.js): `server/src/app.js`
- [Authentication routes](https://github.com/soumadip-dev/bitebox/blob/main/server/src/routes/auth.routes.js): `server/src/routes/auth.routes.js`
- [Item routes](https://github.com/soumadip-dev/bitebox/blob/main/server/src/routes/item.routes.js): `server/src/routes/item.routes.js`
- [Order routes](https://github.com/soumadip-dev/bitebox/blob/main/server/src/routes/order.routes.js): `server/src/routes/order.routes.js`
- [Authentication controller](https://github.com/soumadip-dev/bitebox/blob/main/server/src/controller/auth.controller.js): `server/src/controller/auth.controller.js`
- [Item controller](https://github.com/soumadip-dev/bitebox/blob/main/server/src/controller/item.controller.js): `server/src/controller/item.controller.js`
- [Order controller](https://github.com/soumadip-dev/bitebox/blob/main/server/src/controller/order.controller.js): `server/src/controller/order.controller.js`

### Order and catalog

- [Authentication service](https://github.com/soumadip-dev/bitebox/blob/main/server/src/services/auth.service.js): `server/src/services/auth.service.js`
- [Item service](https://github.com/soumadip-dev/bitebox/blob/main/server/src/services/item.service.js): `server/src/services/item.service.js`
- [Order service](https://github.com/soumadip-dev/bitebox/blob/main/server/src/services/order.service.js): `server/src/services/order.service.js`
- [Domain models](https://github.com/soumadip-dev/bitebox/blob/main/server/src/model/order.model.js): `server/src/model/order.model.js`

### External services

- **MongoDB**
- [Socket.IO server](https://github.com/soumadip-dev/bitebox/blob/main/server/src/socket.js): `server/src/socket.js`
- **Razorpay**
- **Cloudinary image storage**
- **Brevo mail service**
- **Geoapify geocoding**

### Other components

- **Customer**
- **Restaurant owner**
- **Delivery worker**

## Connections

- Customer → React application: uses
- Restaurant owner → React application: uses
- Delivery worker → React application: uses
- React application → Restaurant and item discovery: routes to
- React application → Cart and checkout: routes to
- React application → Order history and tracking: routes to
- React application → Owner management: loads dashboard
- React application → Delivery dashboard and tracking: loads dashboard
- React application → Socket.IO server: connects
- React application → Geoapify geocoding: geocodes location
- Express application → Authentication routes: mounts
- Express application → Item routes: mounts
- Express application → Order routes: mounts
- Authentication routes → Authentication controller: dispatches
- Item routes → Item controller: dispatches
- Order routes → Order controller: dispatches
- Authentication controller → Authentication service: calls
- Item controller → Item service: calls
- Order controller → Order service: calls
- Authentication service → Domain models: reads and writes
- Item service → Domain models: reads and writes
- Order service → Domain models: reads and writes
- Domain models → MongoDB: persists
- Item controller → Cloudinary image storage: uploads images
- Order controller → Brevo mail service: sends OTP mail
- Cart and checkout → Razorpay: supports payment
