Skip to content

STOP2/stop2.0-traveller-client

Repository files navigation

Build Status codecov

STOP2.0 - A digital stop button for your mobile phone

Made with React Native and Redux.

Get it on Google Play

How to setup the development environment

You'll need Node.js version >= 4.

Watchman is highly recommended (it will speed up the development by showing your code changes instantly on the app using live/hot reloading) but not required.

First install React Native:

npm install -g react-native-cli

Clone the latest version of the project. Inside the project folder install dependencies with

npm install

Change buildToolsVersion from 23.0.1 to 25.0.0 in these files:

./node_modules/react-native-localization/android/build.gradle
./node_modules/react-native-beacons-android/android/build.gradle
./node_modules/react-native-fcm/android/build.gradle
./node_modules/react-native-bluetooth-serial/build.gradle

To build and run the project on Android:

Download and install Android Studio: https://developer.android.com/studio/index.html

Open Android Studio -> Tools -> SDK Manager -> Launch SDK Manager (or in command line: cd tools && ./android on android SDK folder) and install Android 6.0 and Android SDK Build-tools 25.0.0.

Set up Android keystore: Follow steps "Generating a signing key" and "Setting up gradle variables" at https://facebook.github.io/react-native/docs/signed-apk-android.html

Run on Android emulator: Create new AVD (Android Virtual Device) with Android Studio or in command line: cd tools && ./android avd (on android SDK folder) Start the emulator on Android Studio or in command line: cd tools && ./emulator -avd name_of_your_avd

Run on phone: Unlock Developer Settings on Android: Settings -> About Phone -> Tap "Build number" 7 times and the Developer options will be unlocked and available Enable Developer options and USB debugging: Settings -> Developer options -> Enable Android debugging Connect the phone to PC with USB

Run the app (the app will run on the device if it's connected, otherwise it will run on the emulator):

Ensure that the React Native packager is running (you may skip this step, it should automatically start on the next step):

react-native start

To start the build process, run:

react-native run-android

to run the app on production mode (hides errors & warnings):

react-native run-android --variant=release

Testing

Components, actions and reducers are tested with Jest snapshot tests which are located in the tests subfolders.

Tests can be run with

npm test

Wiki

https://github.com/STOP2/stop2.0-documentation/wiki