PPP Mobile App — Overview
What Is It?
The PPP (Professional Portfolio Platform) mobile app is an Expo/React Native application for UK and Australian medical professionals. It surfaces the PPP web platform as a hybrid app (WebView for auth + native screens for data entry) and adds mobile-native capabilities including background location geofencing, HealthKit integration, and push notifications.
The app is published on Apple TestFlight (bundle com.professionalperformanceportfolio.ppp; ASC App ID 6740482813 is configured on the development EAS submit profile) and Google Play (application ID com.professionalperformanceportfolio.ppp).
Feature Map
Authentication
- WebView-based login — The root screen (
app/index.tsx) renders the PPP web app in areact-native-webview. After Cognito OAuth completes, injected JavaScript extracts the CognitoidTokenfromlocalStorageand posts it to the native layer. - Token is stored in MMKV encrypted storage via Zustand's
sessionStore. - Logout clears localStorage, sessionStorage, and cookies inside the WebView, then nulls the native token.
Tab Navigation (19 tabs via Expo Router)
All screens below app/(tabs)/ use the native expo-router tab system with a hidden tab bar (navigation is driven by a custom DashboardPopup floating menu).
| Tab | Feature |
|---|---|
dashboard | PPP Dashboard or CPD Dashboard (based on accountAccess) |
cpd-dashboard | CPD overview |
cpd-plans | CPD plans list |
cpd-report | CPD report |
cpd-support | CPD support |
cpd-resource-library | Resource library |
logbook | Surgical logbook procedures |
reviews | Retrospective reviews |
timesheet | Work hours / timesheet entry |
cpd | CPD activities |
wellness | Wellness questionnaires and scores |
wba | Work-based assessments |
appraisals | Clinical appraisals |
my-profile | User profile |
health | HealthKit data viewer |
work-queue | Action items |
settings | Admin-only settings (admin@professionalperformanceportfolio.com) |
development | Development tools / debug screen |
retrospective | Retrospective entries |
Background Geofencing & Automatic Timesheets
lib/services/location-service.tsimplementsexpo-locationgeofencing.- On app start, after permission grants, geofences (50 m radius) are registered around all hospitals assigned to the user.
- Geofence ENTER: Automatically creates a draft timesheet via tRPC and sends a local notification.
- Geofence EXIT: Closes the draft timesheet with the current timestamp and sends a completion notification.
- Duplicate-creation guards use an in-memory lock (
notificationLock) and a daily notification history stored in MMKV.
HealthKit Integration
lib/modules/health/usesreact-native-healthto read clinical and fitness data (iOS only).isClinicalDataEnabled: true— access to clinical records requires enhanced permissions.
Camera & Image Picker
expo-image-pickerallows clinicians to photograph medical stickers/reports.- Image URI is posted back to the WebView for the Gemini OCR flow.
Push Notifications
expo-notificationshandles foreground and background notification delivery.- Permission requested sequentially after location permissions.
- Notification context (
lib/modules/notifications/) manages token registration with the backend.
Data Fetching
- tRPC v10 over HTTP batch link (
lib/utils/trpcClient.ts). @tanstack/react-queryv4 for caching and invalidation.Authorization: Bearer <idToken>header on every request.
Key External Integrations
| Integration | Purpose |
|---|---|
| AWS Cognito | OAuth 2.0 authentication (via WebView) |
| PPP tRPC backend | All data (timesheets, logbook, wellness, CPD, notifications) |
| Apple HealthKit | Clinical and fitness data (iOS only) |
| Expo Notifications | Push notification delivery |
| Expo EAS | Build + submission pipeline |
Platforms & Environments
| Dimension | Value |
|---|---|
| iOS minimum | iOS 15+ (assumed from Expo 52) |
| Android minimum | SDK 24+ (targetSdk 35) |
| Expo SDK | 52 |
| React Native | 0.76.9 |
| Build variants | development (com.professionalperformanceportfolio.ppp.development) and production (com.professionalperformanceportfolio.ppp) |
| Runtime config | WEB_URL + TRPC_URL via app.config.js extra (set at EAS build time) |
Directory Structure
Project layout — click to expand
mobile/ppp/
├── app/
│ ├── index.tsx # Root WebView auth screen
│ ├── _layout.tsx # Root layout + providers
│ ├── notifications/ # Notification screen (outside tabs)
│ ├── logout/ # Logout handler
│ ├── verification/ # Account verification
│ ├── add-*/ # 19 form routes (add-cpd, add-logbook-case, add-timesheet, …)
│ └── (tabs)/
│ ├── _layout.tsx # Tab layout, permissions, health, notifications
│ ├── dashboard/
│ ├── logbook/
│ ├── timesheet/
│ ├── wellness/
│ ├── health/
│ ├── development/
│ ├── retrospective/
│ └── ... # 12 other tab screens
├── lib/
│ ├── components/ # Shared UI components
│ ├── contexts/ # React contexts (HeaderBackButton)
│ ├── hooks/ # Custom hooks (useLocationTracking)
│ ├── useColorScheme.ts # Color scheme hook (top-level, not in hooks/)
│ ├── modules/
│ │ ├── health/ # HealthKit context + hooks
│ │ └── notifications/ # Notification context + hooks
│ ├── services/
│ │ └── location-service.ts # Background geofencing + auto-timesheet logic
│ ├── stores/
│ │ └── sessionStore.ts # Zustand session store (token + user)
│ └── utils/
│ ├── storage.ts # MMKV instance + Zustand adapter
│ └── trpcClient.ts # tRPC client factory
├── assets/ # Icons, splash screens
├── app.config.js # Expo config (bundle IDs, permissions, plugins)
├── package.json # pnpm >= 9 + Jest preset
└── tsconfig.json # TypeScript config