DHL Courier App: loading, route and delivery on one handheld scanner

The app parcel couriers work in all day: loading the van, the route with arrival times, and every delivery and pickup, also without a connection. callido works with DHL to build it and leads its architecture and development.

What it is

A web app that DHL’s parcel couriers use all day on a rugged handheld scanner, and as a fallback in the browser on their own phone. It replaces paper work lists and guides the courier through the whole trip.

  1. Trip overview. The courier sees the trips assigned to them and takes one over from the depot.
  2. Loading. Every parcel is scanned into the vehicle. The app shows what is still missing and blocks wrong parcels.
  3. Route and arrival times. Stops are shown in driving order with an expected arrival time per stop, recalculated during the trip from the courier’s current position.
  4. Delivery and pickup. At each stop the courier registers the outcome: delivered at the door, at the neighbours, at an agreed place, not at home, refused or damaged. With signature, age check or delivery code where required. Pickups from senders run through the same flow.
  5. Live changes. Stops that the depot cancels or changes appear on the device within seconds, without the courier refreshing.
  6. Poor connectivity. Registrations are kept on the device and sent when the connection is back, so the courier never waits for the network.

The screen shown is from a test environment with made-up data.

Backend: Kotlin, Kafka and PostgreSQL

The backend is a set of services written in Kotlin on Spring Boot. They take the planned trips in from the depot systems, serve them to the devices and report every scan and delivery result back.

The services talk to each other through events on Apache Kafka, with Avro schemas. A change in one place streams on to the others, instead of being fetched. The transactional outbox pattern keeps the database and the event stream in step: a change and its event are stored together, so no event gets lost and none is sent for a change that did not happen.

Data lives in PostgreSQL, with PostGIS for everything that has a location, Redis next to it, and Flyway for the migrations. Errors are handled functionally with Arrow: a failure is a value the code has to deal with, not an exception that surfaces somewhere else. Features are built so that a failure in one service does not stop the courier.

Frontend: React, live updates and offline-first

The app is written in TypeScript and React. It runs in a native shell on the scanner device and in a normal mobile browser, and its screens are built from a design system of shared components.

Live updates arrive as server-sent events: the server pushes a changed or cancelled stop to the device, where the app used to ask for it again and again. That is the move from polling to push.

The app is offline-first. With React Query, a registration shows on screen at once (an optimistic update), goes into an offline queue on the device and is sent when there is a connection. How fast the app reacts is measured where the courier notices it: on the scanner.

Scale

Order of magnitude, rounded.

more than 1 millionparcel scans on a working day
close to 1,000courier trips started on a busy day
tens of thousandsof delivery and pickup registrations every week
tens of thousandsof route and arrival-time calculations every week
24/7operation with on-call support

Our role

callido works with DHL to build this product, and leads the architecture and development of the app. As a company we contribute in crucial and extensive ways: from backend and frontend to platform and operations.

A day with the app

The morning load. Sanne scans sixty parcels into her van at the depot. One of them belongs to another trip. The app stops the scan with a sound and a clear message. The mistake is caught at the depot, not at a customer’s door.

A stop is cancelled on the road. A sender withdraws a pickup while Daan is driving. Within seconds the stop disappears from his list. The arrival times of the remaining stops are recalculated, and he does not have to touch the screen.

Nobody home. Nobody answers the door. Sanne offers the parcel to the neighbours and records who accepted it. The receiver gets the outcome right away.

No signal in the car park. Daan completes three deliveries in an underground car park, without any signal. The app keeps working and keeps the registrations on the device. Back on the street, it sends everything by itself.

Own phone as a fallback. Mila has no scanner today and logs in on her own phone. The app asks permission to use the phone’s location for the arrival times. When she says no, it keeps working.

What it handles

  • Parcels and pallets, deliveries and pickups, in one trip.
  • Delivery options such as neighbour delivery, agreed safe place, signature, age check and delivery code.
  • A dedicated scanner device with a hardware barcode scanner, and a normal mobile browser.
  • Dutch and English interface.

Platform and operations

  • Platform: Kubernetes on Azure, Helm, Terraform, Azure Pipelines and GitHub, Keycloak for login.
  • Quality and operations: Integration tests against real infrastructure, end-to-end tests with Cypress, load tests, Datadog for monitoring, dashboards and on-call alerting.

Related Projects