Robert Dominguez
← All notes
React Native

Offline-first in React Native: an app with no backend

Keeping data on the phone saves both running costs and GDPR trouble. What is recommended for offline-first, and where I got it wrong myself.

I built Protokolka, an app for flat handover reports, without a server. No sign-up, no synchronisation, no personal data processed on my side. So far I consider it the best decision of the project — and at the same time the source of problems I had not read about anywhere beforehand.

The reason was originally purely practical. A handover report contains photos of the flat, the names of both parties and their signatures. The moment that travels to my server, I become a processor of personal data with everything that entails.

  • Zero running costs — the app pays for itself.
  • It works in a basement with no signal, which is exactly where handovers happen.
  • No account means two fewer screens in onboarding.

Where the data actually sits

Metadata in a local database, photos in the file system, generated PDFs in a shared folder. This is where I hit something no general piece of advice warned me about firmly enough: do not store absolute paths. On iOS the app container changes after an update and stored references to photos fall apart.

Store relative paths and assemble absolute ones only when reading. I learned this after the first report of "my photos have disappeared".

Backups are a feature, not a settings detail

With no server, losing the phone means losing the data. The recommendation — and it makes sense to me — is to have export-everything-to-one-file visible in the main part of the app, not buried three levels deep in settings. The user has to know that backing up is on them.

When to add a backend

The line I hold to: the moment data needs to be shared by more people or more devices. Until then a server is mostly cost and risk. Whether I will cross that line with this app one day, I do not know yet.

This is not a prescription for every app — for plenty of products a server is a necessity from day one. Take it as a description of one scenario where it was worth putting off as long as possible.

Robert Dominguez
Robert Dominguez

Senior frontend and React Native developer. Mobile banking by day, my own apps in the store by night.

Get in touch →

Got a project my hands would be useful on?