This repository contains source code for Compleap Prototype components. This source code acts as an example implementation of the prototyped CompLeap service. The prototype application demonstrates a learner profile that makes use of information about learner's skills, competences, and interests. With the aid of this information, learning opportunity recommendations are offered to help the learner realise new areas where the competences and interests could be combined.
In terms of source code, the prototype application is divided into two main components:
- Client-side application (
model
directory) - Recommendations application (
src
directory)
The release notes of the application can be viewed at the GitHub Releases.
The existing bug reports (if any) can be viewed and new bug reports can be filed at the GitHub Issues.
- JavaScript with ECMAScript 2015 features (programming language for the client app)
- R (programming language for the recommendations app)
- Python (programming language for the ESCO competence matching)
The client app also makes use of the following core technologies and development tools:
- Node.js & NPM (https://nodejs.org/en/) (dependency management)
- React (https://reactjs.org/) (views)
- webpack (https://webpack.js.org/) and Babel (https://babeljs.io/) (build)
- styled-components (https://www.styled-components.com/) (styles)
- JavaScript Standard Style (https://standardjs.com/) and ESLint (https://eslint.org/) (code style)
In addition, following tools are used to ease the development:
- Docker (https://www.docker.com/) and Docker Compose (https://docs.docker.com/compose/) (development environment)
Ensure that you are using the correct version of Node.js (LTS) and NPM (included with the LTS Node.js):
node --version
# v10.16.2
npm --version
# 6.9.0
Install dependencies:
npm i
Create .env
file for environment variables by copying it from the example file:
cp .env.example .env
npm run start:dev
This starts up the development server (webpack-dev-server) and serves the app at http://localhost:8080/.
Alternatively, you can create a development build (npm run build:dev
) and serve the files from the dist
directory with some other HTTP server application. The production build can be created similarly by running npm run build:prod
.
For using the client with the recommendations API, see below.
To start up the recommendations API locally, run:
docker-compose build model-api
docker-compose up model-api
The API is now available at localhost:8000
.
First, switch from mock API to the locally served API by changing the RECOMMENDATIONS_ENDPOINT
environment variable from mock
to /v2/match
.
To use the local recommendations API together with the client app (being served from e.g. the webpack-dev-server), both the API and an Nginx reverse proxy can be started by running:
docker-compose up
The client is now connected to the API can be accessed from localhost:7000
.
All tests:
npm run test
Or by type:
Puppeteer-based browser tests:
npm run test:ui
Component tests:
npm run test:component
Copyright (c) 2019 The Finnish National Board of Education - Opetushallitus
This program is free software: Licensed under the EUPL, Version 1.2 (the "Licence").
You may not use this work except in compliance with the Licence. You may obtain a copy of the Licence at https://joinup.ec.europa.eu/software/page/eupl or from the LICENSE.txt file contained within this repository.