-
Notifications
You must be signed in to change notification settings - Fork 1
Development Guide
Shengquan Ni edited this page Feb 4, 2019
·
4 revisions
This page provides the steps for developers to run BalancedBite applications:
- Download newest version of MongoDB, Maven, Android Studio, React-Native
- Add a mongo DB user as admin with username and password matching the code base
- Open a terminal and start the MongoDB server by typing
mongod --auth
to start authenticating - Open another terminal and navigate to the
BalancedBite/web/balancedbite
folder. This folder contains the code for the dropwizard server. - Run
mvn package
to download the required packages - navigate to the
target
folder and executejava -jar balancedbite-1.0-SNAPSHOT.jar server ../balancedbite.yml
to start the server at port 8080 and 8081. - Open Android Studio and make sure you have followed the guide in https://facebook.github.io/react-native/docs/getting-started to build project using native code
- Start the AVDs you have configured.
- Since our dropwizard server and the development server for react-native both runs on 8081, we need to configure react-native so that it listens to different port number.
- Click
Ctrl-M
on your emulator and go toDev Settings
. In there, navigate toDebug server host & port for device
. In there, change the setting to use[your IPv4 address]:[9988]
, which changes the default port to 9988. The detail of this fix is in https://stackoverflow.com/questions/41315475/react-native-error-packager-cant-listen-on-port-8081/41913126 - Open another terminal and navigate to
BalancedBite/BalancedBite
, which is the root folder for our react-native project. - Run
npm install
first to install all required packages - Execute
npm run android-build
to bundle the project intoandroid/app/src/main/assets/index.android.bundle
file. - Execute
npm run android-start
to start the development process - Assuming you have executed step 14, when a code is changed, just go on to the emulator and click
RR
and the new changes will be load.