- Java 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .mvn/wrapper | ||
| postman | ||
| src | ||
| .gitignore | ||
| mvnw | ||
| mvnw.cmd | ||
| pmd-ruleset.xml | ||
| pom.xml | ||
| README.md | ||
| Taskfile.yml | ||
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/tagsGET /api/articlesGET /api/articles/{slug}GET /api/articles/{slug}/commentsGET /api/profiles/{username}GET /api/actuator/healthGET /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.