Skip to content

Development Guide

Shengquan Ni edited this page Feb 4, 2019 · 4 revisions

This page provides the steps for developers to run BalancedBite applications:

  1. Download newest version of MongoDB, Maven, Android Studio, React-Native
  2. Add a mongo DB user as admin with username and password matching the code base
  3. Open a terminal and start the MongoDB server by typing mongod --auth to start authenticating
  4. Open another terminal and navigate to the BalancedBite/web/balancedbite folder. This folder contains the code for the dropwizard server.
  5. Run mvn package to download the required packages
  6. navigate to the target folder and execute java -jar balancedbite-1.0-SNAPSHOT.jar server ../balancedbite.yml to start the server at port 8080 and 8081.
  7. 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
  8. Start the AVDs you have configured.
  9. 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.
  10. Click Ctrl-M on your emulator and go to Dev Settings. In there, navigate to Debug 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
  11. Open another terminal and navigate to BalancedBite/BalancedBite, which is the root folder for our react-native project.
  12. Run npm install first to install all required packages
  13. Execute npm run android-build to bundle the project into android/app/src/main/assets/index.android.bundle file.
  14. Execute npm run android-start to start the development process
  15. 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.
Clone this wiki locally