Skip to content

Installation

Subtlemon edited this page Sep 19, 2019 · 5 revisions

Prerequisites

Highly recommend doing all this in an Anaconda environment.

Development setup

Build React Application

  1. cd to client directory.
    cd client
  2. Preflight.
    1. Install required modules.
      npm install
    2. Add firebase config to .env in client directory.
    REACT_APP_API_KEY='<your api key>'
    REACT_APP_AUTH_DOMAIN='<something>.firebaseapp.com'
    REACT_APP_DATABASE_URL='https://<something>.firebaseio.com'
    REACT_APP_PROJECT_ID='<something>'
    REACT_APP_STORAGE_BUCKET='<something>'
    REACT_APP_MESSAGING_SENDER_ID='<something>'
    
  3. Run the app (use this for debugging).
    npm start
  4. Build the app (use this for deploying).
    npm run build

Deploy Firebase cloud functions (at least once)

  1. cd to firebase directory.
    cd firebase
  2. Install firebase tools.
    npm install -g firebase-tools
  3. Init.
    firebase init
  4. Deploy. If you make changes to cloud functions, you will have to deploy again.
    firebase deploy

Deployment

Deploy to GitHub Pages

  1. cd to client directory.
  2. (Optional) Change the "homepage" setting in package.json.
  3. Deploy.
    npm run deploy
  4. View by visiting the "homepage" listed in package.json.

Deploy to Google App Engine

  1. Preflight.
    1. Build React Application first.
    2. Deploy locally.
      dev_appserver.py app.yaml
    3. View by visiting localhost:8080 (default) in any browser.
  2. Deploy.
    gcloud app deploy
  3. View by visiting http://[YOUR_PROJECT_ID].appspot.com