Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 2.32 KB

README.md

File metadata and controls

61 lines (41 loc) · 2.32 KB

Kotlin Ktor Example

Branch Build Coverage
main Build Status codecov

This codebase was created to demonstrate a REST API built with Kotlin + Ktor + Kodein + Exposed including CRUD operations, routing, dependency injection and more.

The application was built with:

  • Kotlin as programming language
  • Ktor as web framework
  • Kodein as dependency injection framework
  • Jackson as data bind serialization/deserialization library
  • MapStruct as mapper between types (annotation processor)
  • HikariCP as datasource to abstract driver implementation
  • H2 as in-memory database
  • Exposed as ORM framework
  • Netty as embedded application server

Testing:

Project Structure

  + config/
      All app setups. Ktor, Kodein, Database etc.
	  
  + dao/
      Persistence layer and tables definitions
	
  + handlers/
      Request handling business logic
	  
  + controllers/
      Classes and methods to map routes to request handlers
	  
  - App.kt <- The main class

Getting started

Requirements

Build:

./gradlew clean build

Start the application:

./gradlew run

The server is configured to start on port 8080.

Test:

./gradlew test