This guide will walk you through the process of setting up the Mobile Patient Applicatio on your local machine for development purposes.
Before you begin, make sure you have the following installed:
- Node.js ^18.16.0
- Expo Account
- Apple Developer Account (for iOS)
- Google Play Account (for Android)
- New Firebase Project (for Android)
- Android Studio or Xcode (for running the app on a simulator)
Optional
- Deployed Stripe Microservice for payment processing
- BugSnag Account for error reporting
First, clone the VivoCare Health repository to your local machine:
git clone https://github.com/canvas-medical/mobile-patient-health.git
cd mobile-patient-health
Next, install the project dependencies:
npm install
The application requires several environment variables to function correctly. These are stored in a .env.local
file at the root of the project.
Run cp .env.sample .env.local
, open up .env.local
in your code editor, and fill in the values for the environment variables
Here's how you can obtain the keys required in the .env.local
file.
-
EXPO_PUBLIC_AUTH_GRANT_TYPE
: This is typically set toclient_credentials
for OAuth 2.0 client credentials grant type. -
EXPO_PUBLIC_CLIENT_ID
andEXPO_PUBLIC_CLIENT_SECRET
: These are the client ID and secret for your application. You can obtain these from Canvas Medica when you register your application. -
EXPO_PUBLIC_API_URL
: This is the base URL for the API you are connecting to. In this case, it's the Canvas Medical API. -
EXPO_PUBLIC_PRACTITIONER_ID
andEXPO_PUBLIC_CLINIC_ID
: These are specific to your application and can be obtained from your Canvas Dashboard. -
GOOGLE_SERVICES_JSON
: This is a JSON file that contains your project configuration for Google services. You can generate this file from the Firebase Console when you create a project.
If these keys are not included, the associated features will not work but the app will still function
Bill Pay
-
EXPO_PUBLIC_STRIPE_API_URL
,EXPO_PUBLIC_STRIPE_API_KEY
: These are from the Stripe Microservice. You will create these as part of deploying the Stripe Microservice -
EXPO_PUBLIC_STRIPE_PUBLIC_KEY
: This is specific to the Stripe platform. When you create an account and register an application with Stripe, you will be provided with a public key.
Error Monitoring
EXPO_PUBLIC_BUGSNAG_API_KEY
andBUGSNAG_API_KEY
: These are specific to the Bugsnag platform. When you create an account and register an application with Bugsnag, you will be provided with these credentials.
To allow users to log in as demo patients you'll need to:
- Create demo patients through Canvas
- Add their IDs and names to the
demoPatients
object inapp/index.tsx
.
After creating an account, run
npm install -g eas-cli
eas login
eas build:configure
Before you can run the application, you need to build it. This can be done using the Expo CLI:
eas build --profile development
This will prompt you to select a platform. Choose whichever platform you would like to run the application on, and follow the prompts to set up the initial build.
After building the application, you can run it:
npx expo start --dev-client
Press a
to open the app in an Android simulator, or press i
to open the app in an iOS simulator.
Congratulations, you have successfully set up the VivoCare Health application on your local machine for development!