The client section assumes that the user will be running the server on a Raspberry Pi Model 3+ and the application on an Android tablet. An APK file will be posted in GitHub releases with the server IP address already having been pre-configured during the build process.
To start, you will need to be running a 32-bit Raspbian OS on a Raspberry Pi Model 3+. If you do not have Raspbian, please using the official imager to flash a fresh version on to your RPI's SD card. Note that the server runs fine on any version of Linux, but this guide was written assuming you are using the above specfications. Additionally, please make sure that your username on the RPI is pi.
Once that is done, please open up the "Terminal" application and type in the following command. After you have typed this phrase, you need to press [ENTER] at the end.
curl -sL https://raw.githubusercontent.com/TritonSE/ihc-emr/master/scripts/setup.sh | bash -s
You should see output being displayed. If any of the output indicates an error has occurred, please contact us for further help. Otherwise, at this point, the server will be running indefinitely on the Raspberry Pi.
Please visit the releases section and download the latest version of the APK to your tablet. Everything should work out of the box.
The developers section assumes that the user will be running the app on an Android tablet emulator and hosting the server on a local MongoDB instance. You must also be using NodeJS v10 or lower due to issues with Realm.
- Make sure you have NodeJS v10 and jdk 1.8 (JAVA 8) installed. Run
npm install -g react-native-cli
in your terminal. - In terminal, go to your preferred directory for the project to be located at and run
git clone https://github.com/TritonSE/ihc-emr
. - In the directories
mobile
andserver
, runnpm install
. - Install MongoDB.
- (Recommended) Open the project through Android Studio.
- Set environment variable
ANDROID_HOME
to the location of Android SDK on computer. Set environment variableJAVA_HOME
to the location of jdk 1.8(JAVA 8) on computer.
- In Android Studio, press the AVD Manager button on the top right. Create a new virtual device, a 10 inch tablet and run the emulator.
- Make sure MongoDB is running. Link to Instructions
- In directory
server
, runnpm start
to run the server. - In directory
mobile
, runreact-native run-android
to start the application on the emulator.
-
If you don't have a signing key yet, generate a signing key. In
mobile/android/app
run this command and follow the steps to generate the key:keytool -genkey -v -keystore my-key.keystore -alias my-key -keyalg RSA -keysize 2048 -validity 10000
-
In
mobile/android/gradle.properties
add the password you used to generate your keystore from the last step to both theMYAPP_RELEASE_STORE_PASSWORD
andMYAPP_RELEASE_KEY_PASSWORD
entries. Edit theMYAPP_RELEASE_KEY_ALIAS
entry if you chose a different alias when running thekeytool
command. -
Now, to generate the APK, make sure you are in
mobile/android
, then run:./gradlew assembleRelease
for Mac/Linuxgradlew assembleRelease
for Windows
-
Done! You'll find the APK at
mobile/android/app/build/outputs/apk/app-release.apk
!
-
Allow unknown apps by doing(these steps might be different depending on your device):
- Go into Settings.
- Tap Security (or Lock Screen and Security).
- Scroll down to the Device Administration section, and enable Unknown Sources.
-
Download the APK to the device(either using Google Drive or another method).
-
If a pop-up comes up saying "This type of file can harm your device," accept it.
-
Tap the downloaded APK file and tap
Install
. -
The app should now show up in the app library as
IHC EMR
.