Skip to content

drighart/WebTool

Repository files navigation

Welcome to WebTool

WebTool is a new tool to setup and edit your website (in only 5 minutes) written in Java and Javascript. This is one of the goals of this project. The other goal is to create a Core which can be used to create micro-services. Due to its pluggable components it is easy to extend. The core is also an integration of several powerfull Java frameworks, like Jetty, Angular, RestEasy, Jackson, H2, JDbi, Appache Commons and security (JAAS). When I start to create a new web-application, it always costs me a lot of time to find and integrate these frameworks.

This is also free-of-anything and is delivered with the MIT-license. Hopefully, you will enjoy WebTool and if you are interested, help me to improve it! Please, click ⭐ (on top of the screen) to star the project or fork this project.

Build and run

If you have installed Maven and Java, please execute the follow command from the parent directory.

mvn clean install -DskipTests

After you build the project, the folder distribution is created. Go to this folder and start WebTool with the following command:

java -jar webtool.jar

The application will start and will create more folders like: data, logs and configuration. After the database is created and the webserver is started, open a browser and go to http://localhost:8080

Architecture

This project contains several plugins which are loaded during startup. New plugins can be made and attached to extend the system.

The following frameworks are used in WebTool:

Name Description Link
Logback Ultra fast logging framework https://github.com/qos-ch/logback
Appache Commons CLI Library for command line interfaces https://github.com/apache/commons-cli
Appache Commons IO Library for additional IO https://github.com/apache/commons-io
Appache Commons Lang Lang provides a host of helper utilities for the java.lang API https://github.com/apache/commons-lang
Jackson The standard JSON library for Java (or JVM platform in general), or, as the "best JSON parser for Java". Or simply as "JSON for Java" https://github.com/FasterXML/jackson
H2 DB A very fast Java SQL database http://www.h2database.com
RestEasy JBoss framework for developing client and server RESTful applications and services in Java https://github.com/resteasy/Resteasy
PF4J Plugin Framework for Java https://github.com/decebals/pf4j
jDBI jDBI provides a convenience interface for SQL operations in Java https://github.com/jdbi/jdbi
Angular Angular is a development platform for building mobile and desktop web applications https://github.com/angular/angular
Jetty Jetty is a lightweight highly scalable java based web server and servlet engine https://github.com/eclipse/jetty.project

WebTool Core provides several services to the developer, like:

  • PF4J makes it possible to build your microservice or application with plugins or modules. This pushes the developer to think about the modularization of the software. The plugins can be replaced easily by replacing them in a folder. The plugin system is not as advanced as OSGI and the plugins can NOT be replaced or turned on or off during runtime. However the API between the core and the plugins makes a really nice distinction between the plugins.
  • Implementing a REST service with annotations and making this REST service connect to the H2 database. The REST service is by default form-based secured (JAAS).
  • The Dashboard- and App-theme-plugin of WebTool are build with Angular and Bootstrap which can be extended easily. Especially the Dashboard-plugin can be used as template for further development. Due to the plugin-system it is possible to create multiple GUI's.
  • The core contains an overview of REST services that are registered which can be retrieved with the url http://localhost:8080/rest/services/overview
  • The core is packaged as one jar which can be distributed easily (no jar-hell). The distribution contains only the core-jar and the plugin-jars in the plugins-folder.
  • The core and plugins contain a data-update mechanism. This mechanism makes it possible to distribute version 1 of the database and make changes in the data-model. When version 2 is distributed, the provided migration-script will automatically update the database.
  • The database and webserver are embedded in the application. This is a disadvantage and advantage! For small applications this is not a problem. If you want to make bigger applications, please use an external database and connect it with JDBC. Java Core runs on 1 CPU Core (because the JVM runs on 1 core and everthing is embedded in one jar) and therefor the microservice itself is not scalable! If you create a microservice, always make it stateless.
  • The Jetty webserver provides many functionalities out-of-the-box, like security, http/https support and support to create servlets. It's nasty to configure it and make it all work together. So, we did the configuration for you and made the interesting configuration available in a configuration file.
  • The core provides a health status rest service which can be monitored by an external monitoring application. You can extend this health service and notify the external monitoring application that something is wrong with your microservice or application. The health status can be retrieved on url http://localhost:8080/rest/unsecured/health

So, hopefully, the points above will make it attractive for developers to create there own microservices and web-applications without integrating those nice frameworks! It runs all out-of-the-box.

I created WebTool as an application to edit and setup websites. In this way I was able to have a real use-case to work on, and knew which functionality was really needed in the core.

WebTool

When you started the application, go to url http://localhost:8080 You will see the setup-screen:

Setup with WebTool

Setup with WebTool

After you logged in, you are able to enter content for your website:

Setup with WebTool

And after 5 minutes dragging and uploading images and entering content, you can display your website in the browser:

Setup with WebTool

The website is made with Bootstrap and Angular and is fully mobile. The background image / fonts and colors can be configured.

##Contribute You are most welcome to contribute to WebTool!