ZTS Docs

Mobile app (Expo)

Developing the React Native app in apps/mobile with shared tRPC and auth.

The mobile app (apps/mobile, package @zts/mobile) is an Expo project that shares the same backend as the web app through @zts/trpc and @zts/auth.

Prerequisites

Run locally

From the repository root:

pnpm dev          # web API + UI (required for tRPC/auth)
pnpm dev:mobile   # Expo dev server

Platform-specific:

pnpm dev:mobile:ios
pnpm dev:mobile:android

Or from apps/mobile:

pnpm --filter @zts/mobile run dev

API URL

The tRPC client is configured in apps/mobile/src/utils/api.tsx. It calls {baseUrl}/api/trpc with the Better Auth session cookie on each request (x-trpc-source: expo-react).

Base URL resolution (apps/mobile/src/utils/base-url.ts):

  1. EXPO_PUBLIC_API_URL or EXPO_PUBLIC_APP_URL if set
  2. Otherwise Expo dev host + port from EXPO_PUBLIC_WEB_PORT / EXPO_PUBLIC_PORT / PORT (default port 4000 in code — set env explicitly to 3000 when pointing at the web dev server)

Recommended local .env (root or Expo env):

EXPO_PUBLIC_APP_URL=http://127.0.0.1:3000

Use your machine’s LAN IP instead of 127.0.0.1 when testing on a physical device.

Shared packages

PackageUsage in mobile
@zts/trpcRouter types, AppRouter, tRPC client
@zts/authBetter Auth Expo client (@better-auth/expo)
@zts/sharedPayment plans, shared types

Billing and profile flows reuse the same routers as web; see apps/mobile/src/features/.

Auth

Mobile uses the Better Auth Expo plugin configured in packages/auth (server) and the Expo client in apps/mobile/src/utils/auth.ts. Deep links and secure storage follow Expo’s standard Better Auth integration patterns.

OAuth/social providers behave like web; ensure NEXT_PUBLIC_APP_URL / trusted origins match how you reach the API from the device.

Build

pnpm build:mobile
# or
pnpm --filter @zts/mobile run build

Production builds typically use EAS; wire EXPO_PUBLIC_APP_URL to your deployed web origin.

UI note

Responsive web components in Kitze UI adapt for small screens (bottom sheets, native selects). The native app in apps/mobile is a separate Expo UI — see Mobile demo for responsive web behavior, not the Expo codebase.

On this page