# abhishek10600/fooddeliveryapplication-advancedbackendlearning architecture

> Architecture diagram of the GitHub repository abhishek10600/fooddeliveryapplication-advancedbackendlearning, 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/abhishek10600/fooddeliveryapplication-advancedbackendlearning
- Repository: https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning

## Overview

This is a TypeScript/Express backend for a restaurant and customer platform, with identity, profile, restaurant-management, and shared infrastructure concerns. The visible request path is HTTP routing to controllers and use cases, with persistence and object storage available behind the domain features. The tree also shows queue workers and dependency-registration modules, but no README or sampled source establishes their full product flow; those links are omitted rather than inferred.

Main entry points: [`backend/src/app/app.ts`](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/app/app.ts) (Express app), [`backend/src/main.ts`](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/main.ts) (Server startup), [`backend/src/modules/identity/presentation/controllers/refresh-token.controller.ts`](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/identity/presentation/controllers/refresh-token.controller.ts) (Identity controllers), [`backend/src/modules/identity/infrastructure/persistence/prisma/refresh-session.repository.ts`](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/identity/infrastructure/persistence/prisma/refresh-session.repository.ts) (Refresh sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application runtime"]
  node_server["Server startup<br/>[main.ts]"]
  node_express["Express app<br/>[app.ts]"]
end

subgraph group_identity["Identity and access"]
  node_identity_routes["Identity routes<br/>[identity.route.ts]"]
  node_identity_actions["Identity controllers"]
  node_identity_usecases["Identity use cases"]
  node_identity_domain["Identity domain"]
  node_refresh_repo["Refresh sessions"]
end

subgraph group_commerce["Customer and restaurant"]
  node_customers_routes["Customer routes<br/>[customer.route.ts]"]
  node_customer_actions["Customer controllers"]
  node_customer_cases["Customer use cases"]
  node_customer_store["Customer repository"]
  node_restaurants_routes["Restaurant routes"]
  node_restaurant_actions["Restaurant controllers"]
  node_restaurant_cases["Restaurant use cases"]
  node_restaurant_store["Restaurant repository"]
end

subgraph group_infra["Shared infrastructure"]
  node_db[("Prisma database")]
  node_file_storage["File storage contract<br/>[file-storage.ts]"]
  node_r2["R2 storage<br/>[r2.file-storage.ts]"]
  node_queues["Job queues"]
  node_workers["Queue workers"]
  node_security["HTTP security<br/>[security.ts]"]
  node_request_context["Request context"]
  node_error_handler["Error handling"]
end

node_caller(("HTTP client"))

node_caller -->|"sends requests"| node_express
node_server -->|"starts"| node_express
node_express -->|"registers"| node_security
node_express -->|"installs"| node_request_context
node_express -->|"routes identity"| node_identity_routes
node_express -->|"routes customers"| node_customers_routes
node_express -->|"routes restaurants"| node_restaurants_routes
node_express -->|"handles errors"| node_error_handler
node_identity_actions -->|"executes"| node_identity_usecases
node_refresh_repo -->|"reads and writes"| node_db
node_customer_actions -->|"executes"| node_customer_cases
node_restaurant_actions -->|"executes"| node_restaurant_cases
node_file_storage -->|"implemented by"| node_r2
node_queues -.-> node_workers

click node_server "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/main.ts"
click node_express "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/app/app.ts"
click node_identity_routes "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/identity/presentation/routes/identity.route.ts"
click node_identity_actions "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/identity/presentation/controllers/refresh-token.controller.ts"
click node_identity_usecases "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/tree/main/backend/src/modules/identity/application/use-cases"
click node_identity_domain "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/tree/main/backend/src/modules/identity/domain"
click node_refresh_repo "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/identity/infrastructure/persistence/prisma/refresh-session.repository.ts"
click node_customers_routes "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/customer/presentation/routes/customer.route.ts"
click node_customer_actions "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/tree/main/backend/src/modules/customer/presentation/controllers"
click node_customer_cases "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/tree/main/backend/src/modules/customer/application/use-cases"
click node_customer_store "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/customer/infrastructure/persistence/prisma/customer.respository.ts"
click node_restaurants_routes "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/restaurent/presentation/routes/restaurant.route.ts"
click node_restaurant_actions "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/restaurent/presentation/controllers/restaurant-profile-update.controller.ts"
click node_restaurant_cases "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/tree/main/backend/src/modules/restaurent/application/use-cases"
click node_restaurant_store "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/restaurent/infrastructure/persistence/prisma/restaurant.repository.ts"
click node_db "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/infrastructure/database/database.service.ts"
click node_file_storage "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/shared/contracts/storage/file-storage.ts"
click node_r2 "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/infrastructure/storage/r2/r2.file-storage.ts"
click node_queues "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/tree/main/backend/src/infrastructure/queue/queues"
click node_workers "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/tree/main/backend/src/infrastructure/queue/workers"
click node_security "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/infrastructure/security/security.ts"
click node_request_context "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/infrastructure/observeability/request-context/request-context.middleware.ts"
click node_error_handler "https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/app/middleware/error-handler.middleware.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_server,node_express,node_caller toneBlue
class node_identity_routes,node_identity_actions,node_identity_usecases,node_identity_domain,node_refresh_repo toneAmber
class node_customers_routes,node_customer_actions,node_customer_cases,node_customer_store,node_restaurants_routes,node_restaurant_actions,node_restaurant_cases,node_restaurant_store toneMint
class node_db,node_file_storage,node_r2,node_queues,node_workers,node_security,node_request_context,node_error_handler toneRose
```

## Components

### Application runtime

- [Server startup](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/main.ts): `backend/src/main.ts`
- [Express app](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/app/app.ts): `backend/src/app/app.ts`

### Identity and access

- [Identity routes](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/identity/presentation/routes/identity.route.ts): `backend/src/modules/identity/presentation/routes/identity.route.ts`
- [Identity controllers](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/identity/presentation/controllers/refresh-token.controller.ts): `backend/src/modules/identity/presentation/controllers/refresh-token.controller.ts`
- [Identity use cases](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/tree/main/backend/src/modules/identity/application/use-cases): `backend/src/modules/identity/application/use-cases`
- [Identity domain](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/tree/main/backend/src/modules/identity/domain): `backend/src/modules/identity/domain`
- [Refresh sessions](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/identity/infrastructure/persistence/prisma/refresh-session.repository.ts): `backend/src/modules/identity/infrastructure/persistence/prisma/refresh-session.repository.ts`

### Customer and restaurant

- [Customer routes](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/customer/presentation/routes/customer.route.ts): `backend/src/modules/customer/presentation/routes/customer.route.ts`
- [Customer controllers](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/tree/main/backend/src/modules/customer/presentation/controllers): `backend/src/modules/customer/presentation/controllers`
- [Customer use cases](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/tree/main/backend/src/modules/customer/application/use-cases): `backend/src/modules/customer/application/use-cases`
- [Customer repository](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/customer/infrastructure/persistence/prisma/customer.respository.ts): `backend/src/modules/customer/infrastructure/persistence/prisma/customer.respository.ts`
- [Restaurant routes](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/restaurent/presentation/routes/restaurant.route.ts): `backend/src/modules/restaurent/presentation/routes/restaurant.route.ts`
- [Restaurant controllers](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/restaurent/presentation/controllers/restaurant-profile-update.controller.ts): `backend/src/modules/restaurent/presentation/controllers/restaurant-profile-update.controller.ts`
- [Restaurant use cases](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/tree/main/backend/src/modules/restaurent/application/use-cases): `backend/src/modules/restaurent/application/use-cases`
- [Restaurant repository](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/modules/restaurent/infrastructure/persistence/prisma/restaurant.repository.ts): `backend/src/modules/restaurent/infrastructure/persistence/prisma/restaurant.repository.ts`

### Shared infrastructure

- [Prisma database](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/infrastructure/database/database.service.ts): `backend/src/infrastructure/database/database.service.ts`
- [File storage contract](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/shared/contracts/storage/file-storage.ts): `backend/src/shared/contracts/storage/file-storage.ts`
- [R2 storage](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/infrastructure/storage/r2/r2.file-storage.ts): `backend/src/infrastructure/storage/r2/r2.file-storage.ts`
- [Job queues](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/tree/main/backend/src/infrastructure/queue/queues): `backend/src/infrastructure/queue/queues`
- [Queue workers](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/tree/main/backend/src/infrastructure/queue/workers): `backend/src/infrastructure/queue/workers`
- [HTTP security](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/infrastructure/security/security.ts): `backend/src/infrastructure/security/security.ts`
- [Request context](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/infrastructure/observeability/request-context/request-context.middleware.ts): `backend/src/infrastructure/observeability/request-context/request-context.middleware.ts`
- [Error handling](https://github.com/abhishek10600/fooddeliveryapplication-advancedbackendlearning/blob/main/backend/src/app/middleware/error-handler.middleware.ts): `backend/src/app/middleware/error-handler.middleware.ts`

### Other components

- **HTTP client**

## Connections

- HTTP client → Express app: sends requests (evidence: `backend/src/app/app.ts`)
- Server startup → Express app: starts (evidence: `backend/src/main.ts`)
- Express app → HTTP security: registers (evidence: `backend/src/app/app.ts`)
- Express app → Request context: installs (evidence: `backend/src/app/app.ts`)
- Express app → Identity routes: routes identity (evidence: `backend/src/app/app.ts`)
- Express app → Customer routes: routes customers (evidence: `backend/src/app/app.ts`)
- Express app → Restaurant routes: routes restaurants (evidence: `backend/src/app/app.ts`)
- Express app → Error handling: handles errors (evidence: `backend/src/app/app.ts`)
- Identity controllers → Identity use cases: executes (evidence: `backend/src/modules/identity/presentation/controllers/refresh-token.controller.ts`)
- Refresh sessions → Prisma database: reads and writes (evidence: `backend/src/modules/identity/infrastructure/persistence/prisma/refresh-session.repository.ts`)
- Customer controllers → Customer use cases: executes (evidence: `backend/src/modules/customer/presentation/controllers/update-customer-profile.controller.ts`)
- Restaurant controllers → Restaurant use cases: executes (evidence: `backend/src/modules/restaurent/presentation/controllers/restaurant-profile-update.controller.ts`)
- File storage contract → R2 storage: implemented by (evidence: `backend/src/infrastructure/storage/r2/r2.file-storage.ts`)
- Job queues → Queue workers
