Renarde renarde head Web Framework - Getting Started

Renarde

Renarde renarde head is a server-side Web Framework based on Quarkus, Qute, Hibernate and Quarkus REST.

<dependency>
  <groupId>io.quarkiverse.renarde</groupId>
  <artifactId>quarkus-renarde</artifactId>
  <version>3.0.19</version>
</dependency>

First: an example

Let’s see how you can quickly build a Web Application with Renarde. Let’s start with a Controller:

package rest;

import jakarta.ws.rs.Path;

import io.quarkus.qute.CheckedTemplate;
import io.quarkus.qute.TemplateInstance;
import io.quarkiverse.renarde.Controller;

public class Application extends Controller {

    @CheckedTemplate
    static class Templates {
        public static native TemplateInstance index();
    }

    @Path("/")
    public TemplateInstance index() {
        return Templates.index();
    }
}

A Controller is the logic class that binds URIs to actions and views. They are almost like regular JAX-RS endpoints, but you opt-in to special magic by extending the Controller class, which gives you nice methods, but also super friendly behaviour.

In this Controller we declare a Qute template, and map the / to it.

We can then define the main page in src/main/resources/templates/Application/index.html:

<!DOCTYPE html>
<html lang="en">
  <body>
    Hello, World!
  </body>
</html>

Now if you navigate to your application at http://localhost:8080 you will see Hello, World! rendered.