Choose "Save as PDF" in your browser's print dialog.
Fleet dispatch and depot operations platform for a 19-depot logistics network
Proposed replacement of per-depot dispatch spreadsheets, WhatsApp-coordinated driver assignments, and disconnected route tracking with a centralized event-driven fleet operations platform architected to support expansion to 50 depots without compounding dispatch failures or load visibility gaps.
ONGOING · 6 ENGINEERS · FLEET OPERATIONS PLATFORM
§01 / THE BRIEF
A growing logistics operator running 19 depots was managing driver assignments, route planning, load allocation, and delivery confirmation through a combination of depot-level spreadsheets, phone calls, and WhatsApp group coordination. Each depot had independently developed its own dispatch conventions, producing conflicting load assignments, untracked vehicle utilization, and a delivery performance picture that central operations could only reconstruct manually from driver check-in messages. The incumbent vendor TMS charged per-vehicle licensing that would make the planned 50-depot expansion economically indefensible. Central operations had no live view of fleet position, load status, or depot throughput. Driver hours compliance was tracked on paper. Failed deliveries were discovered at day-end rather than in time to reroute. The proposed platform centralizes dispatch orchestration and load lifecycle management, enforces driver hours governance structurally, and provides central operations with a continuously updated fleet and depot state — while preserving the depot-level dispatch autonomy that time-pressure operations genuinely require.
§02 / SYSTEM ARCHITECTURE
Event-driven, real-time fleet dispatch platform spanning depot service nodes, a central Kafka event bus, operational and analytical storage layers, GPS telemetry ingestion, and multi-surface client interfaces.

§03 / THE WORK
- 01
Depot Workflow Mapping and Dispatch Pattern Analysis
Spent four weeks embedded across six depots observing actual dispatch workflows before committing to any data model. Key findings: load assignment in practice was a continuous negotiation between depot coordinators and drivers rather than a one-shot scheduling event; 'confirmed' assignments in the spreadsheet were routinely renegotiated within hours; and the most operationally significant state — a load in transit with no confirmed ETA — had no representation in any existing system. The dispatch data model was built around these observed patterns, treating assignment as a mutable lifecycle rather than a static record.
- 02
Centralized Load Lifecycle and Dispatch Orchestration
Designed a dispatch service that maintains authoritative load state across all depots, with optimistic locking on load-driver assignment pairs to prevent concurrent assignment conflicts that the existing per-depot spreadsheet model could not detect. Load creation, assignment, in-transit transitions, delivery confirmation, and failure recording are modelled as state machine transitions with mandatory actor attribution. No load state can regress — a delivered load cannot be reassigned, and a cancelled load cannot be confirmed — without an explicit exception workflow that writes an audit record.
- 03
GPS Telemetry Ingestion and Live Fleet Position
The existing telematics vendor exposed a webhook stream that had never been integrated into any operational system. A telemetry ingestion service was designed to consume this stream, normalize position and ignition events into the platform's canonical event schema, and publish them to the central event broker. A route adherence service consumes position events and compares vehicle trajectory against the assigned route, emitting deviation alerts when a vehicle departs from its expected corridor beyond a configurable threshold. ETAs are recalculated continuously from live position data and propagated to the load record and to recipient notification workflows.
- 04
Driver Hours Compliance Engine
Driver hours are tracked as an event stream derived from dispatch events and telematics data rather than from self-reported timesheets. Shift start is recorded when a driver is assigned their first load of a day; driving time accumulates from telematics movement events; mandatory rest periods are enforced by the assignment workflow — the dispatch service rejects load assignments to drivers whose projected hours would breach the regulatory limit, routing the assignment to a compliant available driver. The hours ledger is queryable for any driver over any period, producing a compliance record reconstructible from event data rather than paper archives.
- 05
Failed Delivery and Rerouting Workflow
Failed deliveries in the existing system were discovered at day-end when drivers submitted their end-of-day report. The proposed platform detects delivery failures in near-real time: if a driver marks a delivery as failed, a rerouting workflow is immediately triggered that evaluates available drivers within range, checks their remaining compliant hours, and surfaces rerouting options to the depot coordinator within minutes of failure recording. Failed delivery events are linked to the originating load record, customer record, and driver record, enabling failure pattern analysis by route, customer, driver, and depot.
- 06
Centralized Reporting and Operational Analytics
The reporting layer is fed by projection workers consuming the full event stream into a ClickHouse analytical store, maintaining denormalized models for depot throughput, driver utilization, on-time delivery rate, load completion rate, failed delivery frequency, and vehicle idle time. These models are updated continuously rather than rebuilt nightly, giving central operations a reporting view that reflects the current operational state rather than yesterday's. Background reconciliation workers compare planned load schedules against completion records, flagging loads that are overdue for status updates and surfacing them in the operations dashboard before they become day-end surprises.
§04 / RESULTS
Figures marked "target" are engagement objectives. Results marked "enforced" reflect architectural constraints rather than behavioural targets.
- CONCURRENT LOAD ASSIGNMENT CONFLICTS
- →0 (lock-enforced)
- FLEET POSITION VISIBILITY
- None→live (<30s lag, target)
- FAILED DELIVERY DETECTION LATENCY
- Day-end→<5 minutes (target)
- DRIVER HOURS COMPLIANCE PAPER TRAIL
- Weekly paper→continuous event log
- CENTRAL OPERATIONS REPORTING LAG
- 2–3 hours→<60 seconds (target)
- TMS LICENSING COST AT 50-DEPOT SCALE
- Eliminated (vendor dependency removed)
§05 / CONTEXT
- 01
Fragmented Depot Dispatch Baseline
Each of the 19 depots operated its dispatch function independently, with dispatch coordinators maintaining their own spreadsheet-based load boards updated manually as drivers checked in by phone or message. No two depots used the same column structure, status vocabulary, or update cadence. When central operations needed a network-wide load status view, they assembled it by calling each depot individually — a process that took two to three hours and was already outdated by the time it was complete.
- 02
Driver Assignment Conflicts and Load Duplication
Because depots operated without a shared assignment ledger, cross-depot runs — where a vehicle originating at Depot A was reassigned mid-route to collect a load from Depot B — were coordinated entirely informally. The same load was occasionally assigned to two drivers simultaneously, discovered only when both arrived at the collection point. Cancellations made at one depot did not propagate to connecting depots, leaving drivers dispatched to collect loads that no longer existed.
- 03
Zero Real-Time Fleet Visibility
Vehicle GPS units were installed across the fleet, but the telematics data was siloed within a separate vendor dashboard that no depot coordinator had been trained to use and that exposed no integration API. Central operations had no programmatic access to vehicle position, no live ETA calculations, and no automated detection of vehicles deviating from assigned routes. Delivery failures were communicated by the driver — when they chose to communicate them — rather than detected by the system.
- 04
Driver Hours and Compliance Paper Trail
Driver hours compliance under transport regulations was tracked through paper timesheets submitted weekly. There was no real-time visibility into a driver's accumulated hours before assigning them to a new run. Dispatchers relied on verbal confirmation from drivers — a system that created unverifiable compliance exposure and made post-incident reconstruction of hours records dependent on incomplete paper archives.
- 05
TMS Licensing Cost Trajectory
The incumbent transport management system charged per-vehicle per-month licensing fees. At 19 depots and the current fleet size the cost was manageable. The approved expansion plan to 50 depots required a fleet size increase that made the vendor licensing trajectory economically indefensible before the expansion was halfway complete. Replacing the TMS was a prerequisite for the expansion program, not an option to be evaluated alongside it.
§06 / ARCHITECTURAL DECISIONS
- 01
Why Kafka for the Event Bus
The dispatch domain produces a continuous high-frequency event stream from three independent sources — user-initiated load state transitions, GPS telemetry position events, and driver mobile app interactions — that must be processed by independent consumers at different throughput and latency requirements. Kafka's partitioned log allows telemetry ingestion, dispatch state processing, compliance monitoring, and analytics projection to consume from the same event stream independently without coupling their processing rates. The durable log also enables the platform to replay the full telemetry and dispatch history for any time window — necessary for incident investigation, compliance audit, and bootstrapping new analytical workloads.
- 02
Why Event Sourcing for Load Lifecycle
Load state in logistics is inherently contentious — multiple actors (depot coordinators, drivers, receiving parties, central operations) may attempt to update the same load record concurrently under time pressure. A mutable record with last-write-wins semantics would silently discard updates under contention. An event-sourced load ledger preserves every state transition attempt, applies them in causal order, and makes conflicts visible rather than hiding them. It also provides the audit depth that regulatory and customer dispute contexts require — the ability to reconstruct exactly who changed a load's status, when, from what device, and what the state was at every prior point.
- 03
Why Depot-Local Service Nodes
Depot operations are time-critical and cannot tolerate WAN latency on the dispatch path. A coordinator assigning a driver to a load, or a driver confirming a pickup, cannot wait for a round-trip to a central data centre under operational time pressure. Each depot runs a local service node that handles read and write operations against a local store, with asynchronous synchronization to the central broker. This architecture means that depot operations continue at full performance regardless of WAN connectivity quality, and that central operations always has a converging — if slightly lagged — view of depot state.
- 04
Why Continuous Reconciliation Rather Than Daily Batch
Daily batch reconciliation in logistics operations is operationally useless — a load that has been in an incorrect state for 24 hours has already caused a cascade of downstream scheduling decisions based on wrong data. Continuous reconciliation workers that run against the event stream detect state inconsistencies within minutes of their occurrence, when the depot coordinator who assigned the conflicting load is still at their desk and the driver is still at the collection point. This changes exception resolution from next-day archaeology to same-session correction.
- 05
Why Configurable State Machines for Driver Hours
Transport hours regulations vary by jurisdiction, vehicle class, and load type — a long-haul HGV driver operates under different limits than a last-mile van driver in the same fleet. Hardcoding hours rules would require engineering changes every time a new vehicle class was added or a regulatory limit changed. Configurable state machine rules allow the compliance team to define hours limits, mandatory rest durations, and exemption categories as versioned configuration without a deployment cycle. Historical compliance records can always be validated against the rule version active at the time of the relevant shift.
§07 / MILESTONES
Phase 1 — Discovery & Architecture
Weeks 1–7- ·Embedded four-week dispatch workflow observation across six depots
- ·Mapped actual vs. documented load assignment and driver coordination patterns
- ·Defined event schema for load lifecycle, telemetry, and driver hours domains
- ·Assessed telematics vendor webhook integration surface and data quality
- ·Finalised technology selection, depot node architecture, and data model
Phase 2 — Core Platform Build
Months 2–8- ·Centralized load lifecycle service with state machine and optimistic locking
- ·Depot local service layer with offline queue and idempotent sync
- ·GPS telemetry ingestion service and route adherence detection
- ·Driver hours compliance engine with assignment rejection enforcement
- ·Central Kafka broker cluster with isolated consumer groups per workload
- ·Core PostgreSQL schema and TypeScript service layer
Phase 3 — Reporting & Operations Visibility
Months 8–13- ·ClickHouse analytical store and projection worker pipeline
- ·Background reconciliation workers for overdue load detection
- ·Central operations dashboard (Next.js) — live fleet map, depot throughput, compliance alerts
- ·Depot coordinator UI and driver mobile app (React Native)
- ·Failed delivery rerouting workflow and recipient notification pipeline
Phase 4 — Pilot and Migration
Months 13–16- ·Pilot deployment across four depots with parallel-run validation period
- ·Depot activation tooling and legacy TMS data migration workflows
- ·Driver mobile app rollout and onboarding program
- ·Cut-over validation and rollback procedure documentation
- ·Load and performance profiling at pilot throughput levels
Phase 5 — Full Rollout & Optimisation
Months 16–20- ·Staged rollout across remaining 15 depots
- ·Legacy TMS decommissioning for migrated depots
- ·Compliance engine threshold calibration across vehicle class configurations
- ·New depot activation workflow validation to target window
- ·Observability tuning, alerting calibration, and expansion readiness review
§08 / IMPACT
- 01
Concurrent Load Assignment Conflicts Eliminated
Before the platform, cross-depot load assignment conflicts were discovered operationally — two drivers arriving at the same collection point, or a driver arriving for a load that had been cancelled at another depot. Optimistic locking on load-driver assignment pairs at the service layer makes concurrent conflicting assignments architecturally impossible. The conflict class is removed rather than monitored.
- 02
Fleet Position Visible in Near Real-Time
Central operations previously had no programmatic access to vehicle position. The telemetry ingestion pipeline targets a position update lag of under 30 seconds from GPS event to live fleet map. This enables in-progress delivery monitoring, deviation detection, and ETA recalculation that was previously impossible — changing the operations center's role from reactive incident responder to proactive dispatch coordinator.
- 03
Failed Delivery Detection Compressed from Hours to Minutes
Failed deliveries were previously discovered at day-end when drivers submitted their reports. The event-driven rerouting workflow targets detection and rerouting option surfacing within five minutes of a driver recording a delivery failure — while vehicles are still in the field, compliant hours remain available, and the operational window for same-day resolution is still open.
- 04
Driver Hours Compliance Converted from Paper to Event Log
Weekly paper timesheet submission provided no pre-assignment compliance visibility and no reliable reconstruction capability after incidents. The continuous hours event log, derived from dispatch events and telematics data, provides real-time hours remaining per driver before every assignment decision and produces a tamper-evident compliance record reconstructible from event history for any audit window.
- 05
TMS Licensing Eliminated at Scale
The per-vehicle licensing structure of the incumbent TMS made the cost trajectory to 50 depots and the required fleet expansion economically indefensible. The purpose-built platform eliminates per-vehicle licensing entirely. Infrastructure cost scales with event throughput and storage — a sub-linear relationship to fleet size — creating a compounding cost advantage with every additional vehicle and depot enrolled.
§09 / ARCHITECTURE DETAIL
- 01
Depot Service Layer (Local Node)
Each depot runs an isolated local service node on depot-premises hardware maintaining a depot-scoped PostgreSQL instance for operational dispatch state, a Redis cache for hot-path driver availability lookups, and a persistent Kafka producer queue for event exchange with the central broker. The local service exposes the full dispatch API surface, allowing coordinators to assign loads, update statuses, and query fleet state without dependency on WAN availability. Events produced locally are written to the outbound queue and drained to the central broker asynchronously with idempotent delivery guarantees.
- 02
Telemetry Ingestion Service
A dedicated ingestion service consumes the telematics vendor's webhook stream, normalizes position, ignition, and odometer events into the platform's canonical telemetry event schema, and publishes them to the Kafka telemetry topic. The ingestion service handles vendor-side delivery failures through a persistent inbound queue with retry logic and dead-letter routing for events that cannot be normalized after the maximum retry threshold. Telemetry events carry the canonical vehicle identifier mapped from the vendor's internal identifier during enrollment.
- 03
Central Event Broker — Apache Kafka
The Kafka cluster operates as the authoritative event backbone for all domains: load lifecycle transitions, telemetry position events, driver hours accumulation events, and notification delivery confirmations. Topics are partitioned by depot identifier and vehicle identifier respectively, ensuring that all events for a given depot or vehicle are processed in order by downstream consumers. Consumer groups are isolated per workload type — dispatch processors, compliance monitors, projection workers, and notification services consume independently.
- 04
Core Dispatch Services — TypeScript + PostgreSQL
The central service layer handles cross-depot load orchestration, driver hours rule enforcement, failed delivery rerouting, and vendor notification dispatch. It operates as the authority for network-wide state that depot local nodes cannot resolve independently — cross-depot assignment conflicts, network-wide driver availability queries, and compliance rule evaluation against the full hours history. The service layer is stateless and horizontally scalable, with all persistent state held in PostgreSQL with row-level depot scoping.
- 05
Analytical Store — Python Workers + ClickHouse
Python projection workers consume the full event stream from all domains and maintain a ClickHouse analytical store optimized for aggregation queries across depot, vehicle, driver, route, and time dimensions. Workers are idempotent and restartable — the analytical store can be rebuilt from scratch by replaying the full event history. Background reconciliation workers consume from ClickHouse to detect overdue loads, compliance threshold approaches, and delivery completion gaps, publishing alert events back to the broker for dashboard surfacing.
- 06
Client Surfaces — Next.js + React Native
Central operations use a Next.js dashboard for live fleet map display, depot throughput monitoring, compliance alert review, and network-wide load status. Depot coordinators use a depot-scoped view of the same application for local dispatch management. Drivers use a React Native mobile application for load acceptance, pickup confirmation, delivery recording, and failed delivery reporting. The mobile application operates against the depot local service layer, functioning normally during WAN disruptions with sync occurring on reconnection.
§10/ SECURITY & GOVERNANCE
Role-Based Dispatch Authorization
Every dispatch action — load creation, driver assignment, status transition, rerouting decision — is gated by role-bound authorization at the service layer. Depot coordinators can only assign drivers and modify loads within their depot scope. Regional managers have cross-depot read access and exception override capability within their region. Central operations holds network-wide visibility and configuration authority. Role assignments are managed centrally and propagated to depot nodes on next synchronization cycle.
Immutable Load and Hours Audit Log
Load lifecycle events and driver hours accumulation events are append-only by design. No operation modifies or deletes historical event records. Every state transition carries the authenticated actor identity, device identifier, depot context, and millisecond timestamp. The event log is the compliance record — there is no separate audit system, because the event stream is the audit stream.
Signed Event Synchronization
Events produced by depot local nodes are signed with depot-scoped cryptographic keys before transmission to the central broker. The broker validates signatures before accepting events into the authoritative stream, preventing event injection from unauthorized sources. Depot node credentials are enrolled during activation and can be revoked centrally. All inter-service and depot-to-central traffic is encrypted in transit.
Structural Compliance Enforcement
Driver hours limits are enforced at the assignment API layer, not the UI layer. The dispatch service evaluates projected hours against the applicable rule configuration before completing an assignment and rejects non-compliant assignments with a structured error that surfaces the hours constraint to the coordinator. There is no override path that bypasses the compliance check silently — exceptions are recorded as explicit override events with mandatory justification attribution.
§11 / SCALE READINESS
DESIGNED FOR
75+ Branches Without Core Redesign
The platform was designed to support controlled expansion to 50+ depots without requiring core workflow redesign or schema migration. New depots are enrolled as isolated local service nodes that join the existing event topology through a structured activation workflow — no manual Kafka topic provisioning, no schema changes, no consumer group reconfiguration. The central Kafka backbone scales by partition; the ClickHouse analytical store scales independently of the operational PostgreSQL layer; and the stateless central service tier scales by replica count. Vehicle enrollment is additive — new vehicles are registered with a canonical identifier, assigned to a depot, and immediately begin producing telemetry events that flow into the existing processing pipeline. No component of the architecture contains a depot-count or vehicle-count sensitive bottleneck at any layer.
§12 / LESSONS
- 01
Dispatch Workflows Resist Standardization Until the Pain Is Made Visible
Depot coordinators had independently developed dispatch conventions over years and were resistant to standardization they perceived as imposed from outside their operational reality. The turning point in the discovery phase was showing each depot coordinator the load conflict and missed delivery data their own informal system was producing — data they hadn't been able to see before because no system was capturing it. Standardization framed as solving a visible operational problem they recognized was adopted; standardization framed as policy compliance was not.
- 02
Telemetry Data Is Only Valuable If It Is Integrated
GPS hardware was already installed across the fleet. The telematics data had existed for years in an unused vendor dashboard. The operational value — live fleet position, route deviation detection, ETA recalculation, hours accumulation — was not in the hardware or the data, but in the integration of that data into the dispatch workflow where coordinators could act on it. Instrumentation without integration produces dashboards that nobody uses.
- 03
Compliance Enforcement Must Happen Before Assignment, Not After
Hours compliance monitoring that detects violations after they occur produces a compliance record but does not prevent the violation. Embedding the compliance check into the assignment decision — rejecting a non-compliant assignment at the moment it is attempted — prevents the violation rather than documenting it. This requires the compliance rule evaluation to be fast enough for the dispatch path, which drove the decision to cache driver hours state in Redis rather than querying the full event log on each assignment.
- 04
Day-End Discovery Is Not a Reporting Problem, It Is an Architecture Problem
The organization initially framed failed delivery visibility as a reporting gap — they needed better end-of-day reports. The actual problem was architectural: failed deliveries were only discoverable at the point when drivers chose to report them, which was typically at shift end. Moving delivery status into an event-driven lifecycle where the system detects non-progression rather than waiting for driver-initiated reporting changed the discovery model from passive reception to active monitoring — a different architecture, not a better report.
§13/ TEAM & STACK
TEAM
| ROLE | COUNT |
|---|---|
| Platform Architect | ×1 |
| Backend Engineers | ×3 |
| Frontend Engineer | ×1 |
| Implementation Lead | ×1 |
| Duration | 20 MONTHS |
STACK
- TYPESCRIPT
- POSTGRESQL
- APACHE KAFKA
- REDIS
- NEXT.JS
- REACT NATIVE
- PYTHON
- CLICKHOUSE
Have a brief that looks like this?
RETAIL OPERATIONS
ERP Consolidation and Operations Platform for a 28-Branch Retail Chain
Replaced disconnected branch spreadsheets, legacy POS workflows, and fragmented approval chains with a centralized event-driven operations platform architected to support controlled expansion to 75 branches.
FIELD SERVICE & FACILITIES MANAGEMENT
Work order and field service operations platform for a 23-region facilities management network
Proposed replacement of region-level work order spreadsheets, phone-coordinated technician dispatch, and paper-based SLA tracking with a centralized event-driven field service platform architected to support expansion to 60 regions without compounding SLA breach exposure or asset maintenance visibility gaps.