Skip to content
Snippets Groups Projects
README.md 6.23 KiB

drip, the open-source cycle tracking app

A menstrual cycle tracking app that's open-source and leaves your data on your phone. Use it to track your menstrual cycle and/or for fertility awareness! Find more information on our website.

The app is built in React Native and currently developed for Android.

Here --> you will find our contributing guide.

Development setup

  1. Install Android Studio - you'll need it to install some dependencies.

  2. Make sure you are running Node 10 (newer versions won’t work). It's easiest to switch Node versions using nvm, here’s how to do it:

    $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
    $ nvm install v10
  3. Clone this repository:

    $ git clone git@gitlab.com:bloodyhealth/drip.git
    $ cd drip

    and run

    $ npm install
  4. Open Android Studio and click on "Open an existing Android Studio project". Navigate to the drip repository you cloned and double click the android folder. It detects, downloads and cofigures requirements that might be missing, like the NDK and CMake to build the native code part of the project. Also see the nodejs-mobile repository for the necessary prerequisites for your system.

  5. Either start a virtual device in Android Studio or set your physical device like your Android phone up to run the app.

  6. Open a terminal and run

    $ npm run android
  7. To see logging output, run the following command in another tab:

    $ npm run log
  8. Run the following command and select enable hot reloading (see https://facebook.github.io/react-native/docs/debugging.html):

    $ adb shell input keyevent 82
  9. We recommend installing an ESLint plugin in your editor. There's an .eslintrc file in this project which will be used by the plugin to check your code for style errors and potential bugs.

Troubleshooting

[MacOS] Java problems

Make sure that you have Java 1.8 by running java -version.

If you don't have Java installed, or your Java version is different, the app may not work. You can try just using Android Studio's Java by prepending it to your $PATH in your shell profile:

$ export PATH="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin:${PATH}"

Now, which java should output /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java, and the correct Java version should be used.

[MacOS] Ninja

If npm says CMake was unable to find a build program corresponding to "Ninja".: $ brew install ninja

[MacOS] adb not on the path

If you get error messages about adb not being found on your path: $ ln -s ~/Library/Android/sdk/platform-tools/adb /usr/local/bin/adb

Tests

Unit tests

You can run the tests with:

$ npm test