Keeping Customer Addresses Off My Server: Building a Local-First Delivery App
I build HAKOBUN, a multi-stop route planner for gig and courier delivery drivers on Android and iOS. Drivers use it to scan shipping labels, sort their stops, and navigate through the day.
That means the app's core data is a list of strangers' names and home addresses. Early on I made one decision that shaped most of the architecture: that list should never live on my server.
This post walks through what "local-first" ended up meaning in practice, and what it cost.
The threat model is boring, and that is the point
I am not defending against nation-state attackers. The risks I care about are mundane:
- A backend I run gets misconfigured, and a database of home addresses leaks.
- Analytics or logging quietly collects more than it should.
- A driver loses their phone.
The simplest way to remove the first two risks is to not have the data in the first place. The third one is handled by encryption at rest.
Rule 1: Customer data stays on the device, encrypted
Package lists, recipient addresses, delivery notes and the driver's profile are stored in platform-backed encrypted storage:
- iOS: Keychain
- Android: EncryptedSharedPreferences
There is no cloud sync for this data. The app works from local state; the network is used for things that genuinely need it.
Rule 2: Images never leave the phone
The fastest way to load 100+ packages in the morning is to photograph the labels. That is also the easiest way to accidentally build a server full of photos of other people's addresses.
HAKOBUN runs text recognition on the device — Apple's Vision framework on iOS and ML Kit on Android. Drivers keep snapping labels in a continuous capture mode (up to 40 packages per batch), and the recognized text is queued as draft stops. Incomplete addresses (for example, a missing house or unit number) and duplicate tracking numbers are flagged so the driver can fix them while looking at the label photo — which is still only on the phone.
Rule 3: Be explicit about what does go over the network
"Local-first" is not "offline." A route planner needs maps. The external requests are limited to:
- Map and route lookups
- Postal code lookups
- Data the driver chooses to share in an optional QR group
I think it is important to write this list down publicly, because "we don't store your data" claims are only useful if they are specific.
Rule 4: Location learning is opt-in and expires
The most useful feature in the app is also the most sensitive one. HAKOBUN can learn, for each address:
- where the driver usually parks (shown as 🅿),
- which entrance of a large building they use (🚪),
- and when recipients tend to be home, so stops marked "Often absent" move later in the route.
All of this requires location history, so it is off by default. When a driver turns it on:
- Positions are recorded only while the app is on screen. GPS stops when the app goes to the background.
- Records stay on the device.
- Driving records are deleted after 14 days; stop records after 180 days.
Short retention windows are a design tool, not just a policy line. They force the feature to work from recent behavior, and they cap the damage if something goes wrong.
Sharing without a central database
Drivers at the same station often serve the same apartment complexes, so sharing a parking spot or entrance is genuinely valuable. HAKOBUN does this through QR groups: a driver creates a group, teammates join by scanning a QR code, and each person decides whether their 🅿 and 🚪 data is shared with the group (a separate setting, off unless enabled).
The principle: sharing is a deliberate action by the driver, scoped to a group they created or joined — not a side effect of using the app.
What it costs
Local-first has real downsides:
- No seamless multi-device sync. Switching phones uses a backup file (packages, recurring routes, learned locations, notes, settings) that the driver exports and restores.
- Lost phone, lost data — unless they backed up. The app nudges drivers to back up regularly.
- Fewer server-side insights. I cannot look at aggregate delivery data to improve the product. Feedback has to come from drivers directly.
For this kind of data, I think those are the right trade-offs.
Try it / tell me I'm wrong
HAKOBUN is available on Android and iOS in English, Portuguese (Brazil), Korean, Vietnamese, Simplified Chinese and Japanese. Every Premium feature is free for 14 days, with no credit card and no automatic charge.
- Android: https://play.google.com/store/apps/details?id=com.delivery.navigator&utm_source=devto&utm_medium=article&utm_campaign=local_first
- iOS: https://apps.apple.com/app/id6794841921?pt=devto&ct=local_first&mt=8
- Site: https://hakobun-9cf0b.web.app/en/?utm_source=devto&utm_medium=article&utm_campaign=local_first
If you have built something local-first on mobile, I would love to hear how you handled sync and backups. Comments are open.