Hexagon
Hexagon

The atoms of your platform

Travis CI Codecov Bintray

Getting Started | Guides | API Reference | Community


Hexagon is a microservices framework that doesn’t follow the flock. It is written in Kotlin and its purpose is to ease the building of services (Web applications, APIs or queue consumers) that run inside a cloud platform.

It is meant to provide abstraction from underlying technologies to be able to change them with minimum impact.

The goals of the project are:

  1. Be simple to use: make it easy to develop user services (HTTP or message consumers) quickly. It is focused on making the usual tasks easy, rather than making a complex tool with a lot of features.
  2. Make it easy to hack: allow the user to add extensions or change the framework itself. The code is meant to be simple for the users to understand it. Avoid having to read blogs, documentation or getting certified to use it efectively.

What are NOT project goals:

  1. To be the fastest framework. Write the code fast and optimize only the critical parts. It is not slow anyway, and it will be faster when it supports asynchronous non blocking operation.
  2. Support all available technologies and tools: the spirit is to define simple interfaces for the framework’s features, so users can implement integrations with different tools easily.
  3. To be usable from Java. Hexagon is Kotlin first.

Quick Start

  1. Configure Kotlin in Gradle or Maven.
  2. Setup the JCenter repository (follow the link and click on the Set me up! button).
  3. Add the dependency:
  • In Gradle. Import it inside build.gradle:

    compile ("com.hexagonkt:server_jetty:0.22.2")
    
  • In Maven. Declare the dependency in pom.xml:

    <dependency>
      <groupId>com.hexagonkt</groupId>
      <artifactId>server_jetty</artifactId>
      <version>0.22.2</version>
    </dependency>
    
  1. Write the code in the src/main/kotlin/Hello.kt file:

     import com.hexagonkt.server.jetty.serve
    
     fun main(vararg args: String) {
         serve {
             get("/hello/{name}") { "Hello ${request["name"]}!" }
         }
     }
    
  2. Run the service and view the results at: http://localhost:2010/hello/world

You can read more details in the Services guide.

Guides

Status

DISCLAIMER: The project status is beta. Use it at your own risk. There are some modules not started yet (ie: metrics and remote configuration) and the API is subject to change any time prior to release 1.0.

Performance is not the primary goal, but it is taken seriously. You can check performance numbers in the TechEmpower Web Framework Benchmarks

Tests, of course, are taken into account. This is the coverage grid:

CoverageGrid

Contribute

If you like this project and want to support it, the easiest way is to give it a star :v:.

If you feel like you can do more. You can contribute to the framework in different ways:

Refer to the contributing.md file for detailed information about Hexagon’s development and how to help.

To know what issues are currently open and be aware of the next features yo can check the Project Board at Github.

You can ask any question, suggestion or complaint at the project’s Slack channel. And be up to date of project’s news following @hexagon_kt in Twitter.

Eventually I will thank all contributors, but now it’s just me.

License

The project is licensed under the MIT License. This license lets you use the source for free or commercial purposes as long as you provide attribution and don’t hold any project member liable.

compile "co.there4:hexagon:0.10.8"

Related Libraries

chrome-reactive-kotlin

Headless Chrome DevTools Protocol Client (RxJava2 + Kotlin)

Last updated 3 mins ago

vertx-lang-kotlin

Kotlin lang for Vert.x 3

Last updated 3 mins ago

kara

Kotlin Web Framework for the JVM

Last updated 3 mins ago

kraph

GraphQL request string builder written in Kotlin

Last updated 3 mins ago

tekniq

A framework designed around Kotlin providing a full-featured HTTP Framework, Restful HTTP Client, JDBC DSL, Loading Cache, Configurations, Validations, and more

Last updated 3 mins ago