opensourcesdc / realworld-spring-boot-native

Realworld backend with spring boot compiled to native binary

Home Page:https://realworld.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RealWorld Example App

Java 17 + Spring Boot 3 + Native image codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

This codebase was created to demonstrate a fully fledged fullstack application built with Java 17 + Spring Boot 3 running as a native application including CRUD operations, authentication, routing, pagination, and more.

This application is based on Java 17 + Spring Boot 3 Real world application with changes made only to make it working as a native application

Note: You just need to have JDK 17 installed.

Note: If permission denied occurs when running the gradle task, enter chmod +x gradlew to grant the permission.

Install GraalVM distribution with sdkman

sdk install java 22.3.2.r17-nik
sdk use java 22.3.2.r17-nik

Build application

./gradlew build

Run application with native-image-agent attached to collect reachability metadata

java -agentlib:native-image-agent=config-output-dir=./aot/META-INF/native-image/,experimental-class-define-support -Dspring.aot.enabled=true -jar ./build/libs/realworld.jar

In second terminal window run api integration tests

./api/run-api-tests.sh

Close previously run application with native-image-agent

Build native image

./gradlew nativeCompile

Run the application

./build/native/nativeCompile/realworld 

About

Realworld backend with spring boot compiled to native binary

https://realworld.io

License:MIT License


Languages

Language:Java 97.7%Language:Kotlin 1.9%Language:Shell 0.4%