React Native + Expo mobile client for the CrimeLink Analyzer platform.
This app connects to:
- CrimeLink backend APIs (authentication, duty, leave, announcements, safety zones, weapon requests, officer location)
- Firebase (chat/auth-related integrations)
- Google Maps services (map and location features)
- Expo SDK 54
- React Native 0.81
- Expo Router (file-based routing)
- TypeScript
- NativeWind
- Axios
- Firebase
Install the following before running:
- Node.js 18+ (recommended: latest LTS)
- npm 9+
- Expo CLI (via npx, no global install required)
- Android Studio (for Android emulator) or Xcode (for iOS simulator on macOS)
For API calls to work, run the backend service and make sure its URL is reachable from your device/emulator.
This project reads environment values from:
.env.development.env.preview.env.production
The selected file depends on APP_ENV (default is development).
From this folder, copy .env.example to one of the environment files:
cp .env.example .env.developmentAt minimum, set all of the following keys:
API_URL=
FIREBASE_API_KEY=
FIREBASE_AUTH_DOMAIN=
FIREBASE_PROJECT_ID=
FIREBASE_STORAGE_BUCKET=
FIREBASE_MESSAGING_SENDER_ID=
FIREBASE_APP_ID=Optional but recommended:
GOOGLE_MAPS_API_KEY=- Android emulator (calling backend on your machine):
API_URL=http://10.0.2.2:8080- iOS simulator:
API_URL=http://localhost:8080- Physical device (same Wi-Fi as your machine):
API_URL=http://<YOUR_LOCAL_IP>:8080npm installDevelopment environment (default):
npx expo startUse a specific environment file:
APP_ENV=preview npx expo start
APP_ENV=production npx expo startnpm run androidnpm run iosnpm run webnpm run lint- Start backend service (default expected port: 8080).
- Configure
.env.developmentwith valid API/Firebase values. - Install dependencies with
npm install. - Start Expo using
npx expo start. - Launch on emulator/device (
afor Android,ifor iOS in Expo terminal, or use npm scripts).
- App config values are injected through
app.config.jsinto Expoextra. - If you use EAS Build, define the same env vars in your EAS environment. Missing values can cause runtime failures when reading config.
app/route screens (Expo Router)src/api/API client setupsrc/services/feature service layerssrc/constants/shared constants and runtime configsrc/components/reusable UI and feature componentssrc/context/andsrc/hooks/app state and hooks
- Error: Missing required app config
- Check
.env.*values and confirm you started the app with the intendedAPP_ENV.
- Check
- Network request failed
- Verify backend is running and
API_URLis reachable from emulator/device.
- Verify backend is running and
- Android physical device cannot reach backend
- Use your machine local IP address, not
localhost.
- Use your machine local IP address, not
npx expo start- Start Expo development servernpm run android- Build/run on Androidnpm run ios- Build/run on iOSnpm run web- Run web targetnpm run lint- Lint projectnpm run reset-project- Reset scaffolded starter structure