Tell us about your product

We use your name and email only to reply to you. Privacy Policy

Local-first: cycle data that stays on your phone

4 min read

In short

Local-first means the app writes your entries to storage on your own phone and works in full without a server, so the developer never holds a copy. There is nothing on a company server to leak, sell or hand over. In exchange, the device lock and the backup become your responsibility.

What does "local-first" mean?

Most apps are built around a server: you type, the app sends, the company stores. A local-first app reverses the order. The database is a file on your phone, and predictions are calculated on the phone. Nothing has to be sent for the app to work, so it runs in airplane mode and without an account.

The privacy consequence is plain. A company cannot share, lose or be asked for data it never received.

Why are most trackers not built this way?

A server makes several things easy for a developer: restoring an account on a new phone, studying how people use the app, showing targeted offers. Local-first gives those up or solves them differently, with exports and encrypted sync. The trade is deliberate: fewer conveniences for the company, fewer copies of your data.

How is the data protected on the phone?

On iPhone an app can place its files in the strictest storage class, which Apple calls Complete Protection. The key that opens those files is protected by a key derived from your passcode and the device’s unique ID. According to Apple’s security guide, the decrypted key is discarded shortly after the phone locks, and the data stays unreadable until you enter the passcode or use Face ID again.

This is why the passcode matters more than any setting inside an app. The protection is as strong as the lock on the phone, and no stronger.

What about backups and a second device?

Local storage raises a fair question: what happens when the phone is lost. There are two answers, and both can keep the developer out of the picture.

  • An encrypted export. The app writes a file protected by a password you choose, and you keep it where you like.
  • End-to-end encrypted sync. Entries are encrypted on the phone before upload, and only your own devices hold the key.

Apple describes the second model for iCloud. End-to-end encrypted data can be decrypted only on your trusted devices, and in Apple’s words: "No one else can access your end-to-end encrypted data — not even Apple." Health data in iCloud is end-to-end encrypted under Apple’s standard protection, and two-factor authentication is required.

What local-first does not protect against

  • Someone who knows your passcode or picks up the phone while it is not locked.
  • Notifications and widgets that show entries on the lock screen.
  • A lost device with no backup. Nobody can restore what only you held.
  • Everything outside the app: messages, searches, location history.

Local-first narrows the risk to one place that you control. It does not remove the need to lock that place.

Three things to set up on the first day

  • A passcode on the phone, longer than four digits if you can.
  • One encrypted export, saved somewhere other than the phone.
  • The export password, kept apart from the file.

How JustPeriod. applies it

JustPeriod. stores entries only on the iPhone by default, under iOS file protection that keeps them encrypted whenever the device is locked. Its data folder is excluded from iCloud device backups. Optional sync encrypts entries on the device with AES-GCM before upload; the server sees a record identifier, a type label, an encrypted blob, a timestamp and a deletion flag.

The limit is stated in plain terms: if you lose your recovery key and your device, your synced data cannot be recovered.

Questions and answers

Does a local-first app work without internet?
Yes. Entries are stored and predictions are calculated on the phone, so nothing has to be sent for the app to work.
Is the data on my phone encrypted?
On an iPhone with a passcode, yes. Files in Apple’s Complete Protection class cannot be read while the device is locked.
What happens if I lose the phone?
Without an export or encrypted sync, the entries are gone. With either one you restore them yourself; the developer cannot do it for you.

Sources

  1. Apple Platform Security: Data Protection classes
  2. Apple Support: iCloud data security overview
All articles