Field App Setup (Mobile)
Pro tier — The field app is an Expo (React Native) application for on-site interventions, reports and equipment checks.
Prerequisites
- Node.js ≥ 22
- pnpm ≥ 9
- Expo Go installed on your iOS/Android device (for development)
- A free Expo account on expo.dev (required for EAS builds)
Quick setup
1. Environment variables
cp apps/app-terrain/.env.example apps/app-terrain/.env.localFill in apps/app-terrain/.env.local:
# URL of your web instance (apps/web)
EXPO_PUBLIC_API_URL=https://your-domain.com
# App branding
EXPO_PUBLIC_APP_SLUG=your-slug
EXPO_PUBLIC_APP_NAME="Your Field App"Local note: To test on a real phone,
EXPO_PUBLIC_API_URLmust point to your machine's local IP (e.g.http://192.168.1.42:3000), notlocalhost.
2. Install dependencies
pnpm install3. Run in development mode
cd apps/app-terrain
pnpm startScan the QR code with Expo Go on your phone.
App structure
apps/app-terrain/
├── app/ # Expo Router routes
│ ├── (auth)/ # Sign-in screens
│ ├── (tabs)/ # Main tab navigation
│ └── interventions/ # Intervention detail and creation
├── components/ # Reusable components
├── lib/ # Utilities
│ ├── api.ts # tRPC client
│ ├── auth.ts # NextAuth session
│ └── sync.ts # Offline sync
└── store/ # Global state (Zustand)
Included features
| Feature | Detail |
|---|---|
| Authentication | Email/password login + biometrics (Face ID, fingerprint) |
| Interventions | List, detail, creation, signature |
| Photos | Capture and annotate photos from the app |
| Offline mode | Mutation queue + automatic sync when the network is back |
| Push notifications | Via Expo Notifications |
| Field reports | PDF generated server-side |
Production build (EAS Build)
Initial configuration (once)
cd apps/app-terrain
npx eas build:configureThis creates or updates eas.json and links the project to your Expo account.
Android build (APK/AAB)
npx eas build --platform android --profile productioniOS build (.ipa)
npx eas build --platform ios --profile productioniOS prerequisite: an Apple Developer account ($99/year) + certificates configured in EAS.
OTA update (without a rebuild)
npx eas update --branch production --message "Update description"Authentication
The field app uses the same NextAuth sessions as the web interface. The mobile-dedicated API routes live under /api/mobile/* in apps/web.
To create new mobile endpoints, see apps/web/src/app/api/mobile/.
Troubleshooting
Metro bundler won't start
pnpm start --clear"Network request failed" error on a real phone
Replace localhost with your local IP:
# Find your IP (macOS/Linux)
ifconfig | grep "inet "
# Windows
ipconfigThen update EXPO_PUBLIC_API_URL=http://192.168.x.x:3000.
Incompatible Expo dependencies after an update
npx expo install --checkTypeScript error in the app
cd apps/app-terrain
pnpm typecheckResources
- Expo Router documentation
- EAS Build
- EAS Update
- Web architecture: Architecture
- Available modules: Modules