Skip to content

How to run the backend locally

Wilson Jusuf edited this page Mar 6, 2021 · 3 revisions

Here are the steps to run the backend locally.

  1. First, npm install all the required backend dependencies
cd server;
npm install 
  1. Then, install postgresql 12.4 on your local machine. For mac, you can use this.

  2. Get a finnhub.io API key - We use this for market data.

export FINNHUB_API_KEY="YOUR_API_KEY_HERE"
  1. Then, run the backend locally by doing:
PG_CONNSTR='postgresql://DBUSER_HERE:PASSWORD_HERE@localhost:5432/DATABASE_NAME_HERE' FINNHUB_API_KEY=$FINNHUB_API_KEY npm run dev-server

In windows systems, setting environment variables like the above won't work since e.g. it will interpret PG_CONNSTR as the actual command. You need to set PG_CONNSTR as the environment variable separately in the shell, and run npm run-dev-server after it.

Clone this wiki locally