Skip to Content

Setup

Prerequisites

  • Node.js >= 20.0.0 (enforced in package.json engines)
  • npm >= 10.0.0
  • Expo CLI (bundled with expo package)
  • EAS CLI (npm install -g eas-cli) for builds
  • iOS Simulator (macOS only, Xcode required) or Android emulator (Android Studio)
  • For native builds: Xcode and/or Android Studio with appropriate SDKs

Clone and Install

git clone <repo-url> cd Housr-App npm install

The postinstall script runs patch-package to apply any local patches.

Environment Variables

Environment variables are validated at startup using Zod in src/config/env.ts. The app will throw with a descriptive error if required variables are missing.

Required Variables

VariableDescription
EXPO_PUBLIC_API_V1_URLLegacy API v1 base URL (e.g., https://staging.api.uk.housr.com/api/)
EXPO_PUBLIC_API_V2_URLAPI v2 base URL (e.g., https://v2.staging.api.uk.housr.com/)
EXPO_PUBLIC_FIREBASE_DATABASE_URLFirebase Realtime Database URL
EXPO_PUBLIC_FIREBASE_API_KEYFirebase API key

Optional Variables

VariableDescription
EXPO_PUBLIC_USA_MODE"true" or "false" — controls region (default: UK)
EXPO_PUBLIC_ENVIRONMENT"local", "demo", "staging", or "prod" (default: "local")
EXPO_PUBLIC_MIXPANEL_TOKENMixpanel analytics token
EXPO_PUBLIC_MIXPANEL_SERVER_URLMixpanel server URL (EU vs US)
EXPO_PUBLIC_GOOGLE_WEB_CLIENT_IDGoogle Sign-In web client ID
EXPO_PUBLIC_GOOGLE_IOS_CLIENT_IDGoogle Sign-In iOS client ID
EXPO_PUBLIC_INTERCOM_APP_IDIntercom app ID
EXPO_PUBLIC_INTERCOM_API_KEYIntercom iOS API key
EXPO_PUBLIC_INTERCOM_ANDROID_API_KEYIntercom Android API key
EXPO_PUBLIC_SENTRY_DSNSentry error tracking DSN

Accessing Environment Config

import { env, isUsaMode } from '@/config/env'; // env.EXPO_PUBLIC_API_V2_URL // isUsaMode === true when EXPO_PUBLIC_USA_MODE is "true"

Local Development

Expo Go (Limited)

npm start

Some features (Google Sign-In, Firebase messaging, Apple Sign-In) are not available in Expo Go and require a development build.

Development Build

npm run ios # Build and run on iOS simulator npm run android # Build and run on Android emulator

These commands run expo run:ios and expo run:android, which create native builds with the dev client.

Storybook

npm run storybook

Runs component storybook on port 6006 (using @storybook/react-native-web-vite).

EAS Build Profiles

For staging and production builds, use EAS. See Build & Deploy for the full list of profiles and CI/CD details.

Quick local staging build:

APP_VERSION=1.2.3 BUILD_NUMBER=1 npx eas build --profile uk-staging --platform ios --local

Sentry

Sentry is initialized in the root layout (src/app/_layout.tsx). In local mode, it connects to Spotlight (local Sentry UI). In production, it uses the configured DSN with a 5% trace sample rate.

Last updated on