Core Concepts
Offline-First Data Flow
Section titled “Offline-First Data Flow”User Action -> Component -> Hook/Store -> PowerSync (local SQLite) -> Supabase (cloud) | Offline: works locally Online: auto-syncs to cloudTanStack DB + PowerSync provides full offline functionality with automatic conflict resolution. Components never talk to Supabase directly — all reads/writes go through PowerSync collections.
Both web and mobile share the same schema from @life-manager/db/schema, but use platform-specific PowerSync backends:
| Platform | Package | SQLite Backend |
|---|---|---|
| Web | @powersync/web | wa-sqlite |
| Mobile | @powersync/react-native | @powersync/op-sqlite |
Shared Packages
Section titled “Shared Packages”@life-manager/db(packages/db/) — PowerSync schema, Supabase-generated types, domain types. Shared between web and mobile.@life-manager/shared(packages/shared/) — Shared constants, helper utilities, hooks, i18n locales, and utility functions.