Giter VIP home page Giter VIP logo

bentolor / microframeworks-showcase Goto Github PK

View Code? Open in Web Editor NEW
29.0 5.0 3.0 30.92 MB

A simple grocery list webapplication implemented with the Microframeworks Spark Java, Jodd, Ninja, Javalite, Pippo and Ratpack

Home Page: https://bentolor.github.io/microframeworks-showcase/

License: Apache License 2.0

Java 78.30% CSS 0.05% HTML 11.46% Shell 0.84% Groovy 9.36%
jodd gradle ninja ratpack java spark demo-application intellij micro-framework javalite

microframeworks-showcase's Introduction

Purpose of this project

This Java/Gradle based repository illustrates a selection of Java-based microframeworks.

It implements a functionally identical grocery list application with Spark, Ninja, Ratpack, Jodd, Pippo, JavaLite, and a few others.

It was originally meant as supplement for my article on heise developer online (german) but is also the basis for my talk Schlank in den Service: Der große Java-Microframework-Test! on the Javaland conference 2018.

Grocery list overview Grocery list edit

Prerequisites Build Status

  • Installed JDK 8+ with proper set JAVA_HOME environment variable

This repository comes with a pre-bundled Gradle Wrapper gradlew or gradlew.bat (Windows) which will download the appropriate build dependencies automatically on the first run.

Optional (recommended for development):

  • Gradle 4.5+
  • Lombok Plugin for your IDE of choice (Guide: IDEA, Eclipse, …)
  • IntelliJ IDEA (preferably Ultimate Edition for full Framework support)

Spark Java

Spark Logo

Spark is a tiny Sinatra inspired framework for creating web applications in Java 8 with minimal effort

Starting the demo application

Option #1: Using Gradle

Run the demo with gradle :spark:run and access http://localhost:8080/

Option #2: Using IntelliJ IDEA

Open the project using IntelliJ IDEA Ultimate and execute the Spark: Run Example run configuration.

Option #3: As standalone JAR

Let gradle build the all-in-one UberJAR and directly execute it with Java (preferrably in the spark/ directory to leverage from the example grocerylists.json.

 gradlew :spark:shadowJar
 cd spark
 java -jar build/libs/spark-1.0-SNAPSHOT-all.jar

Ninja

Ninja Logo

Ninja is a opinionated, full stack framework including dependency injection, a optimized development mode and support for relational DBs.

Starting the demo application

Option #1: Using Gradle

Run the demo with gradle :ninja:run and access http://localhost:8080/ and http://localhost:8080/hello

Option #2: Using IntelliJ IDEA

Open the project using IntelliJ IDEA and execute the Ninja: Run Example run configuration.

Option #3: As standalone JAR

Let gradle build the all-in-one UberJAR and directly execute it with Java (preferrably in the ninja/ directory to leverage from the example grocerylists.json.

 gradlew :ninja:shadowJar
 cd ninja
 java -jar build/libs/ninja-1.0-SNAPSHOT-all.jar

Ratpack

Ratpack Logo

Ratpack is a reactive-oriented, type-safe microframework heavily based on Java 8 lambdas and Netty for non-blocking IO.

Starting the demo application

Option #1: Using Gradle

Run the demo with gradle :ratpack:run and access http://localhost:8080/.

Option #2: Using IntelliJ IDEA

Open the project using IntelliJ IDEA and execute the Ninja: Run Example run configuration. ``

Option #3: As standalone JAR

Let gradle build the all-in-one UberJAR and directly execute it with Java (preferrably in the ratpack/ directory to leverage from the example grocerylists.json.

 gradlew :ratpack:shadowJar
 cd ratpack
 java -jar build/libs/ratpack-1.0-SNAPSHOT-all.jar      

Jodd

Jodd Logo

Jodd is set of Java micro frameworks, tools and utilities, under 1.7 MB. The framework consists of micro components, which can be used more or less independently.

Starting the demo application

Option #1: Using Gradle

Run the demo with gradle :jodd:run and access http://localhost:8080/.

Option #2: Using IntelliJ IDEA

Open the project using IntelliJ IDEA and execute the Jodd: Run Example run configuration. Jodd by default has no embedded servlet container bundled. The example includes and configures a Undertow server as embedded server.

Option #3: As deployable WAR

This module originally did not provide an all-in-one UberJAR. Follow these steps to build a WAR file:

 gradlew :jodd:war
 cp jodd/build/libs/jodd-1.0-SNAPSHOT.war [tomcat]/webapps

Option #4: Using a Jetty ctonainer

Run the demo with gradle :jodd:jettyRun and access http://localhost:8080/jodd/.

Pippo

 ____  ____  ____  ____  _____
(  _ \(_  _)(  _ \(  _ \(  _  )
 ) __/ _)(_  ) __/ ) __/ )(_)( 
(__)  (____)(__)  (__)  (_____)

Pippo is set of Java micro framework in the spirit of Sinatra but also offers a Controller-based approach. The core is small (around 140 KB) and can be extended with various modules for template engine or embedded web servers.

Starting the demo application

Option #1: Using Gradle

Run the demo with gradle :pippo:run and access http://localhost:8080/.

Option #2: Using IntelliJ IDEA

Open the project using IntelliJ IDEA and execute the Pippo: Run Example run configuration.

Option #3: As standalone JAR

Let gradle build the all-in-one UberJAR and directly execute it with Java (preferrably in the pippo/ directory to leverage from the example grocerylists.json.

 gradlew :pippo:shadowJar
 cd pippo
 java -jar build/libs/pippo-1.0-SNAPSHOT-all.jar      

Spring Boot 2 – Spring 5 – WebFlux

Spring Logo

Spring Boot favors convention over configuration and is designed to get you up and running as quickly as possible. Spring WebFlux is the reactive successor of Spring MVC and a is fully non-blocking, back pressure-supporting web framework.

Starting the demo application

Option #1: Using Gradle

Run the demo with gradle :spring5:run and access http://localhost:8080/.

Option #2: Using IntelliJ IDEA

Open the project using IntelliJ IDEA and execute the Spring 5: Run Example run configuration. Potentially this requires IDEA Ultimate Edition.

Option #3: As standalone JAR

Let gradle build the all-in-one UberJAR and directly execute it with Java (preferrably in the spring5/ directory to leverage from the example grocerylists.json.

 gradlew :spring5:shadowJar
 cd spring5
 java -jar build/libs/spring5-1.0-SNAPSHOT-all.jar      

Developing hints

This project uses Gradle 4.6+ as build tool and IDEA IntelliJ inspections together with my idea-cli-inspector tool for quality assurance.

The great Travis CI service acts as CI service executing Tests and IDEA inpsection.

If you want to perform the IDEA Inspections within your own IDE:

  • Select Analyze > Inspect Code …
  • The select Custom Scope: "Showcase Sources" & include test sources
  • As inspection profile exxcellent-2017 should be preselected.

microframeworks-showcase's People

Contributors

bentolor avatar jhult avatar moh-sushi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.