
“The interesting constraint wasn’t technical sophistication. It was knowing which problem not to solve.”
A passport application that works where there is no internet
Passport and ID card issuance for a national identity authority: agents go out to people, the most sensitive data a government holds is captured on a phone in a village, and it waits on the device until the network returns.
The problem
The constraint
What we did
Upload straight to S3, not through the backend
When every byte passes through the instance you need a bigger machine, you pay for transfer that never had to exist, and uploads fall over as soon as several arrive at once. In a system where every application is a photo upload that is not a detail, it is the main path. A pre-signed URL removes the bottleneck and the cost at the same time.
S3 + pre-signed URLsOffline-first, with a known boundary
The application, photos and biometrics are written to secure storage on a company phone and sent when a connection appears. We did not build a full synchronization system, because the scenario it would serve does not happen: the agent returns the phone to the office at the end of the day, so the offline window is one working day.
Secure storage · remote wipeOne flow for both documents
A passport and an ID card go through the same procedure at a different price. Two separate flows for what is essentially one procedure means double the maintenance and double the places to get it wrong — in a system where getting it wrong means somebody does not get a passport.
One flow, two pricesFees through the state gateway
The fee is paid through the national payment gateway that covers government payments and the single treasury account, with PayPal for applicants outside the country — the system also serves people in the process of acquiring citizenship. In the public sector the payment partner is dictated by regulation, not by the quality of its documentation.
State gateway · PayPalRegistry access behind keys and addresses
Communication with the national registry is secured with API keys, digest authentication and tokens, and the registry only accepts calls from verified IP addresses — a stolen key on its own does not open the door.
IP allowlist · digest
The agent collects the application, a photo of the face and a photo of the document — or an application with no prior document at all. All of it goes into secure storage on a company phone that can be wiped remotely if it is lost. Had these been agents’ personal phones, this design would not have been acceptable.
The result
A bounded window is not a general synchronization solution. It is one fact about the working day, used deliberately.
What we’d do differently
We never tested what happens on the day the assumption breaks — an agent who doesn’t return, a phone that stays out for a week. The bounded window was the right design, but a design that depends on a routine should be tested against the routine failing.
- React
- Next.js
- Expo
- PostgreSQL
- AWS
- S3
- State payment gateway
- PayPal
- Offline-first
- Biometrics