# mostaqhossain/fleetforceapi architecture

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

- Interactive diagram: https://gitdiagram.com/mostaqhossain/fleetforceapi
- Repository: https://github.com/mostaqhossain/fleetforceapi

## Overview

FleetForceAPI is a .NET backend for a React frontend, with MongoDB persistence. The principal workflow is an HTTP request routed to a domain controller, processed through a repository, and read from or written to MongoDB; controllers return API responses to the client. Separate driver, load, and truck branches include CRUD and list/search/filter/sort/paging capabilities documented by repository contracts. Source excerpts show truck/load persistence and startup registration; driver persistence and mapping details are less fully sampled, so those links are limited to indexed references or README evidence.

Main entry points: [`Program.cs`](https://github.com/mostaqhossain/fleetforceapi/blob/master/Program.cs) (.NET API host), [`Controllers/CombineSearchController.cs`](https://github.com/mostaqhossain/fleetforceapi/blob/master/Controllers/CombineSearchController.cs) (Combined search), [`Repository`](https://github.com/mostaqhossain/fleetforceapi/tree/master/Repository) (Driver repository), [`Repository/LoadRepository.cs`](https://github.com/mostaqhossain/fleetforceapi/blob/master/Repository/LoadRepository.cs) (Load repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_driver_api["Driver endpoints"]
  node_load_api["Load endpoints<br/>[LoadController.cs]"]
  node_truck_api["Truck endpoints<br/>[TruckController.cs]"]
  node_combined_search["Combined search"]
end

subgraph group_domain["Domain Data"]
  node_api_response["API response<br/>[ApiResponse.cs]"]
  node_driver_data["Driver data<br/>[Driver.cs]"]
  node_load_data["Load data<br/>[Load.cs]"]
  node_truck_data["Truck data<br/>[Truck.cs]"]
  node_base_dto["DTO metadata<br/>[BaseDTO.cs]"]
  node_driver_dto["Driver DTO<br/>[DriverDTO.cs]"]
  node_load_dto["Load DTO<br/>[LoadDTO.cs]"]
  node_truck_dto["Truck DTO<br/>[TruckDTO.cs]"]
  node_driver_mapper["Driver mapping<br/>[DriverMapper.cs]"]
  node_load_mapper["Load mapping<br/>[LoadMapper.cs]"]
  node_truck_mapper["Truck mapping<br/>[TruckMapper.cs]"]
end

subgraph group_persistence["Mongo Persistence"]
  node_driver_repo["Driver repository"]
  node_load_repo["Load repository<br/>[LoadRepository.cs]"]
  node_truck_repo["Truck repository<br/>[TruckRepository.cs]"]
end

subgraph group_startup["Application Setup"]
  node_host[".NET API host<br/>[Program.cs]"]
  node_mongo_settings["Mongo settings<br/>[MongoDBSettings.cs]"]
end

node_react(("React frontend"))
node_mongo[("MongoDB")]

node_react -->|"sends requests"| node_host
node_host -->|"routes requests"| node_driver_api
node_host -->|"routes requests"| node_load_api
node_host -->|"routes requests"| node_truck_api
node_host -->|"routes requests"| node_combined_search
node_driver_api -->|"calls repository"| node_driver_repo
node_load_api -->|"calls repository"| node_load_repo
node_truck_api -->|"calls repository"| node_truck_repo
node_combined_search -->|"uses repository"| node_driver_repo
node_combined_search -->|"uses repository"| node_load_repo
node_combined_search -->|"uses repository"| node_truck_repo
node_driver_api -->|"returns response"| node_api_response
node_load_api -->|"returns response"| node_api_response
node_truck_api -->|"returns response"| node_api_response
node_driver_repo -->|"reads writes"| node_driver_data
node_load_repo -->|"reads writes"| node_load_data
node_truck_repo -->|"reads writes"| node_truck_data
node_host -->|"loads configuration"| node_mongo_settings
node_host -->|"configures database"| node_mongo
node_load_repo -->|"queries collection"| node_mongo
node_truck_repo -->|"queries collection"| node_mongo
node_driver_repo -.->|"queries collection"| node_mongo
node_driver_mapper -->|"maps model"| node_driver_data
node_driver_mapper -->|"maps DTO"| node_driver_dto
node_load_mapper -->|"maps model"| node_load_data
node_load_mapper -->|"maps DTO"| node_load_dto
node_truck_mapper -->|"maps model"| node_truck_data
node_truck_mapper -->|"maps DTO"| node_truck_dto

click node_host "https://github.com/mostaqhossain/fleetforceapi/blob/master/Program.cs"
click node_driver_api "https://github.com/mostaqhossain/fleetforceapi/blob/master/Controllers/DriverController.cs"
click node_load_api "https://github.com/mostaqhossain/fleetforceapi/blob/master/Controllers/LoadController.cs"
click node_truck_api "https://github.com/mostaqhossain/fleetforceapi/blob/master/Controllers/TruckController.cs"
click node_combined_search "https://github.com/mostaqhossain/fleetforceapi/blob/master/Controllers/CombineSearchController.cs"
click node_api_response "https://github.com/mostaqhossain/fleetforceapi/blob/master/Models/ApiResponse.cs"
click node_driver_data "https://github.com/mostaqhossain/fleetforceapi/blob/master/Models/Driver.cs"
click node_load_data "https://github.com/mostaqhossain/fleetforceapi/blob/master/Models/Load.cs"
click node_truck_data "https://github.com/mostaqhossain/fleetforceapi/blob/master/Models/Truck.cs"
click node_base_dto "https://github.com/mostaqhossain/fleetforceapi/blob/master/DTO/BaseDTO.cs"
click node_driver_dto "https://github.com/mostaqhossain/fleetforceapi/blob/master/DTO/DriverDTO.cs"
click node_load_dto "https://github.com/mostaqhossain/fleetforceapi/blob/master/DTO/LoadDTO.cs"
click node_truck_dto "https://github.com/mostaqhossain/fleetforceapi/blob/master/DTO/TruckDTO.cs"
click node_driver_mapper "https://github.com/mostaqhossain/fleetforceapi/blob/master/MapModel/DriverMapper.cs"
click node_load_mapper "https://github.com/mostaqhossain/fleetforceapi/blob/master/MapModel/LoadMapper.cs"
click node_truck_mapper "https://github.com/mostaqhossain/fleetforceapi/blob/master/MapModel/TruckMapper.cs"
click node_driver_repo "https://github.com/mostaqhossain/fleetforceapi/tree/master/Repository"
click node_load_repo "https://github.com/mostaqhossain/fleetforceapi/blob/master/Repository/LoadRepository.cs"
click node_truck_repo "https://github.com/mostaqhossain/fleetforceapi/blob/master/Repository/TruckRepository.cs"
click node_mongo_settings "https://github.com/mostaqhossain/fleetforceapi/blob/master/Models/MongoDBSettings.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_driver_api,node_load_api,node_truck_api,node_combined_search,node_react toneBlue
class node_api_response,node_driver_data,node_load_data,node_truck_data,node_base_dto,node_driver_dto,node_load_dto,node_truck_dto,node_driver_mapper,node_load_mapper,node_truck_mapper,node_mongo toneAmber
class node_driver_repo,node_load_repo,node_truck_repo toneMint
class node_host,node_mongo_settings toneRose
```

## Components

### HTTP API

- [Driver endpoints](https://github.com/mostaqhossain/fleetforceapi/blob/master/Controllers/DriverController.cs): `Controllers/DriverController.cs`
- [Load endpoints](https://github.com/mostaqhossain/fleetforceapi/blob/master/Controllers/LoadController.cs): `Controllers/LoadController.cs`
- [Truck endpoints](https://github.com/mostaqhossain/fleetforceapi/blob/master/Controllers/TruckController.cs): `Controllers/TruckController.cs`
- [Combined search](https://github.com/mostaqhossain/fleetforceapi/blob/master/Controllers/CombineSearchController.cs): `Controllers/CombineSearchController.cs`

### Domain Data

- [API response](https://github.com/mostaqhossain/fleetforceapi/blob/master/Models/ApiResponse.cs): `Models/ApiResponse.cs`
- [Driver data](https://github.com/mostaqhossain/fleetforceapi/blob/master/Models/Driver.cs): `Models/Driver.cs`
- [Load data](https://github.com/mostaqhossain/fleetforceapi/blob/master/Models/Load.cs): `Models/Load.cs`
- [Truck data](https://github.com/mostaqhossain/fleetforceapi/blob/master/Models/Truck.cs): `Models/Truck.cs`
- [DTO metadata](https://github.com/mostaqhossain/fleetforceapi/blob/master/DTO/BaseDTO.cs): `DTO/BaseDTO.cs`
- [Driver DTO](https://github.com/mostaqhossain/fleetforceapi/blob/master/DTO/DriverDTO.cs): `DTO/DriverDTO.cs`
- [Load DTO](https://github.com/mostaqhossain/fleetforceapi/blob/master/DTO/LoadDTO.cs): `DTO/LoadDTO.cs`
- [Truck DTO](https://github.com/mostaqhossain/fleetforceapi/blob/master/DTO/TruckDTO.cs): `DTO/TruckDTO.cs`
- [Driver mapping](https://github.com/mostaqhossain/fleetforceapi/blob/master/MapModel/DriverMapper.cs): `MapModel/DriverMapper.cs`
- [Load mapping](https://github.com/mostaqhossain/fleetforceapi/blob/master/MapModel/LoadMapper.cs): `MapModel/LoadMapper.cs`
- [Truck mapping](https://github.com/mostaqhossain/fleetforceapi/blob/master/MapModel/TruckMapper.cs): `MapModel/TruckMapper.cs`

### Mongo Persistence

- [Driver repository](https://github.com/mostaqhossain/fleetforceapi/tree/master/Repository): `Repository`
- [Load repository](https://github.com/mostaqhossain/fleetforceapi/blob/master/Repository/LoadRepository.cs): `Repository/LoadRepository.cs`
- [Truck repository](https://github.com/mostaqhossain/fleetforceapi/blob/master/Repository/TruckRepository.cs): `Repository/TruckRepository.cs`

### Application Setup

- [.NET API host](https://github.com/mostaqhossain/fleetforceapi/blob/master/Program.cs): `Program.cs`
- [Mongo settings](https://github.com/mostaqhossain/fleetforceapi/blob/master/Models/MongoDBSettings.cs): `Models/MongoDBSettings.cs`

### Other components

- **React frontend**
- **MongoDB**

## Connections

- React frontend → .NET API host: sends requests (evidence: `README.md`)
- .NET API host → Driver endpoints: routes requests (evidence: `Program.cs`)
- .NET API host → Load endpoints: routes requests (evidence: `Program.cs`)
- .NET API host → Truck endpoints: routes requests (evidence: `Program.cs`)
- .NET API host → Combined search: routes requests (evidence: `Program.cs`)
- Driver endpoints → Driver repository: calls repository (evidence: `Controllers/DriverController.cs`)
- Load endpoints → Load repository: calls repository (evidence: `Controllers/LoadController.cs`)
- Truck endpoints → Truck repository: calls repository (evidence: `Controllers/TruckController.cs`)
- Combined search → Driver repository: uses repository (evidence: `Controllers/CombineSearchController.cs`)
- Combined search → Load repository: uses repository (evidence: `Controllers/CombineSearchController.cs`)
- Combined search → Truck repository: uses repository (evidence: `Controllers/CombineSearchController.cs`)
- Driver endpoints → API response: returns response (evidence: `Controllers/DriverController.cs`)
- Load endpoints → API response: returns response (evidence: `Controllers/LoadController.cs`)
- Truck endpoints → API response: returns response (evidence: `Controllers/TruckController.cs`)
- Driver repository → Driver data: reads writes (evidence: `Repository/DriverRepository.cs`)
- Load repository → Load data: reads writes (evidence: `Repository/LoadRepository.cs`)
- Truck repository → Truck data: reads writes (evidence: `Repository/TruckRepository.cs`)
- .NET API host → Mongo settings: loads configuration (evidence: `Program.cs`)
- .NET API host → MongoDB: configures database (evidence: `Program.cs`)
- Load repository → MongoDB: queries collection (evidence: `Repository/LoadRepository.cs`)
- Truck repository → MongoDB: queries collection (evidence: `Repository/TruckRepository.cs`)
- Driver repository → MongoDB: queries collection
- Driver mapping → Driver data: maps model (evidence: `MapModel/DriverMapper.cs`)
- Driver mapping → Driver DTO: maps DTO (evidence: `MapModel/DriverMapper.cs`)
- Load mapping → Load data: maps model (evidence: `MapModel/LoadMapper.cs`)
- Load mapping → Load DTO: maps DTO (evidence: `MapModel/LoadMapper.cs`)
- Truck mapping → Truck data: maps model (evidence: `MapModel/TruckMapper.cs`)
- Truck mapping → Truck DTO: maps DTO (evidence: `MapModel/TruckMapper.cs`)
