schema0-mobile
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 mobile
References
references/patterns.md-- ORPC client setup, data fetching with useQuery, navigation, web vs mobile comparison table
More from schema0/skills
schema0-dev
>-
23schema0-rls
Row-level security setup — RLS policies, authenticated database connections, and user-scoped data access
17schema0-ai
AI SDK integration with ORPC — chat streaming, prompt-response, tool calling, and provider configuration
17schema0-testing
Testing guide for web and mobile platforms — bun:test, Jest, PGlite, 3-layer validation, and test templates
17schema0-web-crud
Web frontend CRUD features — query collections, table columns, dialogs, forms, views, sidebar, and orchestration
17schema0-cli
CLI commands for sandbox execution, deployment, version management, secrets, and third-party integrations
17