Kbackend - A simple backend library for creating backends in Kotlin/Java

Overview

kbackend

A simple backend library for creating backends in Kotlin/Java

Setup

This project is based on Apache Maven. So you can clone the project and open the cloned directory in IntelliJ. It will take care of all the setup processes for you.

Example

data class Test(val name: String, val age: Int)

@Path("/animals")
@SuppressWarnings("unused")
class TestListener : Controller() {

    @GET("/dog")
    fun dog(request: Request, @Query("age") age: Int, @Query("name") name: String): Response = json(
        Test(name, age), headers = mapOf(
            Cookie.createCookie("test", "test")
        )
    )

    @GET("/cat")
    fun cat(request: Request): Response = redirect("https://google.com/")

    @POST("/parrot")
    fun parrot(request: Request): Response = json(Test(request.body, 1337))

    @GET("/parrot")
    fun parrotGet(request: Request): Response = json(Test(request.body, 17))

}

// Bootstrap
fun main() {
    val backend = BackendManager()

    backend.routing.lazyRoute("/") {
        plain("Hello World!")
    }

    backend.routing.initializeController(TestListener())

    backend.run(3000)
}
You might also like...
๐Ÿง™ Sharding backend infrastructure for Nino v2, handles as a sharding operator for Nino.

shibe ๐Ÿง™ Sharding backend infrastructure for Nino v2, handles as a sharding operator for Nino. Why? I feel like this was needed because I wanted to ke

Kotrlin Programming Language Cross-Platform Development which includes Android, iOS and Backend. Pretty much everwhere.
Kotrlin Programming Language Cross-Platform Development which includes Android, iOS and Backend. Pretty much everwhere.

Kotlin-Everywhere: Kotlin Programming Language Cross-Platform Development This is still a WIP but the idea is to create a tiny KOTLIN project that cou

Trawler - Trawler is a BaaS system. Backend as a service

Trawler is a BaaS system. Backend as a service. BaaS Generate REST and GraphQL f

Android login spring - Android login against spring backend

Android Jetpack Compose login implementation with JWT tokens against our own bac

A backend service that generates a random 32-chars length message and its sha256 hashcode and put them to DB
A backend service that generates a random 32-chars length message and its sha256 hashcode and put them to DB

This is an Android application in which a user can ask the server to generate a random message and its sha256, and ask to obtain this info from the server.

Android Note app that uses the "ktor-note-app" backend

KtorNoteApp Android Notes app that uses Ktor back end server Technologies employed: Kotlin MVVM Coroutines Custom REST API build with Ktor Responds to

This project acts as a backend to the zhi-dao android app

This project acts as backend to the Zhi-Dao android app (currently in progress) which is a restaurants guide app.

Backend API Server for CS-Broker ( ์†Œํ”„ํŠธ์›จ์–ด ๋งˆ์—์ŠคํŠธ๋กœ 13๊ธฐ - ํŒ€ ๋ชฌ์Šคํ…Œ๋ผ )
Backend API Server for CS-Broker ( ์†Œํ”„ํŠธ์›จ์–ด ๋งˆ์—์ŠคํŠธ๋กœ 13๊ธฐ - ํŒ€ ๋ชฌ์Šคํ…Œ๋ผ )

CS-Broker CS ๋ฌธ์ œ๋ฅผ ๊ณต๋ถ€ํ•˜๊ณ  ํ’€์ดํ•  ์ˆ˜ ์žˆ๋Š” CS Broker ์„œ๋น„์Šค๋ฅผ ์œ„ํ•œ ์„œ๋ฒ„์ž…๋‹ˆ๋‹ค. ์‚ฌ์šฉ ๊ธฐ์ˆ  Spring Boot, Kotlin, Gradle, JPA, Docker, Redis, MariaDB, AWS Infra Structure ์ปดํฌ๋„ŒํŠธ ๊ตฌ์„ฑ๋„ C

To-do-List - Creating a Reminders and Tasks app with Kotlin
To-do-List - Creating a Reminders and Tasks app with Kotlin

To do List ๐Ÿ“‹ App de Lembretes e Tarefas com Kotlin Telas do App Tecnologias Kot

Owner
Niclas
Typescript and C++ Developer working on various projects.
Niclas
Backend aio - A project made to help all newbie programmers that are approaching backend development

BackendAIO A ktor based ready to use backend BackendAIO is a project made to hel

Fabrizio Scarponi 4 Feb 1, 2022
Mock up social media android application created to interact with a backend Java server using GraphQL.

The Community Board Project Authorship: author: dnglokpor date: may 2022 Project Summary: The Community Board Project consists of a Java Spring Boot b

Delwys Glokpor 1 May 17, 2022
Kotlin microservices with REST, and gRPC using BFF pattern. This repository contains backend services. Everything is dockerized and ready to "Go" actually "Kotlin" :-)

Microservices Kotlin gRPC Deployed in EC2, Check it out! This repo contains microservices written in Kotlin with BFF pattern for performing CRUD opera

Oguzhan 18 Apr 21, 2022
A sample skeleton backend app built using Spring Boot kotlin, Expedia Kotlin Graphql, Reactive Web that can be deployed to Google App Engine Flexible environmennt

spring-kotlin-gql-gae This is a sample skeleton of a backend app that was built using: Spring Boot(Kotlin) Reactive Web Sprinng Data R2DBC with MYSQL

Dario Mungoi 7 Sep 17, 2022
๐Ÿ“’ NotyKT is a complete ๐Ÿ’ŽKotlin-stack (Backend + Android) ๐Ÿ“ฑ application built to demonstrate the use of Modern development tools with best practices implementation๐Ÿฆธ.

NotyKT ??๏ธ NotyKT is the complete Kotlin-stack note taking ??๏ธ application ?? built to demonstrate a use of Kotlin programming language in server-side

Shreyas Patil 1.4k Dec 26, 2022
Kotlin backend based on the Clean Architecture principles. Ktor, JWT, Exposed, Flyway, KGraphQL/GraphQL generated endpoints, Gradle.

Kotlin Clean Architecture Backend Kotlin backend based on the Clean Architecture principles. The application is separated into three modules: Domain,

null 255 Jan 3, 2023
Blog Backend Api built with Kotlin, Springboot and AWS

Kotlin, Spring Boot, MySQL, JPA, Hibernate Rest API for Blogs A Restful CRUD API using Kotlin, Spring Boot, Mysql, JPA and Hibernate hosted on AWS Ela

Nick Ang 1 Nov 15, 2021
Backend coding challenge using Kotlin and Ktor

Backend Coding Challenge We appreciate you taking the time to participate and su

Thermondo 0 Jan 4, 2022
A small backend for the Thinkrchive app written in Kotlin with Ktor

A small backend for the Thinkrchive app written in Kotlin with Ktor. It uses Postgresql with a few requests and JWT authentication for admins.

Thinkrchive 6 Dec 12, 2022
It is a repository containing backend structure for Ktor.

Backend Architecture with Ktor + KMongo This project contains, Authentication using Jwt Database Layer (KMongo - Orm for MongoDB) Routing Advanced Rou

Himanshu Singh 56 Dec 28, 2022