HealthBuddy is an Expo + React Native mobile application that provides a simple Electronic Health Record (EHR) experience for patients: authentication, profile management, uploading and viewing medical records, and managing consent for provider access. The app uses Supabase for authentication, storage and database operations and is written in TypeScript.
This repository contains the mobile client built with Expo and expo-router structured for a tab-based flow (auth + main tabs).
- React Native + Expo
- expo-router for file-based routing
- TypeScript
- Supabase (auth, Postgres, storage) via
@supabase/supabase-js - Expo libraries:
expo-image,expo-image-picker,expo-sharing,expo-file-system,expo-constants - UI helpers:
lucide-react-nativeicons
- Email/password authentication (Supabase)
- Sign up / Login screens
- Profile management (view & edit patient profile)
- Upload, view, share medical records (images/files stored in Supabase Storage)
- Consent / provider access requests UI
- Modular services layer under
Services/that wraps Supabase operations
app/– Expo Router entry, routes and screens. Key routes:app/(auth)/login.tsx,app/(auth)/signup.tsx– authentication screensapp/(tabs)/upload.tsx,app/(tabs)/records.tsx,app/(tabs)/profile.tsx,app/(tabs)/consent.tsx– main app tabsapp/_layout.tsx– root layout (fonts & splash handling)
Services/Supabase.ts– Supabase client initialization (usesAsyncStoragefor session persistence)AuthService.ts– signup/login/logout helpersServices.ts– higher-level DB/storage helpers (uploads, row insert/update, query helpers)
components/– reusable UI components (RecordCard,ProfileCard,ConsentCard,SectionHeader, etc.)constants/–Colors.ts,Typography.tstypes/medical.ts– TypeScript interfaces forMedicalRecord,PatientProfile,ConsentRequest
Create a local .env (or set environment variables in your CI/EAS) with the following keys used by Supabase.ts:
EXPO_PUBLIC_SUPABASE_URL– your Supabase project URLEXPO_PUBLIC_SUPABASE_ANON_KEY– your Supabase anon/public key
Note: Keep your service_role key out of the client. Only use anon/public keys in the app.
Prerequisites: Node.js (LTS), Yarn or npm, Expo CLI
- Install dependencies
npm install
# or
yarn install-
Add environment variables (for example, in a
.envfile or inapp.json/ Expo's config) -
Start the Expo dev server
npm run start
# or
yarn start- Run on a device or simulator via the Expo CLI (see
package.jsonscripts forandroid,ios,web).
Taken from package.json:
start–expo startandroid–expo start --androidios–expo start --iosweb–expo start --weblint–expo lint
-
The app queries these tables by name:
patients– stores patient profile records (the code mapsuser.idfrom Supabase auth topatients.id).medical_events– stores metadata about records (type, title, provider, event_date, etc.)documents– expected to containfile_urlfor stored files andmedical_event_idto associate documents to eventsprovider_patient_access– provider access / consent relations (used byServices.getProviderAccessRequests)
-
Storage buckets: the code uses a bucket named
medical_data(seeServices/andapp/(tabs)/records.tsx), and usesgetPublicUrlto obtain public URLs for files. If you want stricter access, switch to signed URLs or a secure proxy.
- AuthService currently writes a plain
passwordfield into thepatientstable on signup — this is insecure and should be removed. Use server-side hashed passwords or rely solely on Supabase auth. - Consider adding server-side functions or Postgres Row Level Security (RLS) policies to ensure only authorized users access patient records.
- Add E2E tests for flows: signup/login, upload record, view/share record, consent grant/revoke.
- Add a
.env.examplewith the required environment vars and a short guide to set them up.
- Use the Expo Go app for quick testing on a physical device.
- If testing file uploads and sharing, ensure the Supabase storage bucket CORS and public settings match your intended flow.
- Use the
expo-file-systemandexpo-sharingflows (already wired inapp/(tabs)/records.tsx).
Contributions are welcome. Please open issues for bugs or feature requests, and open a PR for changes. Add unit/integration tests where possible.
This project doesn't contain a license file in the repository. Add a LICENSE (for example MIT) if you want the project to be open source.
If you'd like, I can:
- add a
.env.examplefile with placeholder values - add a short checklist for Supabase schema and storage setup (SQL snippets)
- add a basic CI workflow for running TypeScript checks and linting
Which of those shall I do next?