# gookian/logisticscontrolsystemserver architecture

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

## Overview

This is an ASP.NET logistics-management API backed by PostgreSQL. Clients use entity endpoints for orders, products and inventory, packages, warehouses, vehicles, flights, delivery points, and deliveries; most CRUD operations share a generic controller/repository path. Authentication validates credentials against users and issues in-memory expiring tokens. The graph includes the documented-by-source domain entities and major controller areas; several controller implementations and application startup wiring were not excerpted, so their internal connections are omitted.

Main entry points: [`LogisticsСontrolSystemServer/Models/Delivery.cs`](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Delivery.cs) (Delivery), [`LogisticsСontrolSystemServer/Controllers/GenericApiController.cs`](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Controllers/GenericApiController.cs) (Generic API), [`LogisticsСontrolSystemServer/Models/Product.cs`](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Product.cs) (Product), [`LogisticsСontrolSystemServer/Authenticator.cs`](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Authenticator.cs) (Token authenticator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and authentication"]
  node_generic_api["Generic API"]
  node_auth_controller["Authentication endpoint"]
  node_authenticator["Token authenticator<br/>[Authenticator.cs]"]
  node_token_middleware["Token middleware"]
  node_logging_middleware["URL logging"]
  node_crud_controllers["Entity controllers"]
end

subgraph group_data["Persistence"]
  node_ef_repository["EF repository"]
  node_repository_interface["Repository contract"]
  node_user_repository["User repository<br/>[UserRepository.cs]"]
  node_db_context["PostgreSQL context"]
  node_postgres[("PostgreSQL database")]
end

subgraph group_catalog["Orders and inventory"]
  node_order["Order<br/>[Order.cs]"]
  node_order_detail["Order detail<br/>[OrderDetail.cs]"]
  node_product["Product<br/>[Product.cs]"]
  node_product_data["Product data<br/>[ProductData.cs]"]
  node_product_state["Product state<br/>[ProductState.cs]"]
  node_stock["Warehouse stock"]
end

subgraph group_fulfillment["Shipping and delivery"]
  node_warehouse["Warehouse<br/>[Warehouse.cs]"]
  node_package["Package<br/>[Package.cs]"]
  node_package_state["Package state<br/>[PackageState.cs]"]
  node_package_content["Package contents<br/>[PackageСontent.cs]"]
  node_vehicle["Vehicle<br/>[Vehicle.cs]"]
  node_flight["Flight<br/>[Flight.cs]"]
  node_delivery_point["Delivery point<br/>[DeliveryPoint.cs]"]
  node_delivery["Delivery<br/>[Delivery.cs]"]
end

node_client(("API client"))

node_client -.->|"sends requests"| node_crud_controllers
node_client -.->|"requests token"| node_auth_controller
node_crud_controllers -->|"inherits CRUD"| node_generic_api
node_generic_api -->|"constructs"| node_ef_repository
node_generic_api -->|"constructs"| node_db_context
node_ef_repository -->|"implements"| node_repository_interface
node_generic_api -->|"uses"| node_repository_interface
node_db_context -->|"configures connection"| node_postgres
node_auth_controller -->|"delegates authentication"| node_authenticator
node_authenticator -->|"checks credentials"| node_user_repository
node_user_repository -->|"queries users"| node_db_context
node_token_middleware -->|"validates token"| node_authenticator
node_order_detail -->|"references"| node_order
node_order_detail -->|"references"| node_product_data
node_product -->|"references"| node_product_data
node_product -->|"references"| node_product_state
node_stock -->|"references"| node_warehouse
node_stock -->|"references"| node_product
node_package -->|"references"| node_package_state
node_flight -->|"references"| node_vehicle
node_delivery -->|"references"| node_warehouse
node_delivery -->|"references"| node_delivery_point
node_delivery -->|"references"| node_flight
node_delivery -->|"references"| node_package

click node_generic_api "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Controllers/GenericApiController.cs"
click node_auth_controller "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Controllers/AuthenticatorController.cs"
click node_authenticator "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Authenticator.cs"
click node_token_middleware "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Middlewares/TokenAuthenticationMiddleware.cs"
click node_logging_middleware "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Middlewares/LogURLMiddleware.cs"
click node_crud_controllers "https://github.com/gookian/logisticscontrolsystemserver/tree/master/Logistics%D0%A1ontrolSystemServer/Controllers"
click node_ef_repository "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/DataAccessLayer/Repositories/EFGenericRepository.cs"
click node_repository_interface "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/DataAccessLayer/Repositories/IGenericRepository.cs"
click node_user_repository "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/DataAccessLayer/Repositories/UserRepository.cs"
click node_db_context "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/DataAccessLayer/PostgreSQLContext.cs"
click node_order "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Order.cs"
click node_order_detail "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/OrderDetail.cs"
click node_product "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Product.cs"
click node_product_data "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/ProductData.cs"
click node_product_state "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/ProductState.cs"
click node_stock "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/ProductInWarehouse.cs"
click node_warehouse "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Warehouse.cs"
click node_package "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Package.cs"
click node_package_state "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/PackageState.cs"
click node_package_content "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Package%D0%A1ontent.cs"
click node_vehicle "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Vehicle.cs"
click node_flight "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Flight.cs"
click node_delivery_point "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/DeliveryPoint.cs"
click node_delivery "https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Delivery.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_generic_api,node_auth_controller,node_authenticator,node_token_middleware,node_logging_middleware,node_crud_controllers,node_client toneBlue
class node_ef_repository,node_repository_interface,node_user_repository,node_db_context,node_postgres toneAmber
class node_order,node_order_detail,node_product,node_product_data,node_product_state,node_stock toneMint
class node_warehouse,node_package,node_package_state,node_package_content,node_vehicle,node_flight,node_delivery_point,node_delivery toneRose
```

## Components

### API and authentication

- [Generic API](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Controllers/GenericApiController.cs): `LogisticsСontrolSystemServer/Controllers/GenericApiController.cs`
- [Authentication endpoint](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Controllers/AuthenticatorController.cs): `LogisticsСontrolSystemServer/Controllers/AuthenticatorController.cs`
- [Token authenticator](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Authenticator.cs): `LogisticsСontrolSystemServer/Authenticator.cs`
- [Token middleware](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Middlewares/TokenAuthenticationMiddleware.cs): `LogisticsСontrolSystemServer/Middlewares/TokenAuthenticationMiddleware.cs`
- [URL logging](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Middlewares/LogURLMiddleware.cs): `LogisticsСontrolSystemServer/Middlewares/LogURLMiddleware.cs`
- [Entity controllers](https://github.com/gookian/logisticscontrolsystemserver/tree/master/Logistics%D0%A1ontrolSystemServer/Controllers): `LogisticsСontrolSystemServer/Controllers`

### Persistence

- [EF repository](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/DataAccessLayer/Repositories/EFGenericRepository.cs): `LogisticsСontrolSystemServer/DataAccessLayer/Repositories/EFGenericRepository.cs`
- [Repository contract](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/DataAccessLayer/Repositories/IGenericRepository.cs): `LogisticsСontrolSystemServer/DataAccessLayer/Repositories/IGenericRepository.cs`
- [User repository](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/DataAccessLayer/Repositories/UserRepository.cs): `LogisticsСontrolSystemServer/DataAccessLayer/Repositories/UserRepository.cs`
- [PostgreSQL context](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/DataAccessLayer/PostgreSQLContext.cs): `LogisticsСontrolSystemServer/DataAccessLayer/PostgreSQLContext.cs`
- **PostgreSQL database**

### Orders and inventory

- [Order](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Order.cs): `LogisticsСontrolSystemServer/Models/Order.cs`
- [Order detail](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/OrderDetail.cs): `LogisticsСontrolSystemServer/Models/OrderDetail.cs`
- [Product](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Product.cs): `LogisticsСontrolSystemServer/Models/Product.cs`
- [Product data](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/ProductData.cs): `LogisticsСontrolSystemServer/Models/ProductData.cs`
- [Product state](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/ProductState.cs): `LogisticsСontrolSystemServer/Models/ProductState.cs`
- [Warehouse stock](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/ProductInWarehouse.cs): `LogisticsСontrolSystemServer/Models/ProductInWarehouse.cs`

### Shipping and delivery

- [Warehouse](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Warehouse.cs): `LogisticsСontrolSystemServer/Models/Warehouse.cs`
- [Package](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Package.cs): `LogisticsСontrolSystemServer/Models/Package.cs`
- [Package state](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/PackageState.cs): `LogisticsСontrolSystemServer/Models/PackageState.cs`
- [Package contents](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Package%D0%A1ontent.cs): `LogisticsСontrolSystemServer/Models/PackageСontent.cs`
- [Vehicle](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Vehicle.cs): `LogisticsСontrolSystemServer/Models/Vehicle.cs`
- [Flight](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Flight.cs): `LogisticsСontrolSystemServer/Models/Flight.cs`
- [Delivery point](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/DeliveryPoint.cs): `LogisticsСontrolSystemServer/Models/DeliveryPoint.cs`
- [Delivery](https://github.com/gookian/logisticscontrolsystemserver/blob/master/Logistics%D0%A1ontrolSystemServer/Models/Delivery.cs): `LogisticsСontrolSystemServer/Models/Delivery.cs`

### Other components

- **API client**

## Connections

- API client → Entity controllers: sends requests
- API client → Authentication endpoint: requests token
- Entity controllers → Generic API: inherits CRUD (evidence: `LogisticsСontrolSystemServer/Controllers/DeliveryController.cs`)
- Generic API → EF repository: constructs (evidence: `LogisticsСontrolSystemServer/Controllers/GenericApiController.cs`)
- Generic API → PostgreSQL context: constructs (evidence: `LogisticsСontrolSystemServer/Controllers/GenericApiController.cs`)
- EF repository → Repository contract: implements (evidence: `LogisticsСontrolSystemServer/DataAccessLayer/Repositories/EFGenericRepository.cs`)
- Generic API → Repository contract: uses (evidence: `LogisticsСontrolSystemServer/Controllers/GenericApiController.cs`)
- PostgreSQL context → PostgreSQL database: configures connection (evidence: `LogisticsСontrolSystemServer/DataAccessLayer/PostgreSQLContext.cs`)
- Authentication endpoint → Token authenticator: delegates authentication (evidence: `LogisticsСontrolSystemServer/Controllers/AuthenticatorController.cs`)
- Token authenticator → User repository: checks credentials (evidence: `LogisticsСontrolSystemServer/Authenticator.cs`)
- User repository → PostgreSQL context: queries users (evidence: `LogisticsСontrolSystemServer/DataAccessLayer/Repositories/UserRepository.cs`)
- Token middleware → Token authenticator: validates token (evidence: `LogisticsСontrolSystemServer/Middlewares/TokenAuthenticationMiddleware.cs`)
- Order detail → Order: references (evidence: `LogisticsСontrolSystemServer/Models/OrderDetail.cs`)
- Order detail → Product data: references (evidence: `LogisticsСontrolSystemServer/Models/OrderDetail.cs`)
- Product → Product data: references (evidence: `LogisticsСontrolSystemServer/Models/Product.cs`)
- Product → Product state: references (evidence: `LogisticsСontrolSystemServer/Models/Product.cs`)
- Warehouse stock → Warehouse: references (evidence: `LogisticsСontrolSystemServer/Models/ProductInWarehouse.cs`)
- Warehouse stock → Product: references (evidence: `LogisticsСontrolSystemServer/Models/ProductInWarehouse.cs`)
- Package → Package state: references (evidence: `LogisticsСontrolSystemServer/Models/Package.cs`)
- Flight → Vehicle: references (evidence: `LogisticsСontrolSystemServer/Models/Flight.cs`)
- Delivery → Warehouse: references (evidence: `LogisticsСontrolSystemServer/Models/Delivery.cs`)
- Delivery → Delivery point: references (evidence: `LogisticsСontrolSystemServer/Models/Delivery.cs`)
- Delivery → Flight: references (evidence: `LogisticsСontrolSystemServer/Models/Delivery.cs`)
- Delivery → Package: references (evidence: `LogisticsСontrolSystemServer/Models/Delivery.cs`)
