Skip to main content

Build guide: patient mobile (React Native)

Version: 1.0
Date: 2026-03-31
Audience: Engineers and AI agents adding apps/ehr-patient-mobile to this monorepo.


1. Before writing code

Read in order:

  1. README.md (pack index)
  2. SPEC.md and TECHNICAL_REQUIREMENTS.md
  3. IMPLEMENTATION_ROADMAP.md
  4. BACKEND_AND_SERVICE_MAP.md
  5. AUTH_AND_SESSION.md, API_CLIENT_AND_KONG.md
  6. REGIONAL_PROFILE.md for i18n/RTL
  7. STANDARDS_ALIGNMENT.md

Platform-wide frontend index: docs/ehr-frontend-specs-index.md.


2. Monorepo placement

ItemValue
Suggested app pathapps/ehr-patient-mobile
WorkspaceRoot pnpm-workspace.yaml — include the app when created
Task runnerFollow Turbo patterns used by other apps/*

Add the package with private: true and packageManager/engines consistent with sibling apps (ARCHITECTURE_AND_MONOREPO.md).


3. Environment variables (illustrative)

Define in .env.example only—never commit secrets. For Expo, never put secrets in EXPO_PUBLIC_*.

VariablePurpose
KONG_PUBLIC_BASE_URLHTTPS origin for Kong (e.g. dev gateway)
OIDC_ISSUERKeycloak (or IdP) realm issuer URL
OIDC_CLIENT_IDPublic client for mobile (PKCE)
OIDC_REDIRECT_URICustom scheme (com.ghasi.patient://...) or HTTPS app link

Exact names MUST match deployment and infra/keycloak realm configuration when a dedicated mobile client is registered.


4. Keycloak / IAM (mobile client)

  • Register a public OIDC client for the app with PKCE enabled (S256).
  • Add valid redirect URIs and (if used) post-logout redirect URIs for the app scheme / universal links.
  • Realm reference: ghasi-realm.json — coordinate with platform team before editing; document new client IDs in deployment runbooks, not in committed secrets.

5. Scripts (illustrative)

ScriptPurpose
lintESLint
typechecktsc --noEmit
testJest / Vitest unit tests
e2eMaestro / Detox (optional CI)

Align with TESTING_STANDARDS.md when wiring CI.


6. Definition of Done (per milestone)


For monorepo discipline only, compare with desktop-electron/AI_AGENT_BUILD_GUIDE.md (different persona, no SQLite/outbox for patient MVP).