There are multiple ways to install Node and Yarn (a package management system for Node). We would recommend the excellent NVM (Node Version Manager) which can be installed by following instructions here: https://github.com/creationix/nvm
PM2 is an excellent tool that can be used to manage the Node processes. It also handles log management/rotation and can automatically restart failed services. Learning Locker comes pre-packaged with some pm2 configuration scripts.
We also recommend installing the pm2-logrotate module, which can handle rotating and compressing your logs.
pm2 install pm2-logrotate
pm2 set pm2-logrotate:compress true
USER BEST PRACTICE
It is always preferable that you do not run your Node processes as the root user. For this reason we would always suggest creating a new system user under which installation, builds and services can be run.
The Learning Locker application is divided into two logically separate codebases, each of which can be configured to talk to the same Mongo and Redis instances.
Each codebase requires that it is downloaded, built and configured before it can be run. This guide will aim to guide you through manually installing and running a full Learning Locker stack.
If PM2 has been installed, you will be able to run the services using the preconfigured pm2 files in each codebase:
LEARNING LOCKER UI, API, WORKER
To start all 3 services, navigate to the LL working directory and run:
pm2 start pm2/all.json
To start the xAPI service, navigate to the xAPI Service working directory and run:
pm2 start pm2/xapi.json
CONFIG, STATUS AND LOGS
Note you may wish to copy and modify these pm2 config files based on your setup. Documentation can be found here.
To view the status of your services:
To view logs:
To restart the services:
pm2 restart all
RUNNING THE SERVICES MANUALLY
If you wish to use a different process management tool (e.g. Supervisor) or simply wish to run them manually for testing, you can start the services with these commands.
RUNNING THE UI
RUNNING THE API
RUNNING THE WORKER
RUNNING THE XAPI SERVICE
In your xAPI service directory
The application is accessed through 3 web interfaces, the UI, API and xAPI. Each of these is configured to run on independent ports but it is recommended you setup a server to sit infront of all traffic and route accordingly. An example nginx config can be seen here: nginx.conf.example
Learning Locker and the Squirrel logo are trademark of Learning Pool 2020 | Learning Locker is licensed under GPL 3.0.