Skip to content

hbz/lobid-gnd-ui

Repository files navigation

lobid-gnd-ui

This is a prototype for a lobid-gnd UI implementation based on Spring Boot. It builds with Gradle and uses Thymeleaf, Bootstrap, and Webpack for the frontend. It is based on the reactive Spring WebFlux stack, using the functional/HTTP-oriented WebFlux.fn style. It fetches JSON data from the lobid-gnd API.

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/lobid-gnd-ui.git
  • Change into the repo directory: cd lobid-gnd-ui
  • 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/.

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/ 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 reloadiBoot: Reactive Web Applicationsng is now accessible at http://localhost:8081/.

Production deployment

Build the application:

./gradlew clean build

Start the application with the production profile:

java -Dspring.profiles.active=production -jar ./build/libs/lobid-gnd-ui-0.0.1-SNAPSHOT.jar

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

Reference manuals

About

Prototype for a lobid-gnd UI implementation based on Spring Boot and Thymeleaf

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published