GithubHelp home page GithubHelp logo

dreambuilder00 / healthcare-react-native-front Goto Github PK

View Code? Open in Web Editor NEW
14.0 1.0 1.0 3.27 MB

License: MIT License

JavaScript 0.35% TypeScript 95.84% Starlark 0.26% Java 0.76% Ruby 0.99% Objective-C 1.80%

healthcare-react-native-front's Introduction

Health Care Mobile Application

This Health platform is a mobile electronic health record system designed for organizations working in low-resource settings to collect and access patient health information. The platform is a lightweight Android application that supports offline functionality and multiple languages including Arabic, Spanish, and English. The medical workflows are designed to be intuitive and allow for efficient patient registration and data entry in low-resource, dynamic, and mobile settings. You can see a user demo here: https://www.youtube.com/watch?v=kTL1OyF63tA

This repository contains the client-side code for Health's mobile application. The corresponding server-side code is located at https://github.com/crazynavi/healthcare-react-native-backend. Please feel free to file feature requests and bugs at either location.

This app is built using React Native and can be compiled for either iOS or Android, although we do most of our testing on Android.

Local Frontend Setup

Requirements: local backend is running, and local db is populated with a clinic and a user.

Fork frontend repository to your organization and clone

Point the selected instance to your local backend:

In src/components/Login.tsx: If present, comment out the useEffect hook (lines 32-44) Change line 21 where the selectedInstance variable is defined, to this:

 const [selectedInstance, setSelectedInstance] = useState({ name: 'local', url: 'http://10.0.2.2:8080' });

If you have 404 errors, you can try using [your_ip:8080] for the instance url, but [10.0.2.2] is an alias set up for local android development that works for most configurations.

Android Studio Setup

Download Android Studio and open the frontend repository there From AS, Open the Android Virtual Device (AVD) Manager by clicking on the icon below, found in the right portion of the top toolbar

Within the AVD Manager, add the device(s) you would like to run in the emulator. (The app has been developed using a Nexus 7 Tablet and a Nexus 5X phone) Once added, click the green play button action on the right of the list to launch the AVD in the emulator

in the android/app/ directory:

keytool -genkey -v -keystore debug.keystore
  -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000

If the debug.keystore file gets generated in the build directory, move it to the android/app directory.

In your .bash_profile , set the following environment variables:

export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools

Open a terminal in the frontend project, and

Npm install

(with the android emulator running)

React-native run-android

This should run the app on the emulator that you have running, and you should be able to login with the email and password of the local user that you created in the local backend setup.

Tips and Tricks

Doublepress the ‘R’ key with the emulator in the foreground in order to recompile the app after making changes in the codebase.

Sometimes you'll want to clear the device database when testing things - maybe you added some test data that you don't want to sync to your local psql db. To do this: change this line in DatabaseInitialization.ts:

    const dropAllTables = false;

to

    const dropAllTables = true;

Reload the app, and then be sure to change this line back and reload the app again.

Creating APK

A tutorial for building an APK can be found here: https://reactnative.dev/docs/signed-apk-android. You can also build the APK in Android Studio by adding Run/Debug configurations in your Android Studio project. Select the gradle project in the configuration (~/android) and the Gradle task ‘assembleRelease’.

healthcare-react-native-front's People

Contributors

dreambuilder00 avatar senane avatar

Stargazers

Ronald Jason avatar DreamHigh avatar drkhrs avatar Top Guru avatar Dream is not only dream. avatar  avatar ByteSlinger avatar Deverabit avatar Vitalii Malchenko avatar LUXUEREAL avatar Billiard avatar  avatar Sid avatar  avatar

Watchers

 avatar

Forkers

pbdev000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.