# omarabdelrahmn/logistic-erp architecture

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

- Interactive diagram: https://gitdiagram.com/omarabdelrahmn/logistic-erp
- Repository: https://github.com/omarabdelrahmn/logistic-erp

## Overview

Logistics ERP is a single-company logistics and workforce system. Its documented user-facing path is a client request to the API, with authentication/session validation and permission checks protecting access; operational domains cover workforce, fleet, fuel, maintenance, and platform accounts. Infrastructure implements persistence and services, while the Worker is a separate composition root. The README describes a narrower current stage than the repository tree and sampled operational code suggest; operational branches are included, but their unsampled API-to-service wiring is not asserted.

Main entry points: [`src/LogisticsERP.Infrastructure/Persistence/ApplicationDbContext.cs`](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Persistence/ApplicationDbContext.cs) (Application database), [`src/LogisticsERP.Api/Program.cs`](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Api/Program.cs) (API host), [`src/LogisticsERP.Infrastructure/Identity/IdentityDbContext.cs`](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Identity/IdentityDbContext.cs) (Identity database), [`src/LogisticsERP.Infrastructure/Fleet/FleetService.cs`](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Fleet/FleetService.cs) (Fleet operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and access"]
  node_api_host["API host<br/>[Program.cs]"]
  node_auth_endpoints["Authentication endpoints<br/>[AuthController.cs]"]
  node_profile_endpoints["Profile endpoints"]
  node_permission_handler["Permission handler"]
end

subgraph group_identity["Identity and authorization"]
  node_auth_service["Authentication service"]
  node_user_service["User management"]
  node_session_validation["Session validation"]
  node_permission_check["Permission checks"]
end

subgraph group_operations["Operations"]
  node_workforce["Workforce and HR"]
  node_housing["Housing<br/>[HousingService.cs]"]
  node_fleet["Fleet operations<br/>[FleetService.cs]"]
  node_fuel["Fuel cards<br/>[FuelCardService.cs]"]
  node_maintenance["Maintenance and inventory"]
  node_platform_accounts["Platform accounts"]
end

subgraph group_platform["Persistence and runtime"]
  node_files["Private file storage"]
  node_audit["Audit queries"]
  node_app_db[("Application database")]
  node_identity_db[("Identity database")]
  node_worker["Background workers<br/>[Program.cs]"]
end

node_user(("ERP user"))

node_user -->|"sends requests"| node_api_host
node_api_host -.->|"routes requests"| node_auth_endpoints
node_api_host -.->|"routes requests"| node_profile_endpoints
node_auth_endpoints -->|"uses authentication"| node_auth_service
node_profile_endpoints -->|"uses profile services"| node_user_service
node_api_host -->|"validates sessions"| node_session_validation
node_permission_handler -->|"checks permission"| node_permission_check
node_auth_service -->|"reads and writes"| node_identity_db
node_user_service -.->|"manages identity"| node_identity_db
node_workforce -.->|"persists HR data"| node_app_db
node_housing -.->|"persists housing"| node_app_db
node_fleet -->|"reads and writes"| node_app_db
node_fleet -->|"stores files"| node_files
node_fuel -.->|"persists fuel data"| node_app_db
node_maintenance -.->|"persists maintenance data"| node_app_db
node_platform_accounts -->|"reads and writes"| node_app_db
node_audit -->|"reads audit entries"| node_app_db
node_audit -->|"resolves actors"| node_identity_db
node_worker -.->|"runs background jobs"| node_app_db

click node_api_host "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Api/Program.cs"
click node_auth_endpoints "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Api/Controllers/AuthController.cs"
click node_profile_endpoints "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Api/Controllers/UserProfileController.cs"
click node_auth_service "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Authentication/AuthenticationService.cs"
click node_user_service "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Authentication/UserManagementService.cs"
click node_session_validation "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Authentication/AuthenticationSessionValidator.cs"
click node_permission_check "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Authentication/PermissionChecker.cs"
click node_permission_handler "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Api/Authorization/PermissionAuthorizationHandler.cs"
click node_workforce "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Hr/WorkforceService.cs"
click node_housing "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Hr/HousingService.cs"
click node_fleet "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Fleet/FleetService.cs"
click node_fuel "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Fuel/FuelCardService.cs"
click node_maintenance "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Maintenance/MaintenanceService.cs"
click node_platform_accounts "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Hr/SimplePlatformService.cs"
click node_files "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Files/PrivateFileStorage.cs"
click node_audit "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/SystemServices/AuditQueryService.cs"
click node_app_db "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Persistence/ApplicationDbContext.cs"
click node_identity_db "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Identity/IdentityDbContext.cs"
click node_worker "https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Worker/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_api_host,node_auth_endpoints,node_profile_endpoints,node_permission_handler,node_user toneBlue
class node_auth_service,node_user_service,node_session_validation,node_permission_check toneAmber
class node_workforce,node_housing,node_fleet,node_fuel,node_maintenance,node_platform_accounts toneMint
class node_files,node_audit,node_app_db,node_identity_db,node_worker toneRose
```

## Components

### API and access

- [API host](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Api/Program.cs): `src/LogisticsERP.Api/Program.cs`
- [Authentication endpoints](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Api/Controllers/AuthController.cs): `src/LogisticsERP.Api/Controllers/AuthController.cs`
- [Profile endpoints](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Api/Controllers/UserProfileController.cs): `src/LogisticsERP.Api/Controllers/UserProfileController.cs`
- [Permission handler](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Api/Authorization/PermissionAuthorizationHandler.cs): `src/LogisticsERP.Api/Authorization/PermissionAuthorizationHandler.cs`

### Identity and authorization

- [Authentication service](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Authentication/AuthenticationService.cs): `src/LogisticsERP.Infrastructure/Authentication/AuthenticationService.cs`
- [User management](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Authentication/UserManagementService.cs): `src/LogisticsERP.Infrastructure/Authentication/UserManagementService.cs`
- [Session validation](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Authentication/AuthenticationSessionValidator.cs): `src/LogisticsERP.Infrastructure/Authentication/AuthenticationSessionValidator.cs`
- [Permission checks](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Authentication/PermissionChecker.cs): `src/LogisticsERP.Infrastructure/Authentication/PermissionChecker.cs`

### Operations

- [Workforce and HR](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Hr/WorkforceService.cs): `src/LogisticsERP.Infrastructure/Hr/WorkforceService.cs`
- [Housing](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Hr/HousingService.cs): `src/LogisticsERP.Infrastructure/Hr/HousingService.cs`
- [Fleet operations](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Fleet/FleetService.cs): `src/LogisticsERP.Infrastructure/Fleet/FleetService.cs`
- [Fuel cards](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Fuel/FuelCardService.cs): `src/LogisticsERP.Infrastructure/Fuel/FuelCardService.cs`
- [Maintenance and inventory](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Maintenance/MaintenanceService.cs): `src/LogisticsERP.Infrastructure/Maintenance/MaintenanceService.cs`
- [Platform accounts](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Hr/SimplePlatformService.cs): `src/LogisticsERP.Infrastructure/Hr/SimplePlatformService.cs`

### Persistence and runtime

- [Private file storage](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Files/PrivateFileStorage.cs): `src/LogisticsERP.Infrastructure/Files/PrivateFileStorage.cs`
- [Audit queries](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/SystemServices/AuditQueryService.cs): `src/LogisticsERP.Infrastructure/SystemServices/AuditQueryService.cs`
- [Application database](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Persistence/ApplicationDbContext.cs): `src/LogisticsERP.Infrastructure/Persistence/ApplicationDbContext.cs`
- [Identity database](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Infrastructure/Identity/IdentityDbContext.cs): `src/LogisticsERP.Infrastructure/Identity/IdentityDbContext.cs`
- [Background workers](https://github.com/omarabdelrahmn/logistic-erp/blob/master/src/LogisticsERP.Worker/Program.cs): `src/LogisticsERP.Worker/Program.cs`

### Other components

- **ERP user**

## Connections

- ERP user → API host: sends requests
- API host → Authentication endpoints: routes requests
- API host → Profile endpoints: routes requests
- Authentication endpoints → Authentication service: uses authentication
- Profile endpoints → User management: uses profile services
- API host → Session validation: validates sessions (evidence: `src/LogisticsERP.Api/Program.cs`)
- Permission handler → Permission checks: checks permission (evidence: `src/LogisticsERP.Api/Authorization/PermissionAuthorizationHandler.cs`)
- Authentication service → Identity database: reads and writes (evidence: `src/LogisticsERP.Infrastructure/Authentication/AuthenticationService.cs`)
- User management → Identity database: manages identity
- Workforce and HR → Application database: persists HR data
- Housing → Application database: persists housing
- Fleet operations → Application database: reads and writes (evidence: `src/LogisticsERP.Infrastructure/Fleet/FleetService.cs`)
- Fleet operations → Private file storage: stores files (evidence: `src/LogisticsERP.Infrastructure/Fleet/FleetService.cs`)
- Fuel cards → Application database: persists fuel data (evidence: `src/LogisticsERP.Infrastructure/Fuel/FuelCardService.cs`)
- Maintenance and inventory → Application database: persists maintenance data
- Platform accounts → Application database: reads and writes (evidence: `src/LogisticsERP.Infrastructure/Hr/SimplePlatformService.cs`)
- Audit queries → Application database: reads audit entries (evidence: `src/LogisticsERP.Infrastructure/SystemServices/AuditQueryService.cs`)
- Audit queries → Identity database: resolves actors (evidence: `src/LogisticsERP.Infrastructure/SystemServices/AuditQueryService.cs`)
- Background workers → Application database: runs background jobs
