Mobile Platform
React Native / Expo app at apps/mobile/. Skip this if apps/mobile/ does not exist.
Overview
Mobile apps use a single Cloudflare Worker (apps/mobile/worker.ts) that handles both static assets and API. API routes are mounted at /rpc via Hono + RPCHandler using the same routers from packages/api/.
Key Differences from Web
- Uses
@tanstack/react-querydirectly (NOT TanStack DB /useLiveQuery) - Data fetching:
useQuery(orpc.{entity}.selectAll.queryOptions()) - Auth via
@schema0/auth-mobile+ WorkOS (NOT@template/auth) - API calls go to deployed backend at
EXPO_PUBLIC_WEB_URL/rpc - Environment variables use
EXPO_PUBLIC_*prefix - Navigation via Expo Router (file-based)
Required Env Vars
Validated in _layout.tsx:
EXPO_PUBLIC_WORKOS_CLIENT_IDEXPO_PUBLIC_ORGANIZATION_IDEXPO_PUBLIC_WEB_URLEXPO_PUBLIC_API_HOSTNAMEEXPO_PUBLIC_APP_ID
Deploying
schema0 sandbox deploy --platform mobileReferences
references/patterns.md-- ORPC client setup, data fetching with useQuery, navigation, web vs mobile comparison table