# shahmeer-pro/swiftex-logistics architecture

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

- Interactive diagram: https://gitdiagram.com/shahmeer-pro/swiftex-logistics
- Repository: https://github.com/shahmeer-pro/swiftex-logistics

## Overview

SwiftEx is a console-based logistics engine for administrators. The main workflow is authenticated operations: register and validate parcels, prioritize them for sorting, find routes and dispatch them within fleet capacity, then update status and tracking history. The README also documents parcel and admin persistence, dashboards, routing alternatives, and operation logs. The central engine coordinates the runtime; sampled headers show its supporting data structures and entity models. Some engine sections were not sampled, so those relationships are included only where the README documents them.

Main entry points: [`include/logistics.h`](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/logistics.h) (Logistics Engine), [`src/main.cpp`](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/src/main.cpp) (Operations Menu), [`include/tracking.h`](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/tracking.h) (Tracking Timeline), [`include/auth.h`](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/auth.h) (Admin Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Admin Console"]
  node_console["Operations Menu<br/>[main.cpp]"]
  node_authentication["Admin Authentication<br/>[auth.h]"]
  node_adminstore[("Admin Credentials<br/>[admin_db.txt]")]
end

subgraph group_lifecycle["Parcel Lifecycle"]
  node_engine["Logistics Engine<br/>[logistics.h]"]
  node_registration["Parcel Registration<br/>[logistics.h]"]
  node_validation["Input Validation<br/>[validator.h]"]
  node_parcel["Parcel Record<br/>[parcel.h]"]
  node_parcelstore[("Parcel Records<br/>[parcels_db.txt]")]
  node_sorting["Priority Sorting<br/>[logistics.h]"]
  node_dispatch["Dispatch And Delivery<br/>[logistics.h]"]
  node_tracking["Tracking Timeline<br/>[tracking.h]"]
  node_operations["Dashboard And Logs<br/>[logistics.h]"]
end

subgraph group_network["Routing And Fleet"]
  node_routing["Route Optimization<br/>[routing.h]"]
  node_fleet["Fleet Management<br/>[truck.h]"]
end

subgraph group_internals["Runtime Components"]
  node_registry[("Parcel Registry<br/>[hashmap.h]")]
  node_queues["Priority And Transit Queues<br/>[datastructures.h]"]
  node_operationstack["Operation History Stack<br/>[datastructures.h]"]
  node_datetime["Date And Time<br/>[datetime.h]"]
end

node_admin(("Administrator"))

node_admin -->|"uses"| node_console
node_console -->|"authenticates"| node_authentication
node_authentication -->|"reads and writes"| node_adminstore
node_console -->|"invokes operations"| node_engine
node_engine -->|"handles registration"| node_registration
node_registration -->|"validates inputs"| node_validation
node_registration -.->|"creates parcel"| node_parcel
node_engine -->|"persists parcels"| node_parcelstore
node_engine -->|"indexes parcels"| node_registry
node_engine -->|"processes queue"| node_sorting
node_sorting -->|"extracts and enqueues"| node_queues
node_engine -->|"dispatches parcels"| node_dispatch
node_dispatch -->|"computes delivery routes"| node_routing
node_dispatch -->|"checks capacity"| node_fleet
node_engine -->|"updates history"| node_tracking
node_parcel -->|"holds history"| node_tracking
node_engine -->|"serves dashboard and logs"| node_operations
node_engine -.->|"records operations"| node_operationstack
node_tracking -->|"timestamps events"| node_datetime
node_operationstack -->|"timestamps entries"| node_datetime

click node_console "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/src/main.cpp"
click node_authentication "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/auth.h"
click node_adminstore "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/build/data/admin_db.txt"
click node_engine "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/logistics.h"
click node_registration "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/logistics.h"
click node_validation "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/validator.h"
click node_parcel "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/parcel.h"
click node_parcelstore "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/build/parcels_db.txt"
click node_sorting "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/logistics.h"
click node_dispatch "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/logistics.h"
click node_tracking "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/tracking.h"
click node_routing "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/routing.h"
click node_fleet "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/truck.h"
click node_operations "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/logistics.h"
click node_registry "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/hashmap.h"
click node_queues "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/datastructures.h"
click node_operationstack "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/datastructures.h"
click node_datetime "https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/datetime.h"

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_console,node_authentication,node_adminstore toneBlue
class node_engine,node_registration,node_validation,node_parcel,node_parcelstore,node_sorting,node_dispatch,node_tracking,node_operations toneAmber
class node_routing,node_fleet toneMint
class node_registry,node_queues,node_operationstack,node_datetime toneRose
class node_admin toneIndigo
```

## Components

### Admin Console

- [Operations Menu](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/src/main.cpp): `src/main.cpp`
- [Admin Authentication](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/auth.h): `include/auth.h`
- [Admin Credentials](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/build/data/admin_db.txt): `build/data/admin_db.txt`

### Parcel Lifecycle

- [Logistics Engine](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/logistics.h): `include/logistics.h`
- [Parcel Registration](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/logistics.h): `include/logistics.h`
- [Input Validation](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/validator.h): `include/validator.h`
- [Parcel Record](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/parcel.h): `include/parcel.h`
- [Parcel Records](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/build/parcels_db.txt): `build/parcels_db.txt`
- [Priority Sorting](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/logistics.h): `include/logistics.h`
- [Dispatch And Delivery](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/logistics.h): `include/logistics.h`
- [Tracking Timeline](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/tracking.h): `include/tracking.h`
- [Dashboard And Logs](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/logistics.h): `include/logistics.h`

### Routing And Fleet

- [Route Optimization](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/routing.h): `include/routing.h`
- [Fleet Management](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/truck.h): `include/truck.h`

### Runtime Components

- [Parcel Registry](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/hashmap.h): `include/hashmap.h`
- [Priority And Transit Queues](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/datastructures.h): `include/datastructures.h`
- [Operation History Stack](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/datastructures.h): `include/datastructures.h`
- [Date And Time](https://github.com/shahmeer-pro/swiftex-logistics/blob/main/include/datetime.h): `include/datetime.h`

### Other components

- **Administrator**

## Connections

- Administrator → Operations Menu: uses (evidence: `src/main.cpp`)
- Operations Menu → Admin Authentication: authenticates (evidence: `src/main.cpp`)
- Admin Authentication → Admin Credentials: reads and writes (evidence: `include/auth.h`)
- Operations Menu → Logistics Engine: invokes operations (evidence: `src/main.cpp`)
- Logistics Engine → Parcel Registration: handles registration (evidence: `include/logistics.h`)
- Parcel Registration → Input Validation: validates inputs (evidence: `include/logistics.h`)
- Parcel Registration → Parcel Record: creates parcel (evidence: `include/logistics.h`)
- Logistics Engine → Parcel Records: persists parcels (evidence: `README.md`)
- Logistics Engine → Parcel Registry: indexes parcels (evidence: `include/logistics.h`)
- Logistics Engine → Priority Sorting: processes queue (evidence: `include/logistics.h`)
- Priority Sorting → Priority And Transit Queues: extracts and enqueues (evidence: `include/logistics.h`)
- Logistics Engine → Dispatch And Delivery: dispatches parcels (evidence: `src/main.cpp`)
- Dispatch And Delivery → Route Optimization: computes delivery routes (evidence: `README.md`)
- Dispatch And Delivery → Fleet Management: checks capacity (evidence: `README.md`)
- Logistics Engine → Tracking Timeline: updates history (evidence: `include/logistics.h`)
- Parcel Record → Tracking Timeline: holds history (evidence: `include/parcel.h`)
- Logistics Engine → Dashboard And Logs: serves dashboard and logs (evidence: `src/main.cpp`)
- Logistics Engine → Operation History Stack: records operations (evidence: `include/logistics.h`)
- Tracking Timeline → Date And Time: timestamps events (evidence: `include/tracking.h`)
- Operation History Stack → Date And Time: timestamps entries (evidence: `include/datastructures.h`)
