Dairy delivery
A delivery rider's whole day in one Android app: collect stock, deliver door to door, take payment, close the day.
- Role
- Set up the module, led the October release
- Where
- Previous employer
- Year
- 2026
- Status
- Internal
- Flutter
- Riverpod
- Frappe
- Python
The context
The business delivers milk, yogurt and butter to homes in Lahore every morning. Riders, called Sales Partners, run their day in this app, in English and Urdu. Customers can also order through a WhatsApp chatbot. Both talk to the same Frappe and ERPNext backend, and a confirmed delivery creates the invoice and payment entry for finance.
I set up the backend module in July 2026. A teammate built the first version of the app. In October I took over both and led the release that made a full rider day work end to end.
The problem and my approach
A delivery is only one part of a rider’s day. Stock has to leave the hub, prepaid balances have to be honoured at the door, skipped orders need a new date, and finance needs to reconcile the money afterwards.
I set up the backend module in July. A teammate built the first app. In October I took over the app and backend together, connecting the rider’s next action to the corresponding stock, order and accounting records.
How it works, from start to finish
Build tomorrow’s orders
A customer can have a different basket for each weekday. The subscription screen shows that basket and its weekly total.
Underneath
A nightly job turns active subscriptions and rescheduled deliveries into the next day’s orders.

A subscription basket that changes by weekday, with a weekly total Collect stock and start the shift
At the hub, the rider collects the stock planned for the route. The home screen makes the next action visible.
Underneath
Stock pickup starts the GPS tracking window used later to calculate payable kilometres.

Collecting the day's planned stock at the hub Work through the route
The map puts each household alongside what it ordered, so the rider can move from stop to stop.
Underneath
Orders from the app and WhatsApp chatbot use the same Frappe and ERPNext backend.

Today's route: stops on a map with what each customer ordered Confirm a delivery
The stop applies the customer’s prepaid balance. A prepaid delivery requires a proof photo.
Underneath
Confirming the delivery creates the invoice and payment entry that finance uses.

A stop with the prepaid balance applied, so nothing is left to collect Handle a missed stop
The rider supplies a reason, a photo and another delivery date.
Underneath
The backend books a new order. Skipped stops are excluded from the day’s delivered total.

Skipping a stop: reason, proof photo and a new delivery date Return and reconcile
The rider hands over remaining stock and cash and closes the day.
Underneath
The backend filters raw GPS fixes and checks the track before locking the payable distance. Operations can review kilometres and tracking health.

Home screen after the day is closed and handed over
What I did
- A home screen with one button that tells the rider what's next, from collecting stock at the hub to reconciling stock and cash at the end.
- Prepaid balances applied at the door, with a delivery photo required for prepaid orders.
- Subscriptions with a different basket for each weekday, and a nightly job that books tomorrow's orders.
- Skips that need a reason and a proof photo, and reschedule the delivery automatically.
- Spot sales that don't end the day, and a day close-out that records the stock and cash handover.
- Shift GPS tracking, plus a desk dashboard where operations review each rider's kilometres and tracking health.
- Deployed the backend to Frappe Cloud.
Engineering decisions
Paying riders per kilometre from phone GPS
The app uploads raw GPS points between stock pickup and return. The phone never sends a distance. A pure-Python engine drops fixes that are inaccurate, come from mock-location apps or move impossibly fast. After several jumps in a row it moves its anchor instead of rejecting points forever. It fills short gaps and checks the track against the stop path before it locks the payable figure. Thresholds live in settings, and the engine has unit tests.
Skips that don't lose orders
A skipped stop doesn't disappear. The rider picks a reason, takes a proof photo and chooses a day, and a new order is booked. Skipped stops don't count against the day's deliveries, so close-out still adds up.
Subscriptions that change by the day
Customers can take the same basket every day or a different one per weekday. The app builds each day's basket with a running weekly total, and the nightly job turns active subscriptions and rescheduled stops into tomorrow's route.
Release and verification
I led the October 2026 release across Flutter and Frappe and deployed the backend to Frappe Cloud. The GPS engine has unit tests. The app is internal software, and the screens here use seeded data.
Screens show seeded demo data.