-
Notifications
You must be signed in to change notification settings - Fork 0
Getting started
The application requires Node JS, NPM package manager and Redis to be installed.
The best way to install Node JS on OSX is via the Homebrew package manager. This should install NPM by default. To install Node JS with Homebrew run:
brew install node
To install Node on Linux run:
sudo apt install nodejs
Node Version Manager (NVM) is a useful module for managing multiple versions of Node JS on a single machine.
The application uses Redis for session storage. To run the application locally a local instance of Redis is required to be running.
The best way to install Redis on OSX is via the Homebrew package manager. To install Redis with Homebrew run:
brew install redis
To start the Redis server run:
brew services start redis
To stop the Redis server run:
brew services stop redis
To check the Redis server is running run:
redis-cli ping
To install Redis on Linux run:
sudo apt install redis-server
To install the project dependencies run the following command from the project root:
npm install
Before starting the application or running tests, ensure that the correct environment variables have been set. A list of required environment variables can be found in sample.env.
To run the app locally, duplicate sample.env and rename to .env. dotenv will then use the .env file to set local environment variables. It is important that .env is never committed to the code repository as it may contain sensitive data.
To start the application run the following command:
// Build the application
npm run build
// Start the application
npm start
Alternatively the application can be built and run using a single command that uses nodemon to watch for changes:
npm run start:dev
* N.B. The build target is automatically run in the postinstall hook defined in package.json. This is useful for building the project during deployment.