Skip to content

evgenii-shcherbakov/knest

Repository files navigation

KNest Logo

A progressive Kotlin framework based on Ktor and modeled after NestJS for building efficient and scalable server-side applications.

JitPack version Maven Central version Package License

Description

KNest is a framework for building efficient, scalable Kotlin server-side applications. It combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).

Under the hood, KNest makes use of Ktor, allowing for easy use of the myriad third-party plugins which are available.

Philosophy

This framework aims to combine the ability to write as beautifully as in NestJS, combine convenient approaches from Spring Boot and at the same time use fast and lightweight Ktor on Kotlin under the hood.

Getting started

  • Create new Ktor Server application
  • Add framework dependency to ktor app build.gradle.kts
dependencies {
    // ...
    implementation('io.github.evgenii-shcherbakov:knest:0.1.0')
}
  • Install and configure KNest plugin to your application
package com.example

import io.github.evgenii_shcherbakov.knest.KNest
import io.ktor.http.*
import io.ktor.server.netty.EngineMain
import io.ktor.server.application.*
import com.example.controllers.MainController

fun main(args: Array<String>): Unit = EngineMain.main(args)

fun Application.module() {
    install(KNest) {
        setControllers(MainController())
    }
}

You can see more examples how to use it in preview module.

License

KNest is MIT licensed.