Skip to content

mzlnk/javalin-xt

Repository files navigation

javalin-xt

Licence: Apache 2.0 Open Source Javalin Kotlin Java Gradle

Version Build Code coverage

About 🌐

javalin-xt is a very lightweight set of extension features dedicated to Javalin.

Key concepts

Key concepts of javalin-xt include:

▶ Lightweight

Designed to be as lightweight as possible. It does not introduce any additional dependencies to your project. Just the most basic and useful features that can enhance working with Javalin.

▶ No reflection

No use of reflection in its features. Everything is done at compile time.

▶ Not over-engineered

No heavy use of proxies, annotations, or other complex mechanisms under the hood. Everything is kept simple in order to make any potential debugging or troubleshooting easier.

▶ Invisible

Can be considered as an extension to Javalin. Using it, you can still use Javalin as you would normally do, but with the added benefit of javalin-xt features accessible via Javalin app.

▶ Dedicated to Javalin

Specifically designed to work with Javalin which allows for a more streamlined and efficient integration.

Key features

Feature Description
Dependency injection Simple and lightweight dependency injection (DI) framework that uses no reflection.
Application properties Simple engine to read and access application properties in a Spring Boot-like way via application.yml stored in your resources.
Declarative routing Simple way to define routes in a declarative way using minimized set of annotations and no reflection

Notes 📄

Currently, javalin-xt is still in development 🚧. Therefore:

  • Kotlin support only (support for Java is planned in the future)
  • Some features may have limited functionality
  • Gradle support only

Quickstart 🚀

Installation 🔧

Gradle

plugins {
    id("io.mzlnk:javalin-xt") version "1.0.0"
}

Maven

To be announced soon.

Enabling javalin-xt 🔓

To enable javalin-xt, you just need to invoke dedicated method on JavalinConfig instance during Javalin creation. For example:

fun main(args: Array<String>) {
    val app = Javalin.create { config ->
        // enables IoC container and dependency injection
        config.enableIoC()
        // enables application properties engine
        config.enableApplicationProperties { propertiesConfig ->
            propertiesConfig.profile = "dev"
        }
    }

    // registers declaratively defined endpoint
    app.registerEndpoint(SampleEndpoint())

    app.start(8080)
}

Explore javalin-xt features 🎯

Now you can start exploring javalin-xt features. All the features are described in details in the Wiki section:

Examples 📂

There are example project using different build tools available in the examples directory.

License 🎫

javalin-xt is licensed under the Apache License, Version 2.0. See LICENSE for more information.

Contributing 💪

Contributions are welcome! Please see CONTRIBUTING for more information.

Authors ⚗️

javalin-xt is developed by: