eTutor-plus-plus / platform

The etutor++ main application.
2 stars 0 forks source link

eTutor++: Platform

This application was generated using JHipster 7.2.0, you can find documentation and help at https://www.jhipster.tech/documentation-archive/v7.2.0.

Development

Dependencies

Before you can build this project, you must install and configure the following dependencies on your machine:

  1. Node.js: We use Node to run a development web server and build the project. Depending on your system, you can install Node either from source or as a pre-packaged bundle. A verified working version of Node required is 16.18.1, although higher versions might work as well.

After installing Node, you should be able to run the following command to install development tools. You will only need to run this command when dependencies change in package.json.

npm install
npm run start

The npm run command will list all of the scripts available to run for this project.

  1. eTutor++-Objects: Objects common to different service of the etutor++ ecosystem are maintained in the objects-project. To run a service depending on this project (like this one), you have to clone the repository and build the project with Maven:
git clone  https://github.com/eTutor-plus-plus/objects
cd objects
mvn clean install

Alternatively, you could donwload the latest jar from the github action workflows in the repository of the objects-project. Click on the latest workflow and then on artifacts to do so. However, it would be required to install the jar into your local maven repository, so maybe installing it manually like described above is easier.

  1. Other dependencies include:

Setup

This application requires a PostgreSQL-database and a [Apache Jena Fuseki]() RDF graph database. Connection details can be configured in the properties. The easiest way to setup those locally is to use the local-deploy, you can start the databases with

docker-compose up -d postgres fuseki

from the root folder of the cloned local-deploy repository.

Alternative (outdated) approach

To spin-up the necessary databases in Docker containers with configurations matching the default development settings, execute this script. The script executes two commands:

docker-compose build
docker-compose up -d

The first command builds a custom image with an Apache Jena Fuseki server and the necessary configuration. The second command starts three containers:

  1. Fuseki
  2. PostgreSQL
  3. PGAdmin

The whole process may take some minutes, especially on first execution.

You can also manually start the required services or use the local-deploy project

Building for production

Packaging as jar

To build the final jar and optimize the etutorPlusPlus application for production, run:

./mvnw -Pprod clean verify

This will concatenate and minify the client CSS and JavaScript files. It will also modify index.html so it references these new files. To ensure everything worked, run:

java -jar target/*.jar

Then navigate to http://localhost:8080 in your browser.

Refer to Using JHipster in production for more details. After building for production, delete the /target-folder if you want to proceed developing locally.

Updating

This section describes relevant update-procedures for components of the etutorplusplus.

Apache Jena Fuseki

To update the RDF-database, you have to backup the data, start the new Fuseki-server using the configuration file with the following command:

fuseki-server --config config_etutor_fulltext.ttl

Afterwards, navigate to localhost:3030 and add the backup file to the /etutorpp-database.

Refer to this official documentation on how to control a Fuseki server with HTTP requests.

JHipster

To update JHipster, install the JHipster-Client with

npm install -g jhipster

Then, copy your local repository for safety reasons, and after commiting all changes, execute the following command in the root of the project:

jhipster upgrade

This will create a new JHipster-application in a branch that diverges from your current branch and integrate the etutorplusplus, which will require solving various merge conflicts.

PostgreSQL

pgupgrade