Skip to content

Server Side Rendering example with React + React Router + Vite + GraalVM (JS) + Spring Boot

License

Notifications You must be signed in to change notification settings

making/ssr-react-spring-boot-graalvm-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Server Side Rendering example with React + React Router + Vite + GraalVM (JS) + Spring Boot

Demo: https://ssr-react-spring-boot-graalvm-js-demo.apps.ik.am

Note

The following assumes the use of GraalVM 21, but other than the creation of a native image, it should work with a different JDK (21) as well.

Please execute the following command to bundle the necessary JavaScript resources before running the application in an IDE.

./mvnw compile

How to run the local server

./mvnw spring-javaformat:apply spring-boot:run
curl -s http://localhost:8080/posts/1

How to run the UI only

cd ui
npm run dev

To develop the UI, you need to have the backend server (localhost:8080) running.

How to create an executable jar file

./mvnw package -DskipTests
java -jar target/ssr-react-spring-boot-graalvm-js-0.0.1-SNAPSHOT.jar 
curl -s http://localhost:8080/posts/1

How to create a native image

Make sure your JAVE_HOME points to GraalVM 21

./mvnw -Pnative native:compile -DskipTests
./target/ssr-react-spring-boot-graalvm-js --management.otlp.tracing.endpoint=https://httpbin.org/post
curl -s http://localhost:8080/posts/1

About

Server Side Rendering example with React + React Router + Vite + GraalVM (JS) + Spring Boot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published