Basic-Car-Maintenance icon indicating copy to clipboard operation
Basic-Car-Maintenance copied to clipboard

Firebase Local Emulator

Open n0rthk1n9 opened this issue 1 year ago • 1 comments

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 run firebase 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

SCR-20231031-mvu

n0rthk1n9 avatar Oct 31 '23 18:10 n0rthk1n9

The best way to install all the requirements is indeed via homebrew:

  1. brew install nvm (Installs node version manager, so you don't need to update the system node version)
  2. nvm install stable and nvm use stable to download and set the last stable node version
  3. brew install openjdk to install openjdk. Add the executable to the $PATH via .zshrc or .bashrc file as prompted after installation
  4. npm install -g firebase-tools

With that all prerequisites should be installed. Let me know if anything doesn't work

n0rthk1n9 avatar Dec 01 '23 17:12 n0rthk1n9

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!

mikaelacaron avatar Jul 30 '24 17:07 mikaelacaron