Every mobile app has to decide what lives on the phone, what lives on a server, and what bridges the two. Runable handles all three layers for you you describe the data and how the user should experience it, and the agent picks the right storage in each place.Documentation Index
Fetch the complete documentation index at: https://docs.runable.com/llms.txt
Use this file to discover all available pages before exploring further.
How data flows
What lives where
On the device
Anything the user expects to see instantly the current screen’s content, recent activity, preferences, drafts, cached lists. The app reads from here first, then refreshes from the server in the background.
On the server
The source of truth across devices the user’s account, history, shared content, anything that needs to survive an uninstall. The phone pulls fresh copies as needed.
Sensitive on the device
Sign-in tokens, biometric flags, payment receipts stored in the device’s secure enclave (Face ID / Touch ID hardware). Untouchable by other apps.
Files and media
Photos, documents, exports uploaded to cloud storage and referenced by ID. The phone keeps a cache for fast display. See Mobile App File Storage.
Three patterns the agent uses
- Server-backed
- On-device only
- Offline-first sync
The default for apps with accounts. The server is the source of truth; the phone keeps a fresh cache.
- Reads: instant from the cache, then refreshed from the server in the background.
- Writes: sent to the server. The UI updates immediately (optimistic), and rolls back if the server rejects.
- Offline: the cache keeps the app readable. Writes queue locally and replay when the network comes back.
Add data to your app
Describe the data and how the user touches it
Notes app. Each note has a title, body, color tag (red / yellow / green), pinned flag, and a created-at timestamp. List view sorted by pinned first, then most recent. Detail view supports edit-in-place. Trash bin keeps deleted notes for 30 days. Sync across the user’s devices.The agent builds the schemas, the screens, the create/edit/delete flows, and the sync rules from one prompt.
Pick what is sensitive
Anything that should never leak to other apps or be exfiltrated from the phone goes in the secure enclave. The agent defaults to:
- Always secure: sign-in tokens, biometric flags, payment receipts, API keys.
- Never secure: cached content, preferences, drafts.
Test offline behavior
With your phone preview running, toggle Wi-Fi and cellular off. Walk through the app. The agent’s default offline behavior:
- Reads continue to work for anything you have seen before.
- Writes save locally and show a tiny “Will sync when online” indicator.
- The network indicator in the UI flips to offline mode.
Search across data
Ask: add full-text search across all notes with results highlighted. The agent picks the right approach for your data size:- Small data sets (under 10,000 items): the search runs entirely on the device no network, instant results.
- Larger data sets: the agent indexes the data on the server and pulls a results list, but still highlights matches client-side for instant feedback.
Conflict resolution
For offline-first apps, two devices can change the same data while neither is online. The agent supports three rules:| Rule | What happens | Use when |
|---|---|---|
| Last-write-wins | Whichever change is most recent overwrites the other. | Single user, multiple devices. Most common. |
| Merge | Non-conflicting fields are combined automatically; truly conflicting fields prompt the user. | Collaborative content, shared lists. |
| Manual prompt | The user sees both versions side by side and picks one. | High-stakes content where silently losing data is unacceptable. |
Export and delete
Apple and Google both require apps that store user data to provide a way to export and delete it. The agent generates both flows for any data-bearing app.Export
Settings → Account → Export my data. The user gets a download of everything as JSON, with photos and files included as a zip. Typically arrives in their email within a few minutes.
What you can see
The project dashboard shows, per data type:- Total records on the server, broken out by user
- Active devices writing to each type in the last 7/30 days
- Sync latency how long between a write on one device and visibility on another
- Conflict rate how often two devices change the same record before sync
- Storage size per user, useful for spotting outliers
What you cannot do
- Run heavy analytics on the device. The phone is fast but the battery and memory are limited. Big queries belong on the server.
- Share live state between two users with under-second latency. Sync runs on the order of seconds, not milliseconds. For real-time collaboration (multiplayer, shared cursors), ask the agent for a streaming approach instead.
- Store unlimited data on the device. Phones throttle storage over time and may evict cached content. Treat the device as a fast cache, not a permanent home for unbounded data.
- Bypass the export/delete flow. Both stores require it. You cannot opt out and stay compliant.
Next steps
File Storage
Photos, documents, and other large files.
Environment Variables
Configure backend URLs and API keys per environment.
Analytics
See how users interact with the data layer in production.
Push Notifications
Notify the user when a server-side change is ready to view.
