Please follow these instructions to configure and run the Backend on your localhost
Within terminal (Mac) or cmd (windows) navigate into the 'Backend' project directory and install the dependencies
cd <backend-dir> yarn install OR npm install
Before we can run our backend web app we need to configure some important settings.
To make our project easier to maintain, we are using a package called 'config' which allows you to define a set of default parameters, and extend them for different deployment environments (development, staging, production, etc.).
Please open the following files within your chosen text editor.
We define static parameters within 'default.json' and then use 'custom-environment-variables.json' to map node env variables to parameters that contain more sensitive data such as passwords or anything we don't want to hardcode into our app.
Configure our mail server
We are using a package called 'nodemailer' to handle sending password recovery emails. Follow these instructions to configure your mail server:
Within 'config/default.json' change the following static parameters:
"jwtPrivateKey": "", <<-- Leave blank
"host": "-HOST-", <<-- Enter your mail server host
"user": "", <<-- Leave blank
"pass": "" <<-- Leave blank
"from": "-FROM-EMAIL-", <<-- Enter a from email address
"subject": "Password Reset" <<-- Change if you wish
Please note: if you are unsure about any of this information, please contact your mail server provider.
Node Environment Variables
As we previously explained, we are using Node Environment Variables to supply our app with some more sensitive information. This includes our mail server user & password. In addion to our JWT Secret.
To define, please go back to your terminal or cmd and write the following commands