Friends of OpenJDK Today

beetRoot: Yet Another Web Framework?

July 02, 2024

Author(s)

  • Avatar photo
    Michael Gasche

    Michael has worked as a software engineer, project manager, consultant and CEO and has over 20 years of experience in the Java world. He decided to develop his own toolset ... Learn more

Over the years, I have struggled with various Java web development frameworks and they all have their weaknesses and strengths.

A few years ago, I evaluated around 10 of these frameworks for a project for a Swedish company. Nothing really impressed me at the time.

It was only later that SpringBoot came along, which seemed to fulfill all the requirements and there was actually very little to criticize about it. Then came microservices such as Quarkus or Micronaut, which are often compiled into native code for small web service applications, but which can then rarely be embedded in a more mature architecture.


The "Buts"

Something that has always bothered me is that with full-blown frameworks, the configuration layer of the components is too opaque and complicated and the web microservices don't really offer much out of the box.

So what I want is a fully-fledged, high-performance Java web development framework like those found in the PHP world (e.g. CakePHP, Laravel, etc.) and which already comes with ready-to-use components such as CSRF prevention, login with 2FA authentication, CRUD generator (based on the database model), compliant with other web containers such as Tomcat, Jetty and Oracle WebLogic as well as executable as a standalone web server, a simple web template engine, standard CRUD views and functions with automatic mapping of referential database integrities on the web masks, theme support, fallback mechanisms when loading web resources as well as full language management and some more features.


What is beetRoot?

beetRoot is a slim and rapid Java web development as well as a full & secure client-server framework ready to run.

It starts faster than a second and you get a set of working dependencies with the initial setup for the current release, a transparent and clear way to configure the framework and its components and the freedom to choose any web container or simply use the optimized and embedded web container from the start.

However, none of this prevents you from customizing the dependencies in the Maven pom.xml file itself.

The quick start setup is also effortless and very fast!

If you know CakePHP for web development, you'll like beetRoot. It is based on the same principles and comes with a full CRUD generator generating all views, the model specification and controllers (handlers in beetRoot's terminology) based on the database model! The client-server framework supports encrypted communication (SSL) as well as HTTP/HTTPS-tunneling, provides a file download and upload interface and it can be extended with own (distributed) modules.

beetRoot website after login

autumo beetRoot is open source (Apache License 2.0) and is now available in version 2.3.1. It also largely forms the basis for the product autumo ifaceX.


How to QuickStart?

Linux, macOS

Enter the following statements into your UNIX terminal:

VERSION=2.3.1
PACKAGE=autumo-beetRoot-$VERSION

curl -LO https://github.com/autumoswitzerland/autumo-beetroot/releases/download/v$VERSION/$PACKAGE.zip

unzip $PACKAGE.zip
rm $PACKAGE.zip

# Optional libraries to send emails (needed for password reset)
(cd $PACKAGE/lib && curl -LO https://repo1.maven.org/maven2/com/sun/activation/jakarta.activation/2.0.1/jakarta.activation-2.0.1.jar)
(cd $PACKAGE/lib && curl -LO https://repo1.maven.org/maven2/com/sun/mail/jakarta.mail/2.0.1/jakarta.mail-2.0.1.jar)

$PACKAGE/bin/beetroot.sh start

Windows

Enter the following statements into your Windows terminal or PowerShell:

SET VERSION=2.3.1
SET PACKAGE=autumo-beetRoot-%VERSION%

curl -LO https://github.com/autumoswitzerland/autumo-beetroot/releases/download/v%VERSION%/%PACKAGE%.zip

tar -xf %PACKAGE%.zip
del %PACKAGE%.zip

REM Optional libraries to send emails (needed for password reset)
cd %PACKAGE%/lib && curl -LO https://repo1.maven.org/maven2/com/sun/activation/jakarta.activation/2.0.1/jakarta.activation-2.0.1.jar && cd ..\..
cd %PACKAGE%/lib && curl -LO https://repo1.maven.org/maven2/com/sun/mail/jakarta.mail/2.0.1/jakarta.mail-2.0.1.jar && cd ..\..

%PACKAGE%\bin\beetroot.bat start

autumo beetRoot starting up:

beetRoot starting on console

Now go to http://localhost:8778 and log in:

  • Default user: admin
  • Default password: beetroot  


QuickStart Video

Take a look at the QuickStart Video if you want to play around with the framework.

Note: The video shows the old routing which has changed since the version 2.3.0; it is done now with a configuration file and the servlet API library no longer needs to be downloaded separately.

Quickstart Video


Full Feature List

The Web framework is shipped with the following features ready to use:

  • Language management
  • File up- and download
  • Full MIME types control
  • 2-Factor-Authentication
  • Extendable user settings
  • Password reset mechanism
  • SMS and phone call interfaces
  • Dark theme and theme support
  • Mailing inclusive mail templates
  • URL routing with language support
  • Argon2/PBKPD2 password encryption
  • File caching (resources and templates)
  • Easy to understand HTML template engine
  • HTTPS protocol and TLS for mail if configured
  • Bean support with transient and unique fields
  • User sessions are stored when servers are stopped
  • Entities can be served through the JSON REST API
  • Logging implementations other than log4j2 supported
  • Add, edit, view, list and delete functionality for entities
  • Full CRUD-Generator PLANT for views, models and handlers
  • Optimized console logging with colored sections (if required)
  • One-to-many database relationships are fully applied in MVC layers
  • User roles & access control on controller level and within templates
  • Tested on Apache Tomcat 9, Eclipse Jetty 10 and Oracle Weblogic 14
  • Standard CSRF mechanism as well as obfuscated CRUD IDs within HTTP requests
  • Database connection pooling (HikariCP, with internal and external JNDI data sources)
  • Runs stand-alone as well as in common servlet containers such as Apache Tomcat and Jetty on URL root path as well behind a servlet-path without modifications of HTML templates, etc.
  • Secure client-server communication, if beetRoot is installed in a servlet container apart from beetRoot server and if there's need for such communication to steer backend processes
  • Hierarchical resource loader; e.g. German language requested, if not found, use configured default language, then use no language at all; "lookup till you find something usable" is the
    algorithm for everything. As well, load resources from file system (first), then as a resource within packages (jar, war) if not found beforehand.
  • And some more stuff...  


Outlook r3.0.0

  • Language translations within web templates (in addition to language directories with resources, the translation concepts can be mixed!)
  • Authorizarion: extended user role concept with multiple assignable roles
  • Treatment of many-2-many relationships at model level
  • Redesign of the user interface (selective Bootstrap integration)
  • Web templates: Authorization extension (roles, entities, actions)
  • General improvements
  • GA release


Links

Enjoy!


Related Articles

View All

Author(s)

  • Avatar photo
    Michael Gasche

    Michael has worked as a software engineer, project manager, consultant and CEO and has over 20 years of experience in the Java world. He decided to develop his own toolset ... Learn more

Comments (0)

Your email address will not be published. Required fields are marked *

Highlight your code snippets using [code lang="language name"] shortcode. Just insert your code between opening and closing tag: [code lang="java"] code [/code]. Or specify another language.

Save my name, email, and website in this browser for the next time I comment.

Subscribe to foojay updates:

https://foojay.io/feed/
Copied to the clipboard