Skip to content

melloware/quarkus-primereact

Repository files navigation

Quarkus PrimeReact


License: MIT Actions CI Quarkus React.js Typescript

If you like this project, please consider supporting me ❤️

GitHub Sponsor PayPal

This monorepo is a minimal CRUD service exposing a couple of endpoints over REST, with a front-end based on React so you can play with it from your browser.

While the code is surprisingly simple, under the hood this is using:

Requirements

To compile and run this demo you will need:

  • JDK 17+
  • Apache Maven

Code Generation

This project uses Orval to generate the TanStack Query client Typescript from the OpenAPI definition.

Code Generation

Developing

Live coding with Quarkus

The Maven Quarkus plugin provides a development mode that supports live coding. To try this out:

$ ./mvnw quarkus:dev

Watch as it starts up a temporary PostreSQL database just for this session. In this mode you can make changes to the code and have the changes immediately applied, by just refreshing your browser.

💡 Hot reload works add a new REST endpoint and see it update in realtime. Try it!

Now open your web browser to http://localhost:8080/ to see it in action.

Quarkus Monorepo

Building

Run Quarkus PrimeReact in JVM mode

When you're done iterating in developer mode, you can run the application as a conventional jar file.

First compile it:

$ ./mvnw clean package

Then run it with:

$ java -jar ./target/quarkus-app/quarkus-run.jar

Or build it as a single executable JAR file (known as an uber-jar):

$ ./mvnw clean package -Dquarkus.package.type=uber-jar

Then run it with:

$ java -jar ./target/quarkus-primereact-{version}-runner.jar

Navigate to: http://localhost:8080/

Run Quarkus PrimeReact in Docker

You can easily build a Docker image of this application with the following command:

$ ./mvnw -Pdocker

You will be able to run this binary directly where ${version} is the current project version:

$ docker run -i --rm -p 8000:8000 melloware/quarkus-primereact:latest

💡 Now observe the time it took to boot, and remember: that time was mostly spent to generate the tables in your database and import the initial data.

See it in your browser

Navigate to: http://localhost:8080/index.html