Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ralph Schaer 3ecf26143e upgrade
2026-09-12 13:48:30 +02:00
.mvn/wrapper upgrade 2026-05-31 15:52:29 +02:00
postman Harden and complete the RealWorld API 2026-09-05 06:29:44 +02:00
src Harden and complete the RealWorld API 2026-09-05 06:29:44 +02:00
.gitignore Upgrade to Spring Boot 3 2022-11-25 05:24:36 +01:00
mvnw Upgrade 2025-07-26 12:54:12 +02:00
mvnw.cmd Upgrade 2025-07-26 12:54:12 +02:00
pmd-ruleset.xml Upgrade postman, add format plugins, add PMD linter 2026-04-30 09:03:19 +02:00
pom.xml upgrade 2026-09-12 13:48:30 +02:00
README.md Harden and complete the RealWorld API 2026-09-05 06:29:44 +02:00
Taskfile.yml Refactor database records and DTOs for improved structure and consistency 2026-06-19 19:29:50 +02:00

RealWorld Spring Boot jOOQ

Spring Boot implementation of the RealWorld API.

This project is a fork of gothinkster/spring-boot-realworld-example-app that uses:

  • Spring Boot 4.1
  • Java 25
  • jOOQ for SQL access
  • Flyway for schema migration
  • H2 file database at ./db/test
  • JWT token authentication
  • Spring Boot Actuator health/info endpoints

The API is served under /api.

Requirements

  • JDK 25 or newer
  • Maven wrapper from this repository
  • Optional: Task for the shortcuts in Taskfile.yml
  • Optional: Node.js if you want to run the Postman/Newman collection

Run

./mvnw spring-boot:run

On Windows:

.\mvnw.cmd spring-boot:run

The application starts at http://localhost:8080/api.

Useful public endpoints:

  • GET /api/tags
  • GET /api/articles
  • GET /api/articles/{slug}
  • GET /api/articles/{slug}/comments
  • GET /api/profiles/{username}
  • GET /api/actuator/health
  • GET /api/actuator/info

Authenticated endpoints expect:

Authorization: Token <jwt>

JWTs expire after 24 hours. Set a private secret of at least 32 characters in deployed environments; the checked-in fallback is only for local development:

export JWT_SECRET='replace-this-with-a-long-random-secret'

Article list and feed responses omit article bodies, as required by the current RealWorld contract. Fetch an individual article to retrieve its body.

Build And Checks

./mvnw test # unit and HTTP integration tests
./mvnw -DskipTests compile
./mvnw -q pmd:check
./mvnw -q spring-javaformat:apply

With Task installed:

task compile
task lint
task format

Database And jOOQ

Flyway applies migrations from:

src/main/resources/db/migration

jOOQ classes are generated into:

src/main/java/ch/rasc/realworld/db

Regenerate them after changing migrations:

./mvnw -Pjooq generate-sources

API Collection

The postman directory contains a Newman runner:

cd postman
npm install
npm start

The collection expects the application to be running at http://localhost:8080/api.