X5GON Platform API
The X5GON project stands for easily implemented freely available innovative technology elements that will converge currently scattered Open Educational Resources (OER) available in various modalities across Europe and the globe.
This project contains the code base used to setup the main component that connects different services together. The project contains various services:
Platform API. Contains the Platform API and redirections to other microservices. The code is found in the platform folder. In addition, the platform service also serves the frontend, which can be found in
./platform/frontendfolder. The frontend is a submodule whose code base is found here.
Recommender Engine. Contains the code for providing recommendations. The code is found in the recsys folder.
A component that is not included within this repository is the X5GON Processing Pipelines. The code is separated so that the data processing part can be done on another machine. The communication between the Platform and Processing Pipelines is done through the Apache Kafka, which is part of the Processing Pipeline code base.
PostgreSQL version 10 or greater
NodeJS version 10 or greater
To test that your nodejs version is correct, run
node --versionin the command line.
Have a running PostgreSQL database and Elasticsearch service
Make a clone of this repository
git clone https://github.com/X5GON/platform-api.git # navigate into the project cd platform-api
Recursively download all submodules (i.e. the
git submodule update --init
Install the nodejs dependencies and prepare submodule dependencies:
npm run build
Configure submodule dependencies:
x5gondatabase where all of the data is going to be stored:
# switch to the postgres user and create the 'x5gon' database sudo su postgres && createdb x5gon && exit # create the tables in the database npm run postgres:create
Create the recommendation models:
npm run recsys:create
Running the Services
The easiest way to run the services is with PM2. This will run them in the background, will automatically restart if the services crash and is fully configurable through the ./ecosystem.config.services.yml file.
To install PM2 one must run
# global install PM2 npm install -g pm2
To run the service using PM2 one must simply run the following command:
pm2 start ecosystem.config.services.yml --env production
This will also run the pipelines in the background. To control the pm2 services please see their documentation.