Skip to content

sleepkqq/quarkus-jimmer-example

Repository files navigation

Quarkus + Jimmer Example

A modern REST API example built with Quarkus, Jimmer ORM, and quarkus-jimmer-extension in Kotlin.

Tech Stack

  • Quarkus 3.37.0 with virtual threads
  • Jimmer ORM 0.10.12 with KSP code generation
  • Kotlin 2.4.0
  • PostgreSQL with Liquibase migrations
  • GraalVM native image support
  • Testcontainers for integration tests

Project Structure

quarkus-jimmer-example-model/       # Entities, DTOs, repositories
  src/main/kotlin/.../entity/       # Jimmer @Entity interfaces
  src/main/kotlin/.../repository/   # KRepository interfaces
  src/main/dto/                     # Jimmer DTO definitions (.dto files)

quarkus-jimmer-example-service/     # REST API, services, config
  src/main/kotlin/.../resource/     # JAX-RS resources
  src/main/kotlin/.../service/      # Service layer with transactions
  src/main/resources/               # Application config, Liquibase changelogs
  src/test/                         # Integration tests with Testcontainers

Running

Prerequisites

  • Java 25+
  • Docker (for PostgreSQL)

Start PostgreSQL

docker run -d --name postgres -p 5432:5432 \
  -e POSTGRES_DB=quarkus_jimmer \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=postgres \
  postgres:18.4-alpine

Run in dev mode

./gradlew quarkusDev

Run tests

./gradlew test

Build container images

The Dockerfiles are runtime-only: they copy a prebuilt artifact from quarkus-jimmer-example-service/build/, so build the application first, then the image.

JVM (uber-jar):

./gradlew :quarkus-jimmer-example-service:build \
  -Dquarkus.package.jar.type=uber-jar -x test
docker build -f Dockerfile.jvm -t quarkus-jimmer-example:jvm \
  quarkus-jimmer-example-service/build

Native executable (GraalVM via Mandrel container):

./gradlew :quarkus-jimmer-example-service:build \
  -Dquarkus.native.enabled=true \
  -Dquarkus.package.jar.enabled=false \
  -Dquarkus.native.container-build=true \
  -x test
docker build -f Dockerfile.native -t quarkus-jimmer-example:native \
  quarkus-jimmer-example-service/build

CI

The Build & Push workflow (.github/workflows/native-build.yml) runs manually only (workflow_dispatch). It builds the JVM or native image, then pushes it to ghcr.io/<owner>/<repo>. Inputs: image tag, build mode (jvm / native), and an optional test run for the JVM mode.

API Endpoints

Method Path Description
GET /hello Health check
GET /authors List all authors
GET /authors/{id} Get author by ID
GET /books List all books
GET /books/{id} Get book by ID
POST /books Create a book
PUT /books/{id} Update a book
DELETE /books/{id} Delete a book

License

MIT

About

Example REST API with Quarkus + Jimmer ORM + Kotlin. Includes Liquibase migrations, Testcontainers, virtual threads, and GraalVM native image support.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages