# suxrobgm/logistics-app architecture

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

- Interactive diagram: https://gitdiagram.com/suxrobgm/logistics-app
- Repository: https://github.com/suxrobgm/logistics-app

## Overview

LogisticsX is a multi-tenant trucking fleet-management product. Its principal workflow is dispatching a load, assigning work to a driver, exposing tracking to customers, and preparing an invoice after delivery. The README also documents AI dispatch and copilot, load-board integrations, accounting and payments, payroll, fuel, compliance, fleet, and multiple client apps. The graph combines those documented capabilities with sampled mediator, persistence, tax-preview, and LLM internals; unsampled implementation links are dashed rather than asserted as inspected calls.

Main entry points: [`src/Core/Logistics.Application/Modules`](https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules) (Loads and dispatch), [`src/Presentation/Logistics.API`](https://github.com/suxrobgm/logistics-app/tree/main/src/Presentation/Logistics.API) (Logistics API), [`src/Core/Logistics.Application/Modules/Financial/Invoices`](https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules/Financial/Invoices) (Invoices and tax), [`src/Core/Logistics.Application`](https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application) (Application handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Product entrypoints"]
  node_portals["TMS and driver apps"]
  node_customerportal["Customer portal"]
  node_api["Logistics API<br/>[Logistics.API]"]
  node_mcp["MCP server"]
  node_telegram["Telegram bot"]
end

subgraph group_dispatch["Fleet and dispatch"]
  node_loads["Loads and dispatch<br/>[Modules]"]
  node_routing["Routing and tracking"]
  node_loadboards["Load-board search<br/>[LoadBoard]"]
  node_fleet["Fleet and maintenance<br/>[Entities]"]
end

subgraph group_finance["Money and compliance"]
  node_invoices["Invoices and tax<br/>[Invoices]"]
  node_payroll["Payroll<br/>[Financial]"]
  node_payments["Payments and payouts<br/>[Payments]"]
  node_compliance["Compliance and IFTA<br/>[Compliance]"]
  node_accounting["Accounting sync<br/>[Accounting]"]
end

subgraph group_ai["AI and integrations"]
  node_ai_dispatch["AI dispatch agent<br/>[AIDispatch]"]
  node_copilot["AI copilot<br/>[AICopilot]"]
  node_llm["LLM client<br/>[LlmClient.cs]"]
  node_negotiation["Broker negotiation<br/>[Negotiation]"]
end

subgraph group_core["Application and data"]
  node_mediator["Request mediator<br/>[Mediator.cs]"]
  node_pipeline["Request pipeline<br/>[RequestPipeline.cs]"]
  node_handlers["Application handlers"]
  node_tenant_data["Tenant data access"]
  node_repository["Repository<br/>[Repository.cs]"]
  node_entities["Domain entities<br/>[Entities]"]
  node_blob["Blob storage contract"]
end

node_operators(("Carrier users"))

node_operators -->|"use"| node_portals
node_operators -->|"track loads"| node_customerportal
node_portals -.->|"request operations"| node_api
node_customerportal -.->|"request tracking"| node_api
node_api -.->|"dispatch requests"| node_mediator
node_mcp -.->|"dispatch requests"| node_mediator
node_telegram -.->|"dispatch requests"| node_mediator
node_mediator -->|"invokes"| node_pipeline
node_pipeline -->|"resolves handler"| node_handlers
node_handlers -.->|"accesses tenant data"| node_tenant_data
node_tenant_data -.->|"provides repositories"| node_repository
node_repository -->|"queries and updates"| node_entities
node_api -.->|"submit dispatch work"| node_loads
node_loads -.->|"plan routes"| node_routing
node_loads -->|"assign fleet"| node_fleet
node_loads -->|"share tracking"| node_customerportal
node_loads -->|"search listings"| node_loadboards
node_loads -->|"request planning"| node_ai_dispatch
node_api -.->|"request invoicing"| node_invoices
node_invoices -.->|"handled by"| node_handlers
node_handlers -->|"loads customer"| node_tenant_data
node_handlers -->|"calculate preview tax"| node_invoices
node_invoices -->|"collect payment"| node_payments
node_invoices -->|"coordinate finance"| node_payroll
node_invoices -->|"sync accounts"| node_accounting
node_api -.->|"request compliance operations"| node_compliance
node_compliance -.->|"use fleet records"| node_fleet
node_ai_dispatch -.->|"use language models"| node_llm
node_copilot -.->|"use language models"| node_llm
node_negotiation -->|"compose preview"| node_handlers
node_negotiation -->|"read decisions and listings"| node_tenant_data
node_blob -.->|"storage implementation"| node_repository

click node_portals "https://github.com/suxrobgm/logistics-app/tree/main/src/Client"
click node_customerportal "https://github.com/suxrobgm/logistics-app/tree/main/src/Client"
click node_api "https://github.com/suxrobgm/logistics-app/tree/main/src/Presentation/Logistics.API"
click node_mcp "https://github.com/suxrobgm/logistics-app/tree/main/src/Presentation/Logistics.McpServer"
click node_telegram "https://github.com/suxrobgm/logistics-app/tree/main/src/Presentation/Logistics.TelegramBot"
click node_loads "https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules"
click node_routing "https://github.com/suxrobgm/logistics-app/tree/main/src/Infrastructure/Logistics.Infrastructure.Routing"
click node_loadboards "https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules/Integrations/LoadBoard"
click node_fleet "https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Domain/Entities"
click node_invoices "https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules/Financial/Invoices"
click node_payroll "https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules/Financial"
click node_payments "https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules/Financial/Payments"
click node_compliance "https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules/Compliance"
click node_accounting "https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules/Integrations/Accounting"
click node_ai_dispatch "https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application.Abstractions/AIDispatch"
click node_copilot "https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application.Abstractions/AICopilot"
click node_llm "https://github.com/suxrobgm/logistics-app/blob/main/src/Infrastructure/Logistics.Infrastructure.AI/Llm/LlmClient.cs"
click node_negotiation "https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules/Integrations/Negotiation"
click node_mediator "https://github.com/suxrobgm/logistics-app/blob/main/src/Core/Logistics.Mediator/Mediator.cs"
click node_pipeline "https://github.com/suxrobgm/logistics-app/blob/main/src/Core/Logistics.Mediator/Internal/RequestPipeline.cs"
click node_handlers "https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application"
click node_tenant_data "https://github.com/suxrobgm/logistics-app/blob/main/src/Core/Logistics.Domain/Persistence/ITenantUnitOfWork.cs"
click node_repository "https://github.com/suxrobgm/logistics-app/blob/main/src/Infrastructure/Logistics.Infrastructure.Persistence/Repositories/Repository.cs"
click node_entities "https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Domain/Entities"
click node_blob "https://github.com/suxrobgm/logistics-app/blob/main/src/Core/Logistics.Application.Abstractions/Storage/IBlobStorageService.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_portals,node_customerportal,node_api,node_mcp,node_telegram,node_operators toneBlue
class node_loads,node_routing,node_loadboards,node_fleet toneAmber
class node_invoices,node_payroll,node_payments,node_compliance,node_accounting toneMint
class node_ai_dispatch,node_copilot,node_llm,node_negotiation toneRose
class node_mediator,node_pipeline,node_handlers,node_tenant_data,node_repository,node_entities,node_blob toneIndigo
```

## Components

### Product entrypoints

- [TMS and driver apps](https://github.com/suxrobgm/logistics-app/tree/main/src/Client): `src/Client`
- [Customer portal](https://github.com/suxrobgm/logistics-app/tree/main/src/Client): `src/Client`
- [Logistics API](https://github.com/suxrobgm/logistics-app/tree/main/src/Presentation/Logistics.API): `src/Presentation/Logistics.API`
- [MCP server](https://github.com/suxrobgm/logistics-app/tree/main/src/Presentation/Logistics.McpServer): `src/Presentation/Logistics.McpServer`
- [Telegram bot](https://github.com/suxrobgm/logistics-app/tree/main/src/Presentation/Logistics.TelegramBot): `src/Presentation/Logistics.TelegramBot`

### Fleet and dispatch

- [Loads and dispatch](https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules): `src/Core/Logistics.Application/Modules`
- [Routing and tracking](https://github.com/suxrobgm/logistics-app/tree/main/src/Infrastructure/Logistics.Infrastructure.Routing): `src/Infrastructure/Logistics.Infrastructure.Routing`
- [Load-board search](https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules/Integrations/LoadBoard): `src/Core/Logistics.Application/Modules/Integrations/LoadBoard`
- [Fleet and maintenance](https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Domain/Entities): `src/Core/Logistics.Domain/Entities`

### Money and compliance

- [Invoices and tax](https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules/Financial/Invoices): `src/Core/Logistics.Application/Modules/Financial/Invoices`
- [Payroll](https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules/Financial): `src/Core/Logistics.Application/Modules/Financial`
- [Payments and payouts](https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules/Financial/Payments): `src/Core/Logistics.Application/Modules/Financial/Payments`
- [Compliance and IFTA](https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules/Compliance): `src/Core/Logistics.Application/Modules/Compliance`
- [Accounting sync](https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules/Integrations/Accounting): `src/Core/Logistics.Application/Modules/Integrations/Accounting`

### AI and integrations

- [AI dispatch agent](https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application.Abstractions/AIDispatch): `src/Core/Logistics.Application.Abstractions/AIDispatch`
- [AI copilot](https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application.Abstractions/AICopilot): `src/Core/Logistics.Application.Abstractions/AICopilot`
- [LLM client](https://github.com/suxrobgm/logistics-app/blob/main/src/Infrastructure/Logistics.Infrastructure.AI/Llm/LlmClient.cs): `src/Infrastructure/Logistics.Infrastructure.AI/Llm/LlmClient.cs`
- [Broker negotiation](https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application/Modules/Integrations/Negotiation): `src/Core/Logistics.Application/Modules/Integrations/Negotiation`

### Application and data

- [Request mediator](https://github.com/suxrobgm/logistics-app/blob/main/src/Core/Logistics.Mediator/Mediator.cs): `src/Core/Logistics.Mediator/Mediator.cs`
- [Request pipeline](https://github.com/suxrobgm/logistics-app/blob/main/src/Core/Logistics.Mediator/Internal/RequestPipeline.cs): `src/Core/Logistics.Mediator/Internal/RequestPipeline.cs`
- [Application handlers](https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Application): `src/Core/Logistics.Application`
- [Tenant data access](https://github.com/suxrobgm/logistics-app/blob/main/src/Core/Logistics.Domain/Persistence/ITenantUnitOfWork.cs): `src/Core/Logistics.Domain/Persistence/ITenantUnitOfWork.cs`
- [Repository](https://github.com/suxrobgm/logistics-app/blob/main/src/Infrastructure/Logistics.Infrastructure.Persistence/Repositories/Repository.cs): `src/Infrastructure/Logistics.Infrastructure.Persistence/Repositories/Repository.cs`
- [Domain entities](https://github.com/suxrobgm/logistics-app/tree/main/src/Core/Logistics.Domain/Entities): `src/Core/Logistics.Domain/Entities`
- [Blob storage contract](https://github.com/suxrobgm/logistics-app/blob/main/src/Core/Logistics.Application.Abstractions/Storage/IBlobStorageService.cs): `src/Core/Logistics.Application.Abstractions/Storage/IBlobStorageService.cs`

### Other components

- **Carrier users**

## Connections

- Carrier users → TMS and driver apps: use (evidence: `README.md`)
- Carrier users → Customer portal: track loads (evidence: `README.md`)
- TMS and driver apps → Logistics API: request operations
- Customer portal → Logistics API: request tracking
- Logistics API → Request mediator: dispatch requests (evidence: `src/Presentation/Logistics.API/Controllers/InvoicesController.cs`)
- MCP server → Request mediator: dispatch requests
- Telegram bot → Request mediator: dispatch requests
- Request mediator → Request pipeline: invokes (evidence: `src/Core/Logistics.Mediator/Mediator.cs`)
- Request pipeline → Application handlers: resolves handler (evidence: `src/Core/Logistics.Mediator/Internal/RequestPipeline.cs`)
- Application handlers → Tenant data access: accesses tenant data (evidence: `src/Core/Logistics.Application/Modules/Integrations/Negotiation/Queries/PreviewCounterOffer/PreviewCounterOfferHandler.cs`)
- Tenant data access → Repository: provides repositories (evidence: `src/Core/Logistics.Domain/Persistence/ITenantUnitOfWork.cs`)
- Repository → Domain entities: queries and updates (evidence: `src/Infrastructure/Logistics.Infrastructure.Persistence/Repositories/Repository.cs`)
- Logistics API → Loads and dispatch: submit dispatch work (evidence: `src/Presentation/Logistics.API/Controllers/InvoicesController.cs`)
- Loads and dispatch → Routing and tracking: plan routes
- Loads and dispatch → Fleet and maintenance: assign fleet (evidence: `README.md`)
- Loads and dispatch → Customer portal: share tracking (evidence: `README.md`)
- Loads and dispatch → Load-board search: search listings (evidence: `README.md`)
- Loads and dispatch → AI dispatch agent: request planning (evidence: `README.md`)
- Logistics API → Invoices and tax: request invoicing (evidence: `src/Presentation/Logistics.API/Controllers/InvoicesController.cs`)
- Invoices and tax → Application handlers: handled by (evidence: `src/Core/Logistics.Application/Modules/Financial/Invoices/Queries/PreviewInvoiceTax/PreviewInvoiceTaxHandler.cs`)
- Application handlers → Tenant data access: loads customer (evidence: `src/Core/Logistics.Application/Modules/Financial/Invoices/Queries/PreviewInvoiceTax/PreviewInvoiceTaxHandler.cs`)
- Application handlers → Invoices and tax: calculate preview tax (evidence: `src/Core/Logistics.Application/Modules/Financial/Invoices/Queries/PreviewInvoiceTax/PreviewInvoiceTaxHandler.cs`)
- Invoices and tax → Payments and payouts: collect payment (evidence: `README.md`)
- Invoices and tax → Payroll: coordinate finance (evidence: `README.md`)
- Invoices and tax → Accounting sync: sync accounts (evidence: `README.md`)
- Logistics API → Compliance and IFTA: request compliance operations
- Compliance and IFTA → Fleet and maintenance: use fleet records (evidence: `src/Core/Logistics.Application/Modules/Compliance/Dvir/Commands/ReviewDvirReport/ReviewDvirReportHandler.cs`)
- AI dispatch agent → LLM client: use language models
- AI copilot → LLM client: use language models
- Broker negotiation → Application handlers: compose preview (evidence: `src/Core/Logistics.Application/Modules/Integrations/Negotiation/Queries/PreviewCounterOffer/PreviewCounterOfferHandler.cs`)
- Broker negotiation → Tenant data access: read decisions and listings (evidence: `src/Core/Logistics.Application/Modules/Integrations/Negotiation/Queries/PreviewCounterOffer/PreviewCounterOfferHandler.cs`)
- Blob storage contract → Repository: storage implementation
