Git Product home page Git Product logo

klite's Introduction

Klite

Build & Test

A very light-weight (lite) non-blocking http framework for Kotlin coroutines.

Inspired by SparkJava, Jooby, etc, but smaller, simpler and better.

Goals

  • Proper Kotlin coroutine support with working before/after filters for e.g. transactions and logging
  • Minimal amount of code
    • Simple to maintain & change
    • Performance is also important, but simplicity is preferred
  • Zero dependencies - Java built-in jdk.httpserver is used under the hood
    • Perfect for microservices
    • But still possible to replace with something else
  • 12-factor apps by default
  • Most behaviour can be overridden if necessary
  • Both route builder and annotated classes
  • Very easy to do simple things, e.g. @GET suspend fun route() = provider.fetchData()

Dependencies

  • Java 6+ built-in non-blocking jdk.httpserver
  • Re-routable Java 9+ System.Logger

Modules

  • server - the main server module. See it's docs. Zero external dependencies.
  • jackson - adds json parsing/rendering using Jackson
  • slf4j - redirects server logs to slf4j and configures it
  • jdbc - provides jdbc extensions and transaction handling (depends on slf4j because of Hikari)
  • jdbc-test - provides a way of testing your DB code using a real DB

Usage

See sample subproject on how to build apps with Klite and run them in Docker.

Release

Klite builds are available from jitpack:

  repositories {
    mavenCentral()
    maven { url = uri("https://jitpack.io") }
  }

  dependencies {
    val kliteVersion = "master-SNAPSHOT" // you can put a released tag or commit hash here
    implementation("com.github.angryziber.klite:server:$kliteVersion")
    implementation("com.github.angryziber.klite:jackson:$kliteVersion")
    implementation("com.github.angryziber.klite:jdbc:$kliteVersion")
    testImplementation("com.github.angryziber.klite:jdbc-test:$kliteVersion")
    ...
  }

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.