Production Readiness

Production Readiness Checklist (Launch)

1) Secrets & Environment

  • Set RevenueCat keys:
    • EXPO_PUBLIC_REVENUECAT_IOS_API_KEY
    • EXPO_PUBLIC_REVENUECAT_ANDROID_API_KEY
  • Confirm AdMob IDs are production IDs (not test IDs).
  • Confirm legal URLs are real and reachable (Settings uses LEGAL_URLS in app/(tabs)/settings.tsx).

API (AI Interview)

  • Required for AI Interview: Set EXPO_PUBLIC_API_URL to the web API base URL (e.g. https://api.civixapp.us). No trailing slash. Set in EAS Secrets for production builds.
  • Optional: Backend rate limiting (e.g. Upstash) is configured in the web app to protect the Interview API; see apps/web and deployment docs.
  • How to test: Open the app → Interview tab. Header shows "AI Assisted" when the API is reachable, "Local Fallback" when not. Run through Start → Chat → Complete with API connected. See docs/API-CONNECTION-GUIDE.md.

Interview (AI vs Mock)

  • AI Interview requires EXPO_PUBLIC_API_URL and a reachable server. If the API is unavailable, the app shows a non-blocking banner and users can use Mock Interview instead.
  • Mock Interview runs fully offline (no API). Use it when the API is not set or when you want to test without the backend.
  • Testing checklist: Start AI Interview → send messages → complete → verify results; when API is off, verify fallback message and Mock Interview still works. See docs/PRE-LAUNCH-CHECKLIST.md.

2) Builds (Important)

  • Use a Development Build for native features (RevenueCat, AdMob). Expo Go will not support them.
  • Run through docs/06-DEV-BUILD-GUIDE.md.

3) Quality Gates (Run Before Every Release)

  • npm run preflight (mobile: doctor, typecheck, test, lint)
  • Automated tests: From repo root or per app:
    • Web: cd apps/web && npm run test && npm run test:e2e (Vitest API route tests + Playwright E2E for landing, health, docs).
    • Web live smoke: cd apps/web && npm run test:interview-api to verify deployed start/chat/evaluate/complete flow.
    • Mobile: cd apps/mobile && npm test (Jest unit tests, including api-client). Optional: npm run test:e2e (Maestro Interview smoke) when Maestro CLI and installed app are available.
    • See docs/TESTING.md for full testing guide.
  • Manual smoke test (device):
    • Onboarding flow works end-to-end
    • Quiz session works + results saved
    • Practice session works + results saved
    • Paywall opens and purchase/restore works (dev build / TestFlight)
    • Settings: language switch + profile photo + theme toggle
    • Interview modules gated correctly for premium

4) Performance Gates (Mobile)

  • Follow docs/PERFORMANCE-RUNBOOK.md before release candidates.
  • Verify:
    • Tab navigation does not trigger heavy rerenders when switching tabs (freezeOnBlur behavior).
    • Repeated avatars/images hit cache (expo-image memory-disk policy).
    • Senior mode practice/exam starts without empty sessions when state profile is missing.
  • Collect one baseline profile on a mid-tier Android device and one on iPhone before production submission.

5) Store Submission

  • iOS: docs/03-APP-STORE-SUBMISSION.md
  • Android: docs/04-GOOGLE-PLAY-SUBMISSION.md
  • Compliance: docs/05-COMPLIANCE-CHECKLIST.md

6) Observability (Recommended)

  • Use GET /api/health for uptime checks (e.g. Vercel cron or external monitor hitting https://api.civixapp.us/api/health). Health returns status: "ok" and services.openai; no secrets.
  • Add crash reporting (e.g. Sentry) + basic analytics before launch.
  • Add a support email + “Report a problem” flow in Settings.

7) Troubleshooting

  • API not connecting: Check EXPO_PUBLIC_API_URL is set (no trailing slash). On device/emulator use host IP or tunnel, not localhost. See docs/API-CONNECTION-GUIDE.md.
  • Interview not starting: Verify API is reachable (Interview tab shows "AI Assisted"). Ensure start endpoint returns 200 and a valid session.
  • Messages not sending: Check network; if rate limited (429), wait for retry or retry-after. Confirm device can reach the API host.