# binary-knights-org/bytebloom-academy-binary-knights architecture

> Architecture diagram of the GitHub repository binary-knights-org/bytebloom-academy-binary-knights, 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/binary-knights-org/bytebloom-academy-binary-knights
- Repository: https://github.com/binary-knights-org/bytebloom-academy-binary-knights

## Overview

Binary Knights is a logistics and routing engine with a small Compose demo frontend. Its principal workflow loads warehouse, package, vehicle, and route data; forms a linked warehouse network; then supports routing, shipment and fleet operations, pricing, and analytics. The graph highlights the repository-backed data boundary and major domain capabilities. Several subsystems are represented by their exact source directories because their individual implementations were not excerpted; those links are not asserted without evidence.

Main entry points: [`src/main/kotlin/data/repository`](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/data/repository) (Repository implementations), [`src/main/kotlin/ui/Main.kt`](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/blob/develop/src/main/kotlin/ui/Main.kt) (CLI demos), [`src/main/kotlin/domain/repository`](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/repository) (Repository contracts), [`src/main/kotlin/domain/usecase/crud`](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/usecase/crud) (Entity CRUD)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_cli["CLI demos<br/>[Main.kt]"]
  node_compose["Compose demo<br/>[App.kt]"]
end

subgraph group_domain["Logistics domain"]
  node_crud["Entity CRUD"]
  node_models["Domain entities"]
  node_routingcases["Routing use cases"]
  node_routers["Pathfinding algorithms"]
  node_shipment["Cargo optimization"]
  node_vehicleops["Fleet operations"]
  node_pricing["Pricing analytics"]
  node_simulation["Dispatch simulation"]
end

subgraph group_data["Data access"]
  node_repos["Repository implementations"]
  node_interfaces["Repository contracts"]
  node_remote["Remote data sources"]
  node_csv["CSV data sources"]
  node_di["Dependency wiring"]
end

subgraph group_ops["Operations"]
end

node_operator(("Operator"))
node_supabase[("Supabase")]
node_csvfiles["CSV files"]

node_operator -->|"runs"| node_cli
node_operator -.->|"opens"| node_compose
node_cli -->|"invokes"| node_routingcases
node_cli -->|"invokes"| node_vehicleops
node_cli -->|"invokes"| node_pricing
node_di -->|"binds"| node_repos
node_repos -->|"implements"| node_interfaces
node_repos -->|"fetches and writes"| node_remote
node_repos -->|"fallback reads"| node_csv
node_remote -.->|"accesses"| node_supabase
node_csv -.->|"reads"| node_csvfiles
node_repos -->|"maps and links"| node_models
node_routingcases -.->|"dispatches"| node_routers
node_routers -->|"loads warehouses"| node_interfaces
node_crud -->|"persists entities"| node_interfaces
node_crud -->|"creates entities"| node_models

click node_cli "https://github.com/binary-knights-org/bytebloom-academy-binary-knights/blob/develop/src/main/kotlin/ui/Main.kt"
click node_compose "https://github.com/binary-knights-org/bytebloom-academy-binary-knights/blob/develop/frontend/logiroute/src/commonMain/kotlin/edu/logiroute/logiroute/App.kt"
click node_crud "https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/usecase/crud"
click node_models "https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/model"
click node_routingcases "https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/usecase/routing"
click node_routers "https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/algorithm/pathfinding"
click node_shipment "https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/usecase/shipment"
click node_vehicleops "https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/usecase/vehicle"
click node_pricing "https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/usecase/analytics"
click node_simulation "https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/algorithm/ring/breakdown"
click node_repos "https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/data/repository"
click node_interfaces "https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/repository"
click node_remote "https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/data/remote"
click node_csv "https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/data/local"
click node_di "https://github.com/binary-knights-org/bytebloom-academy-binary-knights/blob/develop/src/main/kotlin/di/repositoryModule.kt"

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_cli,node_compose toneBlue
class node_crud,node_models,node_routingcases,node_routers,node_shipment,node_vehicleops,node_pricing,node_simulation,node_supabase toneAmber
class node_repos,node_interfaces,node_remote,node_csv,node_di toneMint
class node_operator,node_csvfiles toneIndigo
```

## Components

### Entry points

- [CLI demos](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/blob/develop/src/main/kotlin/ui/Main.kt): `src/main/kotlin/ui/Main.kt`
- [Compose demo](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/blob/develop/frontend/logiroute/src/commonMain/kotlin/edu/logiroute/logiroute/App.kt): `frontend/logiroute/src/commonMain/kotlin/edu/logiroute/logiroute/App.kt`

### Logistics domain

- [Entity CRUD](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/usecase/crud): `src/main/kotlin/domain/usecase/crud`
- [Domain entities](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/model): `src/main/kotlin/domain/model`
- [Routing use cases](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/usecase/routing): `src/main/kotlin/domain/usecase/routing`
- [Pathfinding algorithms](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/algorithm/pathfinding): `src/main/kotlin/domain/algorithm/pathfinding`
- [Cargo optimization](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/usecase/shipment): `src/main/kotlin/domain/usecase/shipment`
- [Fleet operations](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/usecase/vehicle): `src/main/kotlin/domain/usecase/vehicle`
- [Pricing analytics](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/usecase/analytics): `src/main/kotlin/domain/usecase/analytics`
- [Dispatch simulation](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/algorithm/ring/breakdown): `src/main/kotlin/domain/algorithm/ring/breakdown`

### Data access

- [Repository implementations](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/data/repository): `src/main/kotlin/data/repository`
- [Repository contracts](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/domain/repository): `src/main/kotlin/domain/repository`
- [Remote data sources](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/data/remote): `src/main/kotlin/data/remote`
- [CSV data sources](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/tree/develop/src/main/kotlin/data/local): `src/main/kotlin/data/local`
- [Dependency wiring](https://github.com/binary-knights-org/bytebloom-academy-binary-knights/blob/develop/src/main/kotlin/di/repositoryModule.kt): `src/main/kotlin/di/repositoryModule.kt`

### Other components

- **Operator**
- **Supabase**
- **CSV files**

## Connections

- Operator → CLI demos: runs (evidence: `src/main/kotlin/ui/Main.kt`)
- Operator → Compose demo: opens
- CLI demos → Routing use cases: invokes (evidence: `src/main/kotlin/ui/Main.kt`)
- CLI demos → Fleet operations: invokes (evidence: `src/main/kotlin/ui/Main.kt`)
- CLI demos → Pricing analytics: invokes (evidence: `src/main/kotlin/ui/Main.kt`)
- Dependency wiring → Repository implementations: binds (evidence: `src/main/kotlin/di/repositoryModule.kt`)
- Repository implementations → Repository contracts: implements (evidence: `src/main/kotlin/data/repository/PackageRepositoryImpl.kt`)
- Repository implementations → Remote data sources: fetches and writes (evidence: `src/main/kotlin/data/repository/WarehouseRepositoryImpl.kt`)
- Repository implementations → CSV data sources: fallback reads (evidence: `src/main/kotlin/data/repository/WarehouseRepositoryImpl.kt`)
- Remote data sources → Supabase: accesses
- CSV data sources → CSV files: reads
- Repository implementations → Domain entities: maps and links (evidence: `src/main/kotlin/data/repository/WarehouseRepositoryImpl.kt`)
- Routing use cases → Pathfinding algorithms: dispatches (evidence: `src/main/kotlin/domain/usecase/routing/FindBidirectionalRouteUseCase.kt`)
- Pathfinding algorithms → Repository contracts: loads warehouses (evidence: `src/main/kotlin/domain/algorithm/pathfinding/BidirectionalBfsRouter.kt`)
- Entity CRUD → Repository contracts: persists entities (evidence: `README.md`)
- Entity CRUD → Domain entities: creates entities (evidence: `README.md`)
