diff --git a/Basic-Car-Maintenance/Documentation.docc/getting-started.tutorial b/Basic-Car-Maintenance/Documentation.docc/getting-started.tutorial index a1c5551d..1d560371 100644 --- a/Basic-Car-Maintenance/Documentation.docc/getting-started.tutorial +++ b/Basic-Car-Maintenance/Documentation.docc/getting-started.tutorial @@ -88,8 +88,53 @@ } } } - - @Section(title: "Starting on an issue") { + + @Section(title: "Setting Up Firebase Local Emulator") { + @ContentAndMedia { + Follow these steps to set up the Firebase Local Emulator to load data locally and not affect production. Please do not skip this step. + } + + @Steps { + @Step { + Install Homebrew, a package manager for macOS, if you haven't already: + + `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"` + } + @Step { + Install Xcode command line tools: + + `xcode-select --install` + } + @Step { + Install Node Version Manager (NVM). You then don't need to update the system node version. + + `brew install nvm` + } + @Step { + Add the executable to the `$PATH` via `.zshrc` or `.bashrc` file as prompted after installation. Do NOT forget this! (and then restart your Terminal) + } + @Step { + Download and use the latest stable version of Node.js: + + `nvm install stable` + } + @Step { + `nvm use stable` + } + @Step { + Install OpenJDK, and add the executable to the `$PATH` via `.zshrc` or `.bashrc` file as prompted after installation. Do NOT forget this! (and then restart your Terminal) + + `brew install openjdk` + } + @Step { + Install Firebase Tools for running the emulator. + + `npm install -g firebase-tools` + } + } + } + + @Section(title: "Start Working on an Issue") { @ContentAndMedia { **BEFORE** starting on an issue, comment on the issue you want to work on. @@ -106,6 +151,24 @@ @Image(source: 8-checkout.png, alt: "Checkout issue locally") } + @Step { + Anytime you run the project, first in Terminal `cd` to `backend` in the Basic-Car-Maintenance directory. This is the directory with the `firebase.json` file, you should see that if you type `ls` + + `cd backend` + } + @Step { + Start the Firebase Emulator. Which will start the emulators, and keep your data in local-data directory. Meaning when you start and stop the emulator your data will persist. + + `firebase emulators:start --import=./local-data --export-on-exit` + } + @Step { + Run the app. You should see your anonymous user in Authentication, and once you add new data, see it in Firestore emulator UI at: http://127.0.0.1:4000/firestore + + If you don't see your user, delete the app from the simulator, and in the menu go to Device > Erase All Content and Settings (which resets your simulator), and try to run again + } + @Step { + When your feature or fix is complete, open a pull request (PR) from your feature branch to the `dev` branch. Make sure to use a descriptive PR title and fill out the entire PR template without deleting any sections. + } } } }