# xcesoo/manta architecture

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

- Interactive diagram: https://gitdiagram.com/xcesoo/manta
- Repository: https://github.com/xcesoo/manta

## Overview

Manta is a parcel logistics API for creating and tracking parcels, managing delivery points and vehicles, authenticating users, and updating parcel status during delivery. The principal workflow enters through the parcel API, creates or retrieves parcels, and applies delivery operations and status rules; infrastructure persists domain state and supports message processing. The source index provides call/reference evidence for the shown links. No README or consumer/controller dispatch implementation was provided, so those relationships are not asserted.

Main entry points: [`Manta.Application/Services/ParcelDeliveryService.cs`](https://github.com/xcesoo/manta/blob/main/Manta.Application/Services/ParcelDeliveryService.cs) (Delivery operations), [`Manta.Application/Handlers/AcceptParcelAtDeliveryPointHandler.cs`](https://github.com/xcesoo/manta/blob/main/Manta.Application/Handlers/AcceptParcelAtDeliveryPointHandler.cs) (Accept at point), [`Manta.WebApi/Controllers/ParcelController.cs`](https://github.com/xcesoo/manta/blob/main/Manta.WebApi/Controllers/ParcelController.cs) (Parcel API), [`Manta.Application/Commands/Parcel/CreateParcelCommandHandler.cs`](https://github.com/xcesoo/manta/blob/main/Manta.Application/Commands/Parcel/CreateParcelCommandHandler.cs) (Create parcel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Web API"]
  node_parcel_api["Parcel API"]
  node_auth_api["Authentication API<br/>[AuthController.cs]"]
  node_point_api["Delivery point API"]
end

subgraph group_application["Application workflows"]
  node_parcel_create["Create parcel"]
  node_parcel_accept["Accept at point"]
  node_parcel_queries["Parcel lookup"]
  node_point_create["Create delivery point"]
  node_point_query["Delivery point lookup"]
  node_login["Login"]
  node_delivery_service["Delivery operations"]
end

subgraph group_domain["Logistics domain"]
  node_parcel["Parcel state<br/>[Parcel.cs]"]
  node_users["Users and roles<br/>[User.cs]"]
  node_delivery_entities["Points and vehicles<br/>[DeliveryPoint.cs]"]
  node_status_service["Status transitions"]
  node_rule_context["Rule context<br/>[RuleContext.cs]"]
end

subgraph group_infrastructure["Persistence and messaging"]
  node_parcel_repository["Parcel repository"]
  node_user_repository["User repository<br/>[UserRepository.cs]"]
  node_point_repository["Point repository"]
  node_vehicle_repository["Vehicle repository"]
  node_database[("Application database<br/>[MantaDbContext.cs]")]
  node_message_queue["Integration queue"]
  node_parcel_consumer["Parcel message consumer"]
  node_status_consumer["Status update consumer"]
  node_jwt["JWT provider<br/>[JwtProvider.cs]"]
end

node_caller(("API caller"))

node_caller -->|"requests"| node_parcel_api
node_caller -->|"authenticates"| node_auth_api
node_caller -->|"manages points"| node_point_api
node_parcel_api -->|"creates"| node_parcel_create
node_parcel_api -->|"queries"| node_parcel_queries
node_parcel_api -->|"delegates delivery"| node_delivery_service
node_point_api -->|"creates"| node_point_create
node_point_api -->|"queries"| node_point_query
node_auth_api -->|"logs in"| node_login
node_parcel_create -->|"creates"| node_parcel
node_parcel_create -->|"enqueues"| node_message_queue
node_parcel_accept -->|"loads and updates"| node_parcel_repository
node_parcel_accept -->|"loads user"| node_user_repository
node_parcel_accept -->|"loads point"| node_point_repository
node_parcel_accept -->|"loads vehicle"| node_vehicle_repository
node_parcel_accept -->|"applies status"| node_status_service
node_delivery_service -->|"uses"| node_parcel_repository
node_delivery_service -->|"uses"| node_point_repository
node_delivery_service -->|"uses"| node_vehicle_repository
node_delivery_service -->|"uses"| node_user_repository
node_delivery_service -->|"applies transitions"| node_status_service
node_login -->|"finds user"| node_user_repository
node_login -->|"issues token"| node_jwt
node_parcel_queries -->|"reads parcel"| node_parcel_repository
node_point_query -->|"reads point"| node_point_repository
node_status_service -->|"evaluates rules"| node_rule_context
node_status_service -->|"changes status"| node_parcel
node_parcel_repository -->|"reads and writes"| node_database
node_user_repository -->|"reads and writes"| node_database
node_point_repository -.->|"reads and writes"| node_database
node_vehicle_repository -->|"reads and writes"| node_database
node_parcel_consumer -.->|"dispatches"| node_parcel_create
node_status_consumer -.->|"dispatches updates"| node_parcel_accept

click node_parcel_api "https://github.com/xcesoo/manta/blob/main/Manta.WebApi/Controllers/ParcelController.cs"
click node_auth_api "https://github.com/xcesoo/manta/blob/main/Manta.WebApi/Controllers/AuthController.cs"
click node_point_api "https://github.com/xcesoo/manta/blob/main/Manta.WebApi/Controllers/DeliveryPointController.cs"
click node_parcel_create "https://github.com/xcesoo/manta/blob/main/Manta.Application/Commands/Parcel/CreateParcelCommandHandler.cs"
click node_parcel_accept "https://github.com/xcesoo/manta/blob/main/Manta.Application/Handlers/AcceptParcelAtDeliveryPointHandler.cs"
click node_parcel_queries "https://github.com/xcesoo/manta/blob/main/Manta.Application/Queries/Parcel/GetParcelByIdQueryHandler.cs"
click node_point_create "https://github.com/xcesoo/manta/blob/main/Manta.Application/Commands/DeliveryPoint/CreateDeliveryPointCommandHandler.cs"
click node_point_query "https://github.com/xcesoo/manta/blob/main/Manta.Application/Queries/DeliveryPoint/GetDeliveryPointByIdQueryHandler.cs"
click node_login "https://github.com/xcesoo/manta/blob/main/Manta.Application/Queries/Auth/LoginQueryHandler.cs"
click node_delivery_service "https://github.com/xcesoo/manta/blob/main/Manta.Application/Services/ParcelDeliveryService.cs"
click node_parcel "https://github.com/xcesoo/manta/blob/main/Manta.Domain/Entities/Parcel.cs"
click node_users "https://github.com/xcesoo/manta/blob/main/Manta.Domain/Entities/User.cs"
click node_delivery_entities "https://github.com/xcesoo/manta/blob/main/Manta.Domain/Entities/DeliveryPoint.cs"
click node_status_service "https://github.com/xcesoo/manta/blob/main/Manta.Domain/Services/ParcelStatusService.cs"
click node_rule_context "https://github.com/xcesoo/manta/blob/main/Manta.Domain/StatusRules/Context/RuleContext.cs"
click node_parcel_repository "https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Repositories/ParcelRepository.cs"
click node_user_repository "https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Repositories/UserRepository.cs"
click node_point_repository "https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Repositories/DeliveryPointRepository.cs"
click node_vehicle_repository "https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Repositories/DeliveryVehicleRepository.cs"
click node_database "https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Persistence/MantaDbContext.cs"
click node_message_queue "https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Messaging/IntegrationMessageQueue.cs"
click node_parcel_consumer "https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Consumers/CreateParcelConsumer.cs"
click node_status_consumer "https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Consumers/ParcelStatusUpdateConsumer.cs"
click node_jwt "https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Auth/JwtProvider.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_parcel_api,node_auth_api,node_point_api toneBlue
class node_parcel_create,node_parcel_accept,node_parcel_queries,node_point_create,node_point_query,node_login,node_delivery_service toneAmber
class node_parcel,node_users,node_delivery_entities,node_status_service,node_rule_context,node_caller toneMint
class node_parcel_repository,node_user_repository,node_point_repository,node_vehicle_repository,node_database,node_message_queue,node_parcel_consumer,node_status_consumer,node_jwt toneRose
```

## Components

### Web API

- [Parcel API](https://github.com/xcesoo/manta/blob/main/Manta.WebApi/Controllers/ParcelController.cs): `Manta.WebApi/Controllers/ParcelController.cs`
- [Authentication API](https://github.com/xcesoo/manta/blob/main/Manta.WebApi/Controllers/AuthController.cs): `Manta.WebApi/Controllers/AuthController.cs`
- [Delivery point API](https://github.com/xcesoo/manta/blob/main/Manta.WebApi/Controllers/DeliveryPointController.cs): `Manta.WebApi/Controllers/DeliveryPointController.cs`

### Application workflows

- [Create parcel](https://github.com/xcesoo/manta/blob/main/Manta.Application/Commands/Parcel/CreateParcelCommandHandler.cs): `Manta.Application/Commands/Parcel/CreateParcelCommandHandler.cs`
- [Accept at point](https://github.com/xcesoo/manta/blob/main/Manta.Application/Handlers/AcceptParcelAtDeliveryPointHandler.cs): `Manta.Application/Handlers/AcceptParcelAtDeliveryPointHandler.cs`
- [Parcel lookup](https://github.com/xcesoo/manta/blob/main/Manta.Application/Queries/Parcel/GetParcelByIdQueryHandler.cs): `Manta.Application/Queries/Parcel/GetParcelByIdQueryHandler.cs`
- [Create delivery point](https://github.com/xcesoo/manta/blob/main/Manta.Application/Commands/DeliveryPoint/CreateDeliveryPointCommandHandler.cs): `Manta.Application/Commands/DeliveryPoint/CreateDeliveryPointCommandHandler.cs`
- [Delivery point lookup](https://github.com/xcesoo/manta/blob/main/Manta.Application/Queries/DeliveryPoint/GetDeliveryPointByIdQueryHandler.cs): `Manta.Application/Queries/DeliveryPoint/GetDeliveryPointByIdQueryHandler.cs`
- [Login](https://github.com/xcesoo/manta/blob/main/Manta.Application/Queries/Auth/LoginQueryHandler.cs): `Manta.Application/Queries/Auth/LoginQueryHandler.cs`
- [Delivery operations](https://github.com/xcesoo/manta/blob/main/Manta.Application/Services/ParcelDeliveryService.cs): `Manta.Application/Services/ParcelDeliveryService.cs`

### Logistics domain

- [Parcel state](https://github.com/xcesoo/manta/blob/main/Manta.Domain/Entities/Parcel.cs): `Manta.Domain/Entities/Parcel.cs`
- [Users and roles](https://github.com/xcesoo/manta/blob/main/Manta.Domain/Entities/User.cs): `Manta.Domain/Entities/User.cs`
- [Points and vehicles](https://github.com/xcesoo/manta/blob/main/Manta.Domain/Entities/DeliveryPoint.cs): `Manta.Domain/Entities/DeliveryPoint.cs`
- [Status transitions](https://github.com/xcesoo/manta/blob/main/Manta.Domain/Services/ParcelStatusService.cs): `Manta.Domain/Services/ParcelStatusService.cs`
- [Rule context](https://github.com/xcesoo/manta/blob/main/Manta.Domain/StatusRules/Context/RuleContext.cs): `Manta.Domain/StatusRules/Context/RuleContext.cs`

### Persistence and messaging

- [Parcel repository](https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Repositories/ParcelRepository.cs): `Manta.Infrastructure/Repositories/ParcelRepository.cs`
- [User repository](https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Repositories/UserRepository.cs): `Manta.Infrastructure/Repositories/UserRepository.cs`
- [Point repository](https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Repositories/DeliveryPointRepository.cs): `Manta.Infrastructure/Repositories/DeliveryPointRepository.cs`
- [Vehicle repository](https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Repositories/DeliveryVehicleRepository.cs): `Manta.Infrastructure/Repositories/DeliveryVehicleRepository.cs`
- [Application database](https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Persistence/MantaDbContext.cs): `Manta.Infrastructure/Persistence/MantaDbContext.cs`
- [Integration queue](https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Messaging/IntegrationMessageQueue.cs): `Manta.Infrastructure/Messaging/IntegrationMessageQueue.cs`
- [Parcel message consumer](https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Consumers/CreateParcelConsumer.cs): `Manta.Infrastructure/Consumers/CreateParcelConsumer.cs`
- [Status update consumer](https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Consumers/ParcelStatusUpdateConsumer.cs): `Manta.Infrastructure/Consumers/ParcelStatusUpdateConsumer.cs`
- [JWT provider](https://github.com/xcesoo/manta/blob/main/Manta.Infrastructure/Auth/JwtProvider.cs): `Manta.Infrastructure/Auth/JwtProvider.cs`

### Other components

- **API caller**

## Connections

- API caller → Parcel API: requests (evidence: `Manta.WebApi/Controllers/ParcelController.cs`)
- API caller → Authentication API: authenticates (evidence: `Manta.WebApi/Controllers/AuthController.cs`)
- API caller → Delivery point API: manages points (evidence: `Manta.WebApi/Controllers/DeliveryPointController.cs`)
- Parcel API → Create parcel: creates (evidence: `Manta.WebApi/Controllers/ParcelController.cs`)
- Parcel API → Parcel lookup: queries (evidence: `Manta.WebApi/Controllers/ParcelController.cs`)
- Parcel API → Delivery operations: delegates delivery (evidence: `Manta.WebApi/Controllers/ParcelController.cs`)
- Delivery point API → Create delivery point: creates (evidence: `Manta.WebApi/Controllers/DeliveryPointController.cs`)
- Delivery point API → Delivery point lookup: queries (evidence: `Manta.WebApi/Controllers/DeliveryPointController.cs`)
- Authentication API → Login: logs in (evidence: `Manta.WebApi/Controllers/AuthController.cs`)
- Create parcel → Parcel state: creates (evidence: `Manta.Application/Commands/Parcel/CreateParcelCommandHandler.cs`)
- Create parcel → Integration queue: enqueues (evidence: `Manta.Application/Commands/Parcel/CreateParcelCommandHandler.cs`)
- Accept at point → Parcel repository: loads and updates (evidence: `Manta.Application/Handlers/AcceptParcelAtDeliveryPointHandler.cs`)
- Accept at point → User repository: loads user (evidence: `Manta.Application/Handlers/AcceptParcelAtDeliveryPointHandler.cs`)
- Accept at point → Point repository: loads point (evidence: `Manta.Application/Handlers/AcceptParcelAtDeliveryPointHandler.cs`)
- Accept at point → Vehicle repository: loads vehicle (evidence: `Manta.Application/Handlers/AcceptParcelAtDeliveryPointHandler.cs`)
- Accept at point → Status transitions: applies status (evidence: `Manta.Application/Handlers/AcceptParcelAtDeliveryPointHandler.cs`)
- Delivery operations → Parcel repository: uses (evidence: `Manta.Application/Services/ParcelDeliveryService.cs`)
- Delivery operations → Point repository: uses (evidence: `Manta.Application/Services/ParcelDeliveryService.cs`)
- Delivery operations → Vehicle repository: uses (evidence: `Manta.Application/Services/ParcelDeliveryService.cs`)
- Delivery operations → User repository: uses (evidence: `Manta.Application/Services/ParcelDeliveryService.cs`)
- Delivery operations → Status transitions: applies transitions (evidence: `Manta.Application/Services/ParcelDeliveryService.cs`)
- Login → User repository: finds user (evidence: `Manta.Application/Queries/Auth/LoginQueryHandler.cs`)
- Login → JWT provider: issues token (evidence: `Manta.Application/Queries/Auth/LoginQueryHandler.cs`)
- Parcel lookup → Parcel repository: reads parcel (evidence: `Manta.Application/Queries/Parcel/GetParcelByIdQueryHandler.cs`)
- Delivery point lookup → Point repository: reads point (evidence: `Manta.Application/Queries/DeliveryPoint/GetDeliveryPointByIdQueryHandler.cs`)
- Status transitions → Rule context: evaluates rules (evidence: `Manta.Domain/Services/ParcelStatusService.cs`)
- Status transitions → Parcel state: changes status (evidence: `Manta.Domain/Services/ParcelStatusService.cs`)
- Parcel repository → Application database: reads and writes (evidence: `Manta.Infrastructure/Repositories/ParcelRepository.cs`)
- User repository → Application database: reads and writes (evidence: `Manta.Infrastructure/Repositories/UserRepository.cs`)
- Point repository → Application database: reads and writes
- Vehicle repository → Application database: reads and writes (evidence: `Manta.Infrastructure/Repositories/DeliveryVehicleRepository.cs`)
- Parcel message consumer → Create parcel: dispatches
- Status update consumer → Accept at point: dispatches updates
