# atisanginn/deliveryplatform architecture

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

- Interactive diagram: https://gitdiagram.com/atisanginn/deliveryplatform
- Repository: https://github.com/atisanginn/deliveryplatform

## Overview

This is a multi-role delivery platform: customers browse merchants and place orders, drivers claim and update deliveries, and administrators manage platform operations. The principal order path runs from the customer app through the API’s order controller and service, which validates menu prices, persists the order, and returns a PayFast payment form. Payment callbacks, catalog management, authentication, and live order updates are separate capabilities. Several frontend-to-API and payment-callback relationships are not shown in the sampled excerpts, so those links are marked unverified.

Main entry points: [`DeliveryPlatform/DeliveryPlatform.Api/Data/ApplicationDbContext.cs`](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Data/ApplicationDbContext.cs) (Application Database), [`DeliveryPlatform/DeliveryPlatform.Api/Services/Implementations/OrderService.cs`](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Services/Implementations/OrderService.cs) (Order Service), [`DeliveryPlatform/DeliveryPlatform.Api/Program.cs`](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Program.cs) (API Composition), [`DeliveryPlatform/DeliveryPlatform.Api/Services/Implementations/AuthService.cs`](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Services/Implementations/AuthService.cs) (Auth Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Web Apps"]
  node_customer["Customer App<br/>[app.js]"]
  node_admin["Admin Web<br/>[app.js]"]
  node_driver["Driver App<br/>[app.js]"]
end

subgraph group_api["API Endpoints"]
  node_auth_controller["Authentication API<br/>[AuthController.cs]"]
  node_merchant_controller["Merchant API"]
  node_order_controller["Order API<br/>[OrderController.cs]"]
  node_payment_controller["Payment API"]
  node_upload_controller["Upload API"]
  node_users_controller["Users API<br/>[UsersController.cs]"]
  node_program["API Composition<br/>[Program.cs]"]
end

subgraph group_services["Domain Services"]
  node_auth_service["Auth Service<br/>[AuthService.cs]"]
  node_auth_contract["Auth Contract<br/>[IAuthService.cs]"]
  node_order_service["Order Service<br/>[OrderService.cs]"]
  node_order_contract["Order Contract<br/>[IOrderService.cs]"]
end

subgraph group_data["Persistence and Realtime"]
  node_domain_models["Delivery Domain Models<br/>[Models]"]
  node_database[("Application Database")]
  node_db_initializer["Database Initializer<br/>[DbInitializer.cs]"]
  node_order_hub["Live Order Hub<br/>[OrderHub.cs]"]
end

node_customer_actor(("Customer"))
node_driver_actor(("Driver"))
node_admin_actor(("Administrator"))
node_payfast{{"PayFast"}}

node_customer_actor -.->|"uses"| node_customer
node_driver_actor -.->|"uses"| node_driver
node_admin_actor -.->|"uses"| node_admin
node_customer -.->|"submits orders"| node_order_controller
node_customer -.->|"authenticates"| node_auth_controller
node_admin -.->|"manages catalog"| node_merchant_controller
node_driver -.->|"updates deliveries"| node_order_controller
node_auth_controller -->|"delegates auth"| node_auth_service
node_auth_service -->|"implements"| node_auth_contract
node_auth_service -->|"reads and writes"| node_database
node_order_controller -->|"delegates orders"| node_order_service
node_order_service -->|"implements"| node_order_contract
node_order_service -->|"reads and writes"| node_database
node_order_service -->|"broadcasts updates"| node_order_hub
node_order_service -->|"builds payment form"| node_payfast
node_merchant_controller -->|"reads and writes"| node_database
node_users_controller -->|"reads and writes"| node_database
node_payment_controller -->|"reads and writes"| node_database
node_payment_controller -->|"notifies clients"| node_order_hub
node_order_hub -->|"syncs order state"| node_database
node_program -->|"configures"| node_database
node_program -->|"registers"| node_auth_service
node_program -->|"registers"| node_order_service
node_program -->|"runs initialization"| node_db_initializer
node_program -->|"maps hub"| node_order_hub
node_db_initializer -->|"seeds data"| node_database

click node_customer "https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/CustomerApp/app.js"
click node_admin "https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/AdminWeb/app.js"
click node_driver "https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DriverApp/app.js"
click node_auth_controller "https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Controllers/AuthController.cs"
click node_merchant_controller "https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Controllers/MerchantController.cs"
click node_order_controller "https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Controllers/OrderController.cs"
click node_payment_controller "https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Controllers/PaymentController.cs"
click node_upload_controller "https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Controllers/UploadController.cs"
click node_users_controller "https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Controllers/UsersController.cs"
click node_auth_service "https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Services/Implementations/AuthService.cs"
click node_auth_contract "https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Services/Interfaces/IAuthService.cs"
click node_order_service "https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Services/Implementations/OrderService.cs"
click node_order_contract "https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Services/Interfaces/IOrderService.cs"
click node_domain_models "https://github.com/atisanginn/deliveryplatform/tree/main/DeliveryPlatform/DeliveryPlatform.Api/Models"
click node_database "https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Data/ApplicationDbContext.cs"
click node_db_initializer "https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Data/DbInitializer.cs"
click node_order_hub "https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Hubs/OrderHub.cs"
click node_program "https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Program.cs"

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_customer,node_admin,node_driver toneBlue
class node_auth_controller,node_merchant_controller,node_order_controller,node_payment_controller,node_upload_controller,node_users_controller,node_program toneAmber
class node_auth_service,node_auth_contract,node_order_service,node_order_contract toneMint
class node_domain_models,node_database,node_db_initializer,node_order_hub toneRose
class node_customer_actor,node_driver_actor,node_admin_actor,node_payfast toneIndigo
```

## Components

### Web Apps

- [Customer App](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/CustomerApp/app.js): `DeliveryPlatform/CustomerApp/app.js`
- [Admin Web](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/AdminWeb/app.js): `DeliveryPlatform/AdminWeb/app.js`
- [Driver App](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DriverApp/app.js): `DeliveryPlatform/DriverApp/app.js`

### API Endpoints

- [Authentication API](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Controllers/AuthController.cs): `DeliveryPlatform/DeliveryPlatform.Api/Controllers/AuthController.cs`
- [Merchant API](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Controllers/MerchantController.cs): `DeliveryPlatform/DeliveryPlatform.Api/Controllers/MerchantController.cs`
- [Order API](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Controllers/OrderController.cs): `DeliveryPlatform/DeliveryPlatform.Api/Controllers/OrderController.cs`
- [Payment API](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Controllers/PaymentController.cs): `DeliveryPlatform/DeliveryPlatform.Api/Controllers/PaymentController.cs`
- [Upload API](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Controllers/UploadController.cs): `DeliveryPlatform/DeliveryPlatform.Api/Controllers/UploadController.cs`
- [Users API](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Controllers/UsersController.cs): `DeliveryPlatform/DeliveryPlatform.Api/Controllers/UsersController.cs`
- [API Composition](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Program.cs): `DeliveryPlatform/DeliveryPlatform.Api/Program.cs`

### Domain Services

- [Auth Service](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Services/Implementations/AuthService.cs): `DeliveryPlatform/DeliveryPlatform.Api/Services/Implementations/AuthService.cs`
- [Auth Contract](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Services/Interfaces/IAuthService.cs): `DeliveryPlatform/DeliveryPlatform.Api/Services/Interfaces/IAuthService.cs`
- [Order Service](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Services/Implementations/OrderService.cs): `DeliveryPlatform/DeliveryPlatform.Api/Services/Implementations/OrderService.cs`
- [Order Contract](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Services/Interfaces/IOrderService.cs): `DeliveryPlatform/DeliveryPlatform.Api/Services/Interfaces/IOrderService.cs`

### Persistence and Realtime

- [Delivery Domain Models](https://github.com/atisanginn/deliveryplatform/tree/main/DeliveryPlatform/DeliveryPlatform.Api/Models): `DeliveryPlatform/DeliveryPlatform.Api/Models`
- [Application Database](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Data/ApplicationDbContext.cs): `DeliveryPlatform/DeliveryPlatform.Api/Data/ApplicationDbContext.cs`
- [Database Initializer](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Data/DbInitializer.cs): `DeliveryPlatform/DeliveryPlatform.Api/Data/DbInitializer.cs`
- [Live Order Hub](https://github.com/atisanginn/deliveryplatform/blob/main/DeliveryPlatform/DeliveryPlatform.Api/Hubs/OrderHub.cs): `DeliveryPlatform/DeliveryPlatform.Api/Hubs/OrderHub.cs`

### Other components

- **Customer**
- **Driver**
- **Administrator**
- **PayFast**

## Connections

- Customer → Customer App: uses
- Driver → Driver App: uses
- Administrator → Admin Web: uses
- Customer App → Order API: submits orders
- Customer App → Authentication API: authenticates
- Admin Web → Merchant API: manages catalog
- Driver App → Order API: updates deliveries
- Authentication API → Auth Service: delegates auth (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Controllers/AuthController.cs`)
- Auth Service → Auth Contract: implements (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Services/Implementations/AuthService.cs`)
- Auth Service → Application Database: reads and writes (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Services/Implementations/AuthService.cs`)
- Order API → Order Service: delegates orders (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Controllers/OrderController.cs`)
- Order Service → Order Contract: implements (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Services/Implementations/OrderService.cs`)
- Order Service → Application Database: reads and writes (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Services/Implementations/OrderService.cs`)
- Order Service → Live Order Hub: broadcasts updates (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Services/Implementations/OrderService.cs`)
- Order Service → PayFast: builds payment form (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Services/Implementations/OrderService.cs`)
- Merchant API → Application Database: reads and writes (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Controllers/MerchantController.cs`)
- Users API → Application Database: reads and writes (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Controllers/UsersController.cs`)
- Payment API → Application Database: reads and writes (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Controllers/PaymentController.cs`)
- Payment API → Live Order Hub: notifies clients (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Controllers/PaymentController.cs`)
- Live Order Hub → Application Database: syncs order state (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Hubs/OrderHub.cs`)
- API Composition → Application Database: configures (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Program.cs`)
- API Composition → Auth Service: registers (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Program.cs`)
- API Composition → Order Service: registers (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Program.cs`)
- API Composition → Database Initializer: runs initialization (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Program.cs`)
- API Composition → Live Order Hub: maps hub (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Program.cs`)
- Database Initializer → Application Database: seeds data (evidence: `DeliveryPlatform/DeliveryPlatform.Api/Data/DbInitializer.cs`)
