# solohater/food-delivery-platform architecture

> Architecture diagram of the GitHub repository solohater/food-delivery-platform, 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/solohater/food-delivery-platform
- Repository: https://github.com/solohater/food-delivery-platform

## Overview

This is a food-ordering and delivery product: customers browse restaurants and menus, add items to a cart, submit an order and payment, then follow orders; drivers can view and update deliveries. The web client calls a NestJS API through shared HTTP routes, with separate services for auth, restaurants, menus, orders, payments, delivery, users, and notifications. Checkout's order-then-payment sequence is visible in the client. Server-side cross-service orchestration and event producers are not shown, so those relationships are omitted; unexcerpted capability modules are represented from the tree and index.

Main entry points: [`web/src/services/api.ts`](https://github.com/solohater/food-delivery-platform/blob/main/web/src/services/api.ts) (API client), [`api/apps/order/src/order.controller.ts`](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/order/src/order.controller.ts) (Order API), [`api/apps/user/src/user.service.ts`](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/user/src/user.service.ts) (Profile service), [`web/src/App.tsx`](https://github.com/solohater/food-delivery-platform/blob/main/web/src/App.tsx) (Web routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web client"]
  node_app["Web routes<br/>[App.tsx]"]
  node_authstate["Auth state<br/>[AuthContext.tsx]"]
  node_apiclient["API client<br/>[api.ts]"]
  node_browse["Restaurant browsing"]
  node_restaurantdetail["Restaurant detail"]
  node_cart["Cart<br/>[CartPage.tsx]"]
  node_checkout["Checkout<br/>[CheckoutPage.tsx]"]
  node_orderhistory["Order history<br/>[OrdersPage.tsx]"]
  node_driverui["Delivery view<br/>[DeliveriesPage.tsx]"]
  node_profileui["Profile view<br/>[ProfilePage.tsx]"]
end

subgraph group_catalog["Restaurant catalog"]
  node_restaurantapi["Restaurant API"]
  node_restaurantservice["Restaurant service"]
  node_restaurantdata[("Restaurant records")]
  node_menuapi["Menu API<br/>[menu.controller.ts]"]
  node_menuservice["Menu service<br/>[menu.service.ts]"]
  node_menudata[("Menu items")]
end

subgraph group_commerce["Order and payment"]
  node_orderapi["Order API"]
  node_orderservice["Order service<br/>[order.service.ts]"]
  node_orderdata[("Orders<br/>[order.entity.ts]")]
  node_orderitems[("Order items")]
  node_paymentapi["Payment API"]
  node_paymentservice["Payment service<br/>[payment.service.ts]"]
  node_paymentdata[("Payments<br/>[payment.entity.ts]")]
end

subgraph group_identity["Identity and profile"]
  node_authapi["Authentication<br/>[auth.controller.ts]"]
  node_authservice["Auth service<br/>[auth.service.ts]"]
  node_userstore[("Auth users<br/>[user.entity.ts]")]
  node_userapi["User profiles<br/>[user.controller.ts]"]
  node_userservice["Profile service<br/>[user.service.ts]"]
  node_profilestore[("Profile records")]
  node_addressstore[("Addresses<br/>[address.entity.ts]")]
end

subgraph group_operations["Delivery and messaging"]
  node_deliveryapi["Delivery API"]
  node_deliveryservice["Delivery service"]
end

node_customer(("Customer"))
node_driver(("Driver"))

node_customer -->|"uses"| node_app
node_driver -->|"uses"| node_app
node_app -->|"reads auth"| node_authstate
node_authstate -->|"requests profile"| node_apiclient
node_browse -->|"loads restaurants"| node_apiclient
node_restaurantdetail -->|"loads menu"| node_apiclient
node_checkout -->|"creates order"| node_apiclient
node_checkout -->|"processes payment"| node_apiclient
node_orderhistory -->|"loads orders"| node_apiclient
node_driverui -->|"loads deliveries"| node_apiclient
node_profileui -->|"loads profile"| node_apiclient
node_apiclient -->|"HTTP auth"| node_authapi
node_apiclient -->|"HTTP catalog"| node_restaurantapi
node_apiclient -->|"HTTP menu"| node_menuapi
node_apiclient -->|"HTTP orders"| node_orderapi
node_apiclient -->|"HTTP payment"| node_paymentapi
node_apiclient -->|"HTTP delivery"| node_deliveryapi
node_apiclient -->|"HTTP profiles"| node_userapi
node_authapi -->|"delegates"| node_authservice
node_authservice -->|"reads/writes"| node_userstore
node_restaurantapi -->|"delegates"| node_restaurantservice
node_menuapi -->|"delegates"| node_menuservice
node_orderapi -->|"delegates"| node_orderservice
node_orderapi -->|"uses status"| node_orderdata
node_paymentapi -->|"delegates"| node_paymentservice
node_deliveryapi -->|"delegates"| node_deliveryservice
node_userapi -->|"delegates"| node_userservice
node_userservice -->|"reads/writes"| node_profilestore
node_userservice -->|"reads/writes"| node_addressstore

click node_app "https://github.com/solohater/food-delivery-platform/blob/main/web/src/App.tsx"
click node_authstate "https://github.com/solohater/food-delivery-platform/blob/main/web/src/context/AuthContext.tsx"
click node_apiclient "https://github.com/solohater/food-delivery-platform/blob/main/web/src/services/api.ts"
click node_browse "https://github.com/solohater/food-delivery-platform/blob/main/web/src/pages/RestaurantsPage.tsx"
click node_restaurantdetail "https://github.com/solohater/food-delivery-platform/blob/main/web/src/pages/RestaurantDetailPage.tsx"
click node_cart "https://github.com/solohater/food-delivery-platform/blob/main/web/src/pages/CartPage.tsx"
click node_checkout "https://github.com/solohater/food-delivery-platform/blob/main/web/src/pages/CheckoutPage.tsx"
click node_orderhistory "https://github.com/solohater/food-delivery-platform/blob/main/web/src/pages/OrdersPage.tsx"
click node_driverui "https://github.com/solohater/food-delivery-platform/blob/main/web/src/pages/DeliveriesPage.tsx"
click node_profileui "https://github.com/solohater/food-delivery-platform/blob/main/web/src/pages/ProfilePage.tsx"
click node_authapi "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/auth/src/auth.controller.ts"
click node_authservice "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/auth/src/auth.service.ts"
click node_userstore "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/auth/src/user.entity.ts"
click node_userapi "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/user/src/user.controller.ts"
click node_userservice "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/user/src/user.service.ts"
click node_profilestore "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/user/src/user-profile.entity.ts"
click node_addressstore "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/user/src/address.entity.ts"
click node_restaurantapi "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/restaurant/src/restaurant.controller.ts"
click node_restaurantservice "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/restaurant/src/restaurant.service.ts"
click node_restaurantdata "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/restaurant/src/restaurant.entity.ts"
click node_menuapi "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/menu/src/menu.controller.ts"
click node_menuservice "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/menu/src/menu.service.ts"
click node_menudata "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/menu/src/menu-item.schema.ts"
click node_orderapi "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/order/src/order.controller.ts"
click node_orderservice "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/order/src/order.service.ts"
click node_orderdata "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/order/src/order.entity.ts"
click node_orderitems "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/order/src/order-item.entity.ts"
click node_paymentapi "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/payment/src/payment.controller.ts"
click node_paymentservice "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/payment/src/payment.service.ts"
click node_paymentdata "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/payment/src/payment.entity.ts"
click node_deliveryapi "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/delivery/src/delivery.controller.ts"
click node_deliveryservice "https://github.com/solohater/food-delivery-platform/blob/main/api/apps/delivery/src/delivery.service.ts"

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_authstate,node_apiclient,node_browse,node_restaurantdetail,node_cart,node_checkout,node_orderhistory,node_driverui,node_profileui toneBlue
class node_restaurantapi,node_restaurantservice,node_restaurantdata,node_menuapi,node_menuservice,node_menudata toneAmber
class node_orderapi,node_orderservice,node_orderdata,node_orderitems,node_paymentapi,node_paymentservice,node_paymentdata toneMint
class node_authapi,node_authservice,node_userstore,node_userapi,node_userservice,node_profilestore,node_addressstore toneRose
class node_deliveryapi,node_deliveryservice,node_customer,node_driver toneIndigo
```

## Components

### Web client

- [Web routes](https://github.com/solohater/food-delivery-platform/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Auth state](https://github.com/solohater/food-delivery-platform/blob/main/web/src/context/AuthContext.tsx): `web/src/context/AuthContext.tsx`
- [API client](https://github.com/solohater/food-delivery-platform/blob/main/web/src/services/api.ts): `web/src/services/api.ts`
- [Restaurant browsing](https://github.com/solohater/food-delivery-platform/blob/main/web/src/pages/RestaurantsPage.tsx): `web/src/pages/RestaurantsPage.tsx`
- [Restaurant detail](https://github.com/solohater/food-delivery-platform/blob/main/web/src/pages/RestaurantDetailPage.tsx): `web/src/pages/RestaurantDetailPage.tsx`
- [Cart](https://github.com/solohater/food-delivery-platform/blob/main/web/src/pages/CartPage.tsx): `web/src/pages/CartPage.tsx`
- [Checkout](https://github.com/solohater/food-delivery-platform/blob/main/web/src/pages/CheckoutPage.tsx): `web/src/pages/CheckoutPage.tsx`
- [Order history](https://github.com/solohater/food-delivery-platform/blob/main/web/src/pages/OrdersPage.tsx): `web/src/pages/OrdersPage.tsx`
- [Delivery view](https://github.com/solohater/food-delivery-platform/blob/main/web/src/pages/DeliveriesPage.tsx): `web/src/pages/DeliveriesPage.tsx`
- [Profile view](https://github.com/solohater/food-delivery-platform/blob/main/web/src/pages/ProfilePage.tsx): `web/src/pages/ProfilePage.tsx`

### Restaurant catalog

- [Restaurant API](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/restaurant/src/restaurant.controller.ts): `api/apps/restaurant/src/restaurant.controller.ts`
- [Restaurant service](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/restaurant/src/restaurant.service.ts): `api/apps/restaurant/src/restaurant.service.ts`
- [Restaurant records](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/restaurant/src/restaurant.entity.ts): `api/apps/restaurant/src/restaurant.entity.ts`
- [Menu API](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/menu/src/menu.controller.ts): `api/apps/menu/src/menu.controller.ts`
- [Menu service](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/menu/src/menu.service.ts): `api/apps/menu/src/menu.service.ts`
- [Menu items](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/menu/src/menu-item.schema.ts): `api/apps/menu/src/menu-item.schema.ts`

### Order and payment

- [Order API](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/order/src/order.controller.ts): `api/apps/order/src/order.controller.ts`
- [Order service](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/order/src/order.service.ts): `api/apps/order/src/order.service.ts`
- [Orders](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/order/src/order.entity.ts): `api/apps/order/src/order.entity.ts`
- [Order items](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/order/src/order-item.entity.ts): `api/apps/order/src/order-item.entity.ts`
- [Payment API](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/payment/src/payment.controller.ts): `api/apps/payment/src/payment.controller.ts`
- [Payment service](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/payment/src/payment.service.ts): `api/apps/payment/src/payment.service.ts`
- [Payments](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/payment/src/payment.entity.ts): `api/apps/payment/src/payment.entity.ts`

### Identity and profile

- [Authentication](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/auth/src/auth.controller.ts): `api/apps/auth/src/auth.controller.ts`
- [Auth service](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/auth/src/auth.service.ts): `api/apps/auth/src/auth.service.ts`
- [Auth users](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/auth/src/user.entity.ts): `api/apps/auth/src/user.entity.ts`
- [User profiles](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/user/src/user.controller.ts): `api/apps/user/src/user.controller.ts`
- [Profile service](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/user/src/user.service.ts): `api/apps/user/src/user.service.ts`
- [Profile records](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/user/src/user-profile.entity.ts): `api/apps/user/src/user-profile.entity.ts`
- [Addresses](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/user/src/address.entity.ts): `api/apps/user/src/address.entity.ts`

### Delivery and messaging

- [Delivery API](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/delivery/src/delivery.controller.ts): `api/apps/delivery/src/delivery.controller.ts`
- [Delivery service](https://github.com/solohater/food-delivery-platform/blob/main/api/apps/delivery/src/delivery.service.ts): `api/apps/delivery/src/delivery.service.ts`

### Other components

- **Customer**
- **Driver**

## Connections

- Customer → Web routes: uses (evidence: `web/src/App.tsx`)
- Driver → Web routes: uses (evidence: `web/src/App.tsx`)
- Web routes → Auth state: reads auth (evidence: `web/src/App.tsx`)
- Auth state → API client: requests profile (evidence: `web/src/context/AuthContext.tsx`)
- Restaurant browsing → API client: loads restaurants (evidence: `web/src/services/api.ts`)
- Restaurant detail → API client: loads menu (evidence: `web/src/services/api.ts`)
- Checkout → API client: creates order (evidence: `web/src/pages/CheckoutPage.tsx`)
- Checkout → API client: processes payment (evidence: `web/src/pages/CheckoutPage.tsx`)
- Order history → API client: loads orders (evidence: `web/src/services/api.ts`)
- Delivery view → API client: loads deliveries (evidence: `web/src/services/api.ts`)
- Profile view → API client: loads profile (evidence: `web/src/services/api.ts`)
- API client → Authentication: HTTP auth (evidence: `web/src/services/api.ts`)
- API client → Restaurant API: HTTP catalog (evidence: `web/src/services/api.ts`)
- API client → Menu API: HTTP menu (evidence: `web/src/services/api.ts`)
- API client → Order API: HTTP orders (evidence: `web/src/services/api.ts`)
- API client → Payment API: HTTP payment (evidence: `web/src/services/api.ts`)
- API client → Delivery API: HTTP delivery (evidence: `web/src/services/api.ts`)
- API client → User profiles: HTTP profiles (evidence: `web/src/services/api.ts`)
- Authentication → Auth service: delegates (evidence: `api/apps/auth/src/auth.controller.ts`)
- Auth service → Auth users: reads/writes (evidence: `api/apps/auth/src/auth.service.ts`)
- Restaurant API → Restaurant service: delegates (evidence: `api/apps/restaurant/src/restaurant.controller.ts`)
- Menu API → Menu service: delegates (evidence: `api/apps/menu/src/menu.controller.ts`)
- Order API → Order service: delegates (evidence: `api/apps/order/src/order.controller.ts`)
- Order API → Orders: uses status (evidence: `api/apps/order/src/order.controller.ts`)
- Payment API → Payment service: delegates (evidence: `api/apps/payment/src/payment.controller.ts`)
- Delivery API → Delivery service: delegates (evidence: `api/apps/delivery/src/delivery.controller.ts`)
- User profiles → Profile service: delegates (evidence: `api/apps/user/src/user.controller.ts`)
- Profile service → Profile records: reads/writes (evidence: `api/apps/user/src/user.service.ts`)
- Profile service → Addresses: reads/writes (evidence: `api/apps/user/src/user.service.ts`)
