Skip to content

Latest commit

 

History

1,429 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java UI for Admin Panels and Realtime Web Apps

Welcome! This is a server-side Java UI toolkit for admin panels, internal tools, and live web applications. Components keep state and run event handlers on the server; the browser receives initial HTML and small DOM updates over WebSocket.

Admin UI demo

  • plain Java with constructor injection and no annotation-driven lifecycle;
  • typed component state, intents, context, and events;
  • no third-party runtime dependencies in the framework modules;
  • optional compositions, schema, authorization, dashboard, and agent modules.

Smallest Interactive Application

import rsp.component.ComponentView;
import rsp.component.definitions.LocalStateComponent;
import rsp.http.WebServer;

import static rsp.dsl.Html.*;

public final class Counter {
    private enum CounterIntent { INCREMENT }

    static void main(String[] args) {
        ComponentView<Integer, CounterIntent> view = intents -> state ->
                html(body(
                        h1("Current count: " + state),
                        button(on("click", _ -> intents.dispatch(CounterIntent.INCREMENT)),
                               text("Increment"))));

        WebServer server = new WebServer(8080, _ ->
                new LocalStateComponent<>((_, _) -> 0, view,
                        (state, intent) -> state + 1));
        server.start();
        server.join();
    }
}

The server renders the first page, the browser opens a WebSocket, and subsequent events run Java handlers that produce targeted DOM patches. Application state does not need to be duplicated in a JavaScript frontend.

Try The Repository

Requirements: Java 25 and Maven 3.8.7 or newer.

git clone https://github.com/vadimv/server-components.git
cd server-components
mvn clean install
mvn exec:java -pl examples -Dexec.mainClass=rsp.app.posts.CrudApp

Open http://localhost:8085 and select Sign in. The default agent is a deterministic local stub and requires no API key.

Documentation

Contributors

Languages