# 1311hub/trashverse architecture

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

- Interactive diagram: https://gitdiagram.com/1311hub/trashverse
- Repository: https://github.com/1311hub/trashverse

## Overview

Trashverse is a C++ smart waste-collection system for monitoring bin fill, organizing bins by zone, planning collection routes, and reporting worker pay. The visible data workflow loads bin and road CSVs into in-memory structures; those structures support route planning and monitoring views. The menu also advertises time simulation and data regeneration. The README gives no operational detail, and the tiny main.cpp excerpt provides no visible orchestration, so links between menu actions and those capabilities are not asserted. Edges reflect only calls or data use shown in excerpts or SOURCE INDEX references.

Main entry points: [`src/data.cpp`](https://github.com/1311hub/trashverse/blob/main/src/data.cpp) (Data manager), [`src/graph.cpp`](https://github.com/1311hub/trashverse/blob/main/src/graph.cpp) (Road graph and routes), [`src/hashmap.cpp`](https://github.com/1311hub/trashverse/blob/main/src/hashmap.cpp) (Bin records), [`src/tree.cpp`](https://github.com/1311hub/trashverse/blob/main/src/tree.cpp) (Zone hierarchy and statistics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Data and monitoring"]
  node_manager["Data manager<br/>[data.cpp]"]
  node_bins[("Bin records<br/>[hashmap.cpp]")]
  node_monitor["Bin and map views<br/>[display.cpp]"]
end

subgraph group_routing["Road routing"]
  node_graph["Road graph and routes<br/>[graph.cpp]"]
  node_routeview["Route view<br/>[display.cpp]"]
  node_minheap["Dijkstra min-heap<br/>[graph.cpp]"]
end

subgraph group_structure["Priority and queue structures"]
  node_maxheap["Fill priority heap<br/>[heap.cpp]"]
  node_queue["Queue<br/>[queue.cpp]"]
end

subgraph group_operations["Zones and workforce"]
  node_zones["Zone hierarchy and statistics<br/>[tree.cpp]"]
  node_zoneview["Zone statistics view<br/>[display.cpp]"]
  node_ledger["Worker ledger and pay<br/>[ledger.cpp]"]
  node_payview["Payment report view<br/>[display.cpp]"]
end

node_operator(("Operator"))
node_entry["Program entry<br/>[main.cpp]"]

node_manager -->|"loads records"| node_bins
node_manager -->|"loads roads"| node_graph
node_manager -->|"builds hierarchy"| node_zones
node_monitor -->|"reads bins"| node_bins
node_routeview -.->|"renders route result"| node_graph
node_graph -->|"uses heap"| node_minheap
node_zoneview -->|"calls displays"| node_zones
node_payview -->|"calls report"| node_ledger
node_operator -.->|"starts program"| node_entry

click node_entry "https://github.com/1311hub/trashverse/blob/main/src/main.cpp"
click node_manager "https://github.com/1311hub/trashverse/blob/main/src/data.cpp"
click node_bins "https://github.com/1311hub/trashverse/blob/main/src/hashmap.cpp"
click node_monitor "https://github.com/1311hub/trashverse/blob/main/src/display.cpp"
click node_graph "https://github.com/1311hub/trashverse/blob/main/src/graph.cpp"
click node_routeview "https://github.com/1311hub/trashverse/blob/main/src/display.cpp"
click node_minheap "https://github.com/1311hub/trashverse/blob/main/src/graph.cpp"
click node_maxheap "https://github.com/1311hub/trashverse/blob/main/src/heap.cpp"
click node_queue "https://github.com/1311hub/trashverse/blob/main/src/queue.cpp"
click node_zones "https://github.com/1311hub/trashverse/blob/main/src/tree.cpp"
click node_zoneview "https://github.com/1311hub/trashverse/blob/main/src/display.cpp"
click node_ledger "https://github.com/1311hub/trashverse/blob/main/src/ledger.cpp"
click node_payview "https://github.com/1311hub/trashverse/blob/main/src/display.cpp"

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_manager,node_bins,node_monitor toneBlue
class node_graph,node_routeview,node_minheap toneAmber
class node_maxheap,node_queue toneMint
class node_zones,node_zoneview,node_ledger,node_payview toneRose
class node_operator toneIndigo
class node_entry toneTeal
```

## Components

### Data and monitoring

- [Data manager](https://github.com/1311hub/trashverse/blob/main/src/data.cpp): `src/data.cpp`
- [Bin records](https://github.com/1311hub/trashverse/blob/main/src/hashmap.cpp): `src/hashmap.cpp`
- [Bin and map views](https://github.com/1311hub/trashverse/blob/main/src/display.cpp): `src/display.cpp`

### Road routing

- [Road graph and routes](https://github.com/1311hub/trashverse/blob/main/src/graph.cpp): `src/graph.cpp`
- [Route view](https://github.com/1311hub/trashverse/blob/main/src/display.cpp): `src/display.cpp`
- [Dijkstra min-heap](https://github.com/1311hub/trashverse/blob/main/src/graph.cpp): `src/graph.cpp`

### Priority and queue structures

- [Fill priority heap](https://github.com/1311hub/trashverse/blob/main/src/heap.cpp): `src/heap.cpp`
- [Queue](https://github.com/1311hub/trashverse/blob/main/src/queue.cpp): `src/queue.cpp`

### Zones and workforce

- [Zone hierarchy and statistics](https://github.com/1311hub/trashverse/blob/main/src/tree.cpp): `src/tree.cpp`
- [Zone statistics view](https://github.com/1311hub/trashverse/blob/main/src/display.cpp): `src/display.cpp`
- [Worker ledger and pay](https://github.com/1311hub/trashverse/blob/main/src/ledger.cpp): `src/ledger.cpp`
- [Payment report view](https://github.com/1311hub/trashverse/blob/main/src/display.cpp): `src/display.cpp`

### Other components

- **Operator**
- [Program entry](https://github.com/1311hub/trashverse/blob/main/src/main.cpp): `src/main.cpp`

## Connections

- Data manager → Bin records: loads records (evidence: `src/data.cpp`)
- Data manager → Road graph and routes: loads roads (evidence: `src/data.cpp`)
- Data manager → Zone hierarchy and statistics: builds hierarchy (evidence: `src/data.cpp`)
- Bin and map views → Bin records: reads bins (evidence: `src/display.cpp`)
- Route view → Road graph and routes: renders route result
- Road graph and routes → Dijkstra min-heap: uses heap (evidence: `src/graph.cpp`)
- Zone statistics view → Zone hierarchy and statistics: calls displays (evidence: `src/display.cpp`)
- Payment report view → Worker ledger and pay: calls report (evidence: `src/display.cpp`)
- Operator → Program entry: starts program
