Installing For local development
- Install gcloud CLI
- If you don’t have java (or see the error
Error: Process java -version has exited with code 1. Please make sure Java is installed and on your system PATH.):
$ brew install java
$ sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
$ gcloud auth login to authenticate the CLI tools to Google Cloud
$ gcloud config set project <project-id> to choose the project ($ gcloud projects list to see options)
$ mkdir firestore_export to create a folder to store the exported database.
$ yarn db:update-local-from-remote to pull the remote db from Firestore to local
- OR download db exports from google drive. Then change the name to
firestore_export and put it in backend/ directory
Developing locally
$ ./dev.sh localdb (in the root, not here) to start the local emulator and front end. Exiting after ctrl+c takes a few seconds, give it time! Don’t run ctrl+c multiple times or you’ll have to kill processes manually.
- If your emulators won’t start, try running
export JAVA_TOOL_OPTIONS="-Xmx4g" to give them more memory (4gb in this example)
- It’s best to use a browser (both on localhost:3000 and localhost:4000) with totally clean history or history only from the emulator to avoid buggy mixing of cached data.
- By default, changes made to the local db are not saved. If you start the emulators and add the
-export-on-exit flag, the emulators will save changes to ./firestore_export on exit.