DocsStart here

Start here

Installation

One starter brings Jaspring into your Spring Boot application. Your first live page is a few files away.

Browse documentation

Before you begin

Use Java 25 and Spring Boot 4.1.x. Oracle GraalVM 25.2.4 matches the bundled GraalJS runtime and enables optimized startup compilation. Other Java 25 distributions work with the interpreter and can start more slowly.

Your application does not need Node.js, npm, or Angular CLI. The Angular compiler and styling tools are already bundled in the framework. The optional Java-to-WebAssembly browser feature has additional build requirements, covered in Browser interop.

Add the Gradle dependency

Add Maven Central and the Jaspring starter to an existing Spring Boot application. Add Spring Boot’s WebSocket starter for the default live transport; without it, Jaspring uses HTTP.

build.gradle
repositories {
    mavenCentral()
}

dependencies {
    implementation 'dev.isira:jaspring-spring-boot-starter:0.2.0'
    implementation 'org.springframework.boot:spring-boot-starter-websocket'
}

tasks.named('bootRun') {
    jvmArgs '--enable-native-access=ALL-UNNAMED'
}

Using Maven

Use the same starter coordinates in your Spring Boot Maven project. Configure native access for the Java process that starts the application.

pom.xml
<dependency>
    <groupId>dev.isira</groupId>
    <artifactId>jaspring-spring-boot-starter</artifactId>
    <version>0.2.0</version>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-websocket</artifactId>
</dependency>

Create a component

Place the component under your @SpringBootApplication package so Jaspring can discover it. Here the package is com.example.components. These imports belong to Jaspring, including @Component.

src/main/java/com/example/components/CounterComponent.java
package com.example.components;

import dev.isira.jaspring.component.Component;
import dev.isira.jaspring.signals.Signals;
import dev.isira.jaspring.signals.WritableSignal;

@Component(selector = "app-counter", templateUrl = "counter.component.html")
public class CounterComponent {
    public final WritableSignal<Integer> count = Signals.signal(0);
}

Give it a template

Resources follow the component’s package. A relative templateUrl is resolved next to the class on the classpath.

src/main/resources/com/example/components/counter.component.html
<h1>Hello, Jaspring.</h1>
<button (click)="count.set(count() + 1)">Increment</button>
<p>Count: {{ count() }}</p>

Return it from a controller

JaspringView is a Spring MVC view. Return one from a controller, then start your app with ./gradlew bootRun and visit http://localhost:8080/.

HomeController.java
package com.example.controllers;

import com.example.components.CounterComponent;
import dev.isira.jaspring.boot.JaspringView;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class HomeController {
    @GetMapping("/")
    public JaspringView home() {
        return JaspringView.of(CounterComponent.class);
    }
}
Jaspring · release + master guidesRead the framework source