Skip to content

Server Setup

Michael edited this page Oct 5, 2024 · 8 revisions

1) Get .env Secrets

  • We have 2 .env files where we store our environment variables needed for the Icebreak app to run (ie. API keys, etc.).
  • Find the .env secrets in the #secrets channel in the Discord.
  • DO NOT share the .env with anyone, even if you know they are part of the team. Ask them to reach out to the Project Lead or their Team Lead directly.
  • Put the frontend .env file in icebreak/packages/app.
  • Put the backend env.development and env.production files in icebreak/packages/server.

2) Run the server

  • At icebreak's root directory, run yarn server:start

3) (Windows-only) Allow through Firewall

  • When you first run the command it will prompt you with a firewall.
  • Check both and press Allow Access.
git wizard

4) Check if server is running

git wizard

Ngrok Setup

Ngrok will allow us to port forward a local network onto a temporary public URL. This is required since Expo can't access our local network.

1) Create an Ngrok account

  • Login and find your auth token code which you'll use later in the terminal. image

2) Install Ngrok

  • For MacOS users, run brew install ngrok in Terminal.
  • For Windows users, install ngrok here. The Windows download gives you a folder containing the ngrok executable. I highly recommend you add ngrok to your Windows PATH system environment variable so you can run ngrok from anywhere in terminal.

3) Connect your account

  • Open Terminal
  • Connect your ngrok account with your ngrok in terminal with the auth token you found earlier:
ngrok config add-authtoken <auth-token>

4) Fire it up

  • Make sure your backend server is running.
  • Run ngrok http 5050

image

After all those steps, congrats, you are officially finished up your environment on the server.