Basic-Car-Maintenance
Basic-Car-Maintenance copied to clipboard
Firebase Local Emulator
What it Does
- Closes #14
- It makes the app testable against a local emulated Firebase Auth and Firebase Firestore instance
How I Tested
- Make sure Node v 8.0 or higher is installed
- Make sure Openjdk v 11 or higher is installed (If you installed it via brew, don't forget to add the executable to $PATH, brew will output it as a handy command to execute for you)
- Make sure firebase-cli is installed (
npm install -g firebase-tools
) - Make sure you ran
firebase login
and authenticated successfully - Go to
backend/Basic-Car-Maintenance
and runfirebase emulators:start
- Now every request from the app should go against the emulator
- In the emulator UI at http://127.0.0.1:4000/ you can check if the data you added in the app is added in the emulated Firestore
Notes
- Anything else that should be noted about how you implemented this feature?
Screenshot
The best way to install all the requirements is indeed via homebrew:
-
brew install nvm
(Installs node version manager, so you don't need to update the system node version) -
nvm install stable
andnvm use stable
to download and set the last stable node version -
brew install openjdk
to install openjdk. Add the executable to the $PATH via .zshrc or .bashrc file as prompted after installation - npm install -g firebase-tools
With that all prerequisites should be installed. Let me know if anything doesn't work
Thanks so much for all the help on this! I'm finally getting around to implementing it
I'm going to close your PR because I'm working on this on a separate branch, because I'm also updating a few other things.
Your steps were super helpful to finally get this running!