Skip to content

Setting up the backend for localhost

Leo Heng edited this page May 1, 2024 · 1 revision

All backend related information exists purely within the functions folder. Treat this folder more like a seperate repository rather than a normal folder. This means when a guide says run npm install or you need to install npm modules for the backend you must run the command within the functions folder.

Setting up .env

  1. Navigate into functions folder
  2. Create a new .env file
  3. Ask for the website director for API keys for the backend
    • NOTE: By this point you should have two .env files one in the root directory and one in /functions. Make sure you place them in the correct location
  • NOTE: It should be set by default but DO NOT push your .env files to the repository

Installing dependencies

  1. Navigate into functions folder
  2. Run npm install

Installing Firebase cli

This stage is required as our backend is just serverless functions from Firebase

  1. Run npm install -g firebase-tools (this can be run anywhere)

Running the server

  1. Run npm run serve (in root directory or in functions)

Clone this wiki locally