Skip to content

hbz/nwbio

 
 

Repository files navigation

nwbio

This is a prototype based on lobid-gnd-ui.

Build

Prerequisites

  • Git, install with e.g.: sudo apt install git-all
  • Java 21, install with e.g.: sudo apt install openjdk-21-jdk
  • Get the code repo: git clone https://github.com/hbz/nwbio.git
  • Change into the repo directory: cd nwbio
  • Make the Gradle wrapper executable: chmod u+x ./gradlew

Start server

To start the local server, run:

./gradlew bootRun

The server should be running at http://localhost:8080/gnd.

Run checks

To run all automated tests, compiler and formatter checks:

./gradlew check

The tests use JUnit Jupiter with AssertJ and HtmlUnit. The Gradle build is configured to fail on Java compiler errors. The formatter checks are based on Spotless, which is configured in the Gradle build file (build.gradle).

The check task runs in our CI setup, so any new code must pass those checks (i.e. when contributing new code make sure ./gradlew check is successful, if required apply all Spotless formatter rules with ./gradlew spotlessApply).

Backend development

For local development, we want to be able to test code changes without restarting the server.

For backend hot-deployment, in a separate terminal, run:

./gradlew --continuous bootJar

With this, changes to the Java backend code are visible at http://localhost:8080/gnd after a browser reload.

Frontend development

To see changes to the HTML/JS/CSS frontend code without a browser reload, we can run a WebPack DevServer in another terminal. Prerequisite: Node.js 22 (install e.g. via NVM: nvm install 22 ; nvm use 22)

Install dependencies (initially, and after changes to package.json):

npm install

Start the DevServer:

npm run devserver

The application with live reloading is now accessible at http://localhost:8081/gnd.

Production deployment

Build the application:

./gradlew clean bootJar

Start, stop, restart, or check status of the service:

sudo systemctl start|stop|restart|status nwbio

Production setup

Initial service setup (required only once):

sudo ln -sr build/libs/nwbio-0.0.1-SNAPSHOT.jar /opt/nwbio.jar
sudo ln -sr nwbio.service /etc/systemd/system/nwbio.service
sudo systemctl daemon-reload

For debugging etc. start the application manually:

java -Dspring.profiles.active=production -jar ./build/libs/nwbio-0.0.1-SNAPSHOT.jar

The server should be running at http://localhost:8080/gnd.

Reference manuals

About

Biographisches Portal NRW (early work in progress based on lobid-gnd)

Resources

Stars

Watchers

Forks

Contributors

Languages