Skip to content
 
 

Repository files navigation

Jeamlit 🚡

Welcome!

What is Jeamlit ?

Jeamlit is a Java lightning fast data app development framework, heavily inspired by (drumroll… 🥁) Streamlit!

Jeamlit makes it dead simple to create data apps in minutes. Build dashboards, back-offices, generate reports, showcase APIS, etc...
The best part? You can run your Jeamlit app standalone, or embed it right into your existing Java project.

Jeamlit demo app

Not convinced? It's ok. Read the Oh No! Another high-level framework and Shouldn't I use Streamlit? sections.

Install

Jeamlit requires A Java JDK >= 21.

There are 2 main ways to install and run Jeamlit:

  • as a standalone CLI and app runner
  • embedded in an existing Java project

You'll find a short version below. Read the doc to get more details for each method.

Standalone

  1. Install the CLI (JBang is highly recommended)
    # recommended: install with jbang
    jbang app install io.jeamlit:jeamlit:0.44.0:all
    
    # vanilla
    curl -L -o jeamlit.jar https://repo1.maven.org/maven2/io/jeamlit/jeamlit/0.44.0/jeamlit-0.44.0-all.jar
  2. Validate the installation by running the Hello app:
    # jbang
    jeamlit hello
    
    # vanilla
    java -jar jeamlit.jar hello
  3. Play with the Hello World!
  4. Want to see a fancier app ?
    jeamlit run https://raw.githubusercontent.com/jeamlit/jeamlit/main/examples/getting_started/App.java

Find more details in the standalone installation doc. Don't forget to install the JBang IDE plugin for completion and highlighting!

Once you're ready to go further, look at the fundamental concepts or jump straight into creating your first app.

Embedded server

  1. Add the dependency to your project
    <dependency>
        <groupId>io.jeamlit</groupId>
        <artifactId>jeamlit</artifactId>
        <version>0.44.0</version>
    </dependency>
  2. Launch the server in your project
    void startJeamlitServer() {
     // the Jeamlit webapp class
     class MyApp {
       public static void main(String[] args) {
         Jt.text("Hello World").use();
         }
       }
     
       // prepare a Jeamlit server
       var server = Server.builder(MyApp.class, 8888).build();
     
      // start the server - this is non-blocking, user thread
      server.start();
    }

Find more details in the embedded installation doc. Don't forget to look at the IDE hot-reload setup!

Once you're ready to go further, look at the fundamental concepts or jump straight into creating your first app.

Quickstart

Create a new file named App.java in your project directory with the following code:

import io.jeamlit.core.Jt;

public class App { 
    public static void main(String[] args) {
        int x = Jt.slider("Select a value").use().intValue();
        Jt.markdown("## `%s` squared is `%s`".formatted(x, x*x)).use();
      }
}

Run it:

jeamlit run App.java

Jeamlit x squared demo

Want more ? look at the fundamental concepts, jump straight into creating your first app.
Not ambitious enough? Create a LangChain4J AI multipage app.

Oh, No! Another high-level framework

Jeamlit is not another abstraction layer that hides the HTML/CSS/Javascript. That alone is not enough to significantly improve productivity. The real pain is in bindings: handling events, reacting to changes, passing messages, parsing results... you get it.

Jeamlit promise is to remove all of that.

Here is an example:

double size = Jt.slider("How tall are you ? in cm").max(220).use();
if (size > 200) {
    Jt.text("Damn, that huge!").use();
}

That's it. That's the entire webapp code. Move the slider, and the size variable immediately reflects the latest frontend value. What's the execution order then ? Top-to-bottom. Every time something changes in the app, the logic re-runs from top to bottom, using the most up-to-date values from the frontend.

We hope this sparks your curiosity!

By the way, once you have jeamlit installed, you can run this example with

jeamlit run https://raw.githubusercontent.com/jeamlit/jeamlit/refs/heads/main/examples/readme/App.java 

Shouldn't I use Streamlit?

Jeamlit:

  • is Java-native
  • can be embedded directly into your existing Java project.

If neither of those points matters to you... well, farewell. You should use Streamlit.
If you're still there: thanks. There are plenty of smaller differences that make Jeamlit worth a try: simpler state management, easier custom components, and more.

Contribute

Really? Thanks for you interest in improving Jeamlit! 🚡
To start a discussion, open an issue or a thread in the forum.
For development, see DEVELOPMENT.md.

License

Jeamlit is free and open-source, licensed under the Apache 2.0 license.

About

The simplest way to build data apps and webapps in Java. Inspired by Streamlit.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages