Skip to content

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 a react-native-webview. After Cognito OAuth completes, injected JavaScript extracts the Cognito idToken from localStorage and 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).

TabFeature
dashboardPPP Dashboard or CPD Dashboard (based on accountAccess)
cpd-dashboardCPD overview
cpd-plansCPD plans list
cpd-reportCPD report
cpd-supportCPD support
cpd-resource-libraryResource library
logbookSurgical logbook procedures
reviewsRetrospective reviews
timesheetWork hours / timesheet entry
cpdCPD activities
wellnessWellness questionnaires and scores
wbaWork-based assessments
appraisalsClinical appraisals
my-profileUser profile
healthHealthKit data viewer
work-queueAction items
settingsAdmin-only settings (admin@professionalperformanceportfolio.com)
developmentDevelopment tools / debug screen
retrospectiveRetrospective entries

Background Geofencing & Automatic Timesheets ​

  • lib/services/location-service.ts implements expo-location geofencing.
  • 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/ uses react-native-health to read clinical and fitness data (iOS only).
  • isClinicalDataEnabled: true — access to clinical records requires enhanced permissions.

Camera & Image Picker ​

  • expo-image-picker allows clinicians to photograph medical stickers/reports.
  • Image URI is posted back to the WebView for the Gemini OCR flow.

Push Notifications ​

  • expo-notifications handles 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-query v4 for caching and invalidation.
  • Authorization: Bearer <idToken> header on every request.

Key External Integrations ​

IntegrationPurpose
AWS CognitoOAuth 2.0 authentication (via WebView)
PPP tRPC backendAll data (timesheets, logbook, wellness, CPD, notifications)
Apple HealthKitClinical and fitness data (iOS only)
Expo NotificationsPush notification delivery
Expo EASBuild + submission pipeline

Platforms & Environments ​

DimensionValue
iOS minimumiOS 15+ (assumed from Expo 52)
Android minimumSDK 24+ (targetSdk 35)
Expo SDK52
React Native0.76.9
Build variantsdevelopment (com.professionalperformanceportfolio.ppp.development) and production (com.professionalperformanceportfolio.ppp)
Runtime configWEB_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

Internal documentation — org members only