# dubovecfilip/waybill architecture

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

- Interactive diagram: https://gitdiagram.com/dubovecfilip/waybill
- Repository: https://github.com/dubovecfilip/waybill

## Overview

Waybill is a local-first Windows tracker for ETS2 and ATS. The main workflow is game telemetry through normalization and job tracking, then persistence and presentation as live status, delivery history, statistics, maps, and printable waybills. The README documents additional capabilities such as awards, sitting summaries, TrucksBook import, game launch, and Discord presence; those are represented where the tree supports them. Some subsystem links are documented rather than verified in sampled implementation, so they are dashed.

Main entry points: [`src/Waybill/MainForm.cs`](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/MainForm.cs) (Application window), [`src/Waybill/Tracking/TrackerEngine.cs`](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Tracking/TrackerEngine.cs) (Tracker engine), [`src/Waybill/Storage/DeliveryStore.cs`](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Storage/DeliveryStore.cs) (Delivery database), [`src/Waybill/Tracking/Sessions.cs`](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Tracking/Sessions.cs) (Sitting summaries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Tracking runtime"]
  node_engine["Tracker engine<br/>[TrackerEngine.cs]"]
  node_sdk["Telemetry client<br/>[SharedMemory.cs]"]
  node_telemetry["Telemetry model<br/>[SCSTelemetry.cs]"]
  node_adapter["Snapshot adapter<br/>[Adapter.cs]"]
  node_jobtracker["Job lifecycle and verdicts<br/>[JobTracker.cs]"]
end

subgraph group_history["Delivery history"]
  node_record["Delivery record<br/>[JobRecord.cs]"]
  node_store[("Delivery database<br/>[DeliveryStore.cs]")]
  node_recordings["Session recordings<br/>[SessionFiles.cs]"]
  node_sessions["Sitting summaries<br/>[Sessions.cs]"]
  node_awards["Awards and levels<br/>[Awards.cs]"]
  node_import["TrucksBook import"]
end

subgraph group_presentation["Desktop experience"]
  node_main["Application window<br/>[MainForm.cs]"]
  node_live["Live drive view<br/>[MainForm.Live.cs]"]
  node_deliverylist["Delivery history<br/>[DeliveryList.cs]"]
  node_card["Delivery details<br/>[MainForm.Card.cs]"]
  node_route["Route visualization<br/>[RouteView.cs]"]
  node_height["Elevation view<br/>[HeightView.cs]"]
  node_backdrop["Map backdrop<br/>[MapBackdrop.cs]"]
  node_places["Place names<br/>[Places.cs]"]
end

subgraph group_exports["Documents and integrations"]
  node_sheet["Waybill documents<br/>[WaybillSheet.cs]"]
  node_discord["Discord presence<br/>[DiscordPresence.cs]"]
  node_launcher["Game launcher<br/>[GameLauncher.cs]"]
end

subgraph group_support["Shared capabilities"]
  node_settings["Settings<br/>[Settings.cs]"]
  node_units["Units and currency<br/>[Units.cs]"]
  node_strings["Translations<br/>[Strings.cs]"]
end

node_driver(("Driver"))
node_game["Truck simulator"]

node_driver -->|"uses"| node_main
node_game -.->|"publishes telemetry"| node_sdk
node_main -->|"starts tracking"| node_engine
node_engine -->|"connects to"| node_sdk
node_sdk -->|"decodes"| node_telemetry
node_engine -->|"normalizes"| node_adapter
node_adapter -->|"maps from"| node_telemetry
node_engine -->|"feeds snapshots"| node_jobtracker
node_jobtracker -->|"builds"| node_record
node_engine -->|"saves deliveries"| node_store
node_engine -->|"records telemetry"| node_recordings
node_main -->|"loads history"| node_store
node_main -.->|"shows current drive"| node_live
node_main -->|"shows deliveries"| node_deliverylist
node_deliverylist -.->|"reads deliveries"| node_store
node_main -.->|"opens details"| node_card
node_main -->|"shows routes"| node_route
node_route -->|"draws over"| node_backdrop
node_backdrop -->|"uses place data"| node_places
node_main -.->|"shows elevation"| node_height
node_sessions -->|"gets drive totals"| node_store
node_sessions -->|"reads recordings"| node_recordings
node_main -.->|"shows sittings"| node_sessions
node_main -.->|"shows awards"| node_awards
node_awards -.->|"reads delivery history"| node_store
node_import -->|"imports history"| node_store
node_main -.->|"offers import"| node_import
node_main -.->|"exports waybill"| node_sheet
node_sheet -.->|"reads delivery data"| node_store
node_main -->|"updates presence"| node_discord
node_discord -->|"reads configuration"| node_settings
node_main -->|"launches game"| node_launcher
node_main -->|"loads preferences"| node_settings
node_settings -->|"selects display units"| node_units
node_main -->|"renders translated text"| node_strings

click node_main "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/MainForm.cs"
click node_live "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/MainForm.Live.cs"
click node_deliverylist "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/DeliveryList.cs"
click node_card "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/MainForm.Card.cs"
click node_route "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/RouteView.cs"
click node_height "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/HeightView.cs"
click node_backdrop "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/MapBackdrop.cs"
click node_places "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Places.cs"
click node_engine "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Tracking/TrackerEngine.cs"
click node_sdk "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/SCSSdkClient/SharedMemory.cs"
click node_telemetry "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/SCSSdkClient/Object/SCSTelemetry.cs"
click node_adapter "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Tracking/Adapter.cs"
click node_jobtracker "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Tracking/JobTracker.cs"
click node_record "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Tracking/JobRecord.cs"
click node_store "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Storage/DeliveryStore.cs"
click node_recordings "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Tracking/SessionFiles.cs"
click node_sessions "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Tracking/Sessions.cs"
click node_awards "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Tracking/Awards.cs"
click node_import "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Storage/TrucksBookImport.cs"
click node_sheet "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/WaybillSheet.cs"
click node_discord "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Integrations/DiscordPresence.cs"
click node_launcher "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/GameLauncher.cs"
click node_settings "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Settings.cs"
click node_units "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Units.cs"
click node_strings "https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Strings.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_engine,node_sdk,node_telemetry,node_adapter,node_jobtracker toneBlue
class node_record,node_store,node_recordings,node_sessions,node_awards,node_import toneAmber
class node_main,node_live,node_deliverylist,node_card,node_route,node_height,node_backdrop,node_places toneMint
class node_sheet,node_discord,node_launcher toneRose
class node_settings,node_units,node_strings,node_driver,node_game toneIndigo
```

## Components

### Tracking runtime

- [Tracker engine](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Tracking/TrackerEngine.cs): `src/Waybill/Tracking/TrackerEngine.cs`
- [Telemetry client](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/SCSSdkClient/SharedMemory.cs): `src/Waybill/SCSSdkClient/SharedMemory.cs`
- [Telemetry model](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/SCSSdkClient/Object/SCSTelemetry.cs): `src/Waybill/SCSSdkClient/Object/SCSTelemetry.cs`
- [Snapshot adapter](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Tracking/Adapter.cs): `src/Waybill/Tracking/Adapter.cs`
- [Job lifecycle and verdicts](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Tracking/JobTracker.cs): `src/Waybill/Tracking/JobTracker.cs`

### Delivery history

- [Delivery record](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Tracking/JobRecord.cs): `src/Waybill/Tracking/JobRecord.cs`
- [Delivery database](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Storage/DeliveryStore.cs): `src/Waybill/Storage/DeliveryStore.cs`
- [Session recordings](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Tracking/SessionFiles.cs): `src/Waybill/Tracking/SessionFiles.cs`
- [Sitting summaries](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Tracking/Sessions.cs): `src/Waybill/Tracking/Sessions.cs`
- [Awards and levels](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Tracking/Awards.cs): `src/Waybill/Tracking/Awards.cs`
- [TrucksBook import](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Storage/TrucksBookImport.cs): `src/Waybill/Storage/TrucksBookImport.cs`

### Desktop experience

- [Application window](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/MainForm.cs): `src/Waybill/MainForm.cs`
- [Live drive view](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/MainForm.Live.cs): `src/Waybill/MainForm.Live.cs`
- [Delivery history](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/DeliveryList.cs): `src/Waybill/DeliveryList.cs`
- [Delivery details](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/MainForm.Card.cs): `src/Waybill/MainForm.Card.cs`
- [Route visualization](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/RouteView.cs): `src/Waybill/RouteView.cs`
- [Elevation view](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/HeightView.cs): `src/Waybill/HeightView.cs`
- [Map backdrop](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/MapBackdrop.cs): `src/Waybill/MapBackdrop.cs`
- [Place names](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Places.cs): `src/Waybill/Places.cs`

### Documents and integrations

- [Waybill documents](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/WaybillSheet.cs): `src/Waybill/WaybillSheet.cs`
- [Discord presence](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Integrations/DiscordPresence.cs): `src/Waybill/Integrations/DiscordPresence.cs`
- [Game launcher](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/GameLauncher.cs): `src/Waybill/GameLauncher.cs`

### Shared capabilities

- [Settings](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Settings.cs): `src/Waybill/Settings.cs`
- [Units and currency](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Units.cs): `src/Waybill/Units.cs`
- [Translations](https://github.com/dubovecfilip/waybill/blob/main/src/Waybill/Strings.cs): `src/Waybill/Strings.cs`

### Other components

- **Driver**
- **Truck simulator**

## Connections

- Driver → Application window: uses
- Truck simulator → Telemetry client: publishes telemetry
- Application window → Tracker engine: starts tracking (evidence: `src/Waybill/MainForm.cs`)
- Tracker engine → Telemetry client: connects to (evidence: `src/Waybill/Tracking/TrackerEngine.cs`)
- Telemetry client → Telemetry model: decodes (evidence: `src/Waybill/SCSSdkClient/SharedMemory.cs`)
- Tracker engine → Snapshot adapter: normalizes (evidence: `src/Waybill/Tracking/TrackerEngine.cs`)
- Snapshot adapter → Telemetry model: maps from (evidence: `src/Waybill/Tracking/Adapter.cs`)
- Tracker engine → Job lifecycle and verdicts: feeds snapshots (evidence: `src/Waybill/Tracking/TrackerEngine.cs`)
- Job lifecycle and verdicts → Delivery record: builds (evidence: `src/Waybill/Tracking/JobTracker.cs`)
- Tracker engine → Delivery database: saves deliveries (evidence: `src/Waybill/Tracking/TrackerEngine.cs`)
- Tracker engine → Session recordings: records telemetry (evidence: `src/Waybill/Tracking/TrackerEngine.cs`)
- Application window → Delivery database: loads history (evidence: `src/Waybill/MainForm.cs`)
- Application window → Live drive view: shows current drive
- Application window → Delivery history: shows deliveries (evidence: `src/Waybill/MainForm.cs`)
- Delivery history → Delivery database: reads deliveries
- Application window → Delivery details: opens details
- Application window → Route visualization: shows routes (evidence: `src/Waybill/MainForm.cs`)
- Route visualization → Map backdrop: draws over (evidence: `src/Waybill/RouteView.cs`)
- Map backdrop → Place names: uses place data (evidence: `src/Waybill/MapBackdrop.cs`)
- Application window → Elevation view: shows elevation (evidence: `src/Waybill/MainForm.cs`)
- Sitting summaries → Delivery database: gets drive totals (evidence: `src/Waybill/Tracking/Sessions.cs`)
- Sitting summaries → Session recordings: reads recordings (evidence: `src/Waybill/Tracking/Sessions.cs`)
- Application window → Sitting summaries: shows sittings (evidence: `src/Waybill/MainForm.cs`)
- Application window → Awards and levels: shows awards (evidence: `src/Waybill/MainForm.cs`)
- Awards and levels → Delivery database: reads delivery history
- TrucksBook import → Delivery database: imports history (evidence: `src/Waybill/Storage/TrucksBookImport.cs`)
- Application window → TrucksBook import: offers import (evidence: `src/Waybill/MainForm.cs`)
- Application window → Waybill documents: exports waybill (evidence: `src/Waybill/MainForm.cs`)
- Waybill documents → Delivery database: reads delivery data
- Application window → Discord presence: updates presence (evidence: `src/Waybill/MainForm.cs`)
- Discord presence → Settings: reads configuration (evidence: `src/Waybill/Integrations/DiscordPresence.cs`)
- Application window → Game launcher: launches game (evidence: `src/Waybill/MainForm.cs`)
- Application window → Settings: loads preferences (evidence: `src/Waybill/MainForm.cs`)
- Settings → Units and currency: selects display units (evidence: `src/Waybill/Settings.cs`)
- Application window → Translations: renders translated text (evidence: `src/Waybill/MainForm.cs`)
