Skip to content

Jadiefication/Void

Void logo

Void

A minimal Kotlin web framework for building HTML pages and APIs with a tiny HTTP/HTTPS server.

JitPack Kotlin License Contribute with Gitpod

Void is a small, unopinionated framework you can embed into your app. It provides:

  • Type-safe HTML DSL with generated elements (io.voidx.generated)
  • Simple router with static, dynamic, and KTS interaction routes
  • Middleware (before/after) with priorities
  • First-class API endpoints returning ResponseDTO
  • Minimal HTTP/HTTPS server (no servlet container)
  • Optional per-page Tailwind CSS extraction at runtime
  • In-memory page caching via @Cacheable

Quick links

  • Security policy: SECURITY.md
  • Roadmap/TODO: TODO.md
  • Contributing guide: CONTRIBUTING.md
  • Code of Conduct: CODE_OF_CONDUCT.md
  • Support: SUPPORT.md
  • License: MIT (LICENSE)

Get started

Requirements

  • Java 17+
  • Kotlin 2.2.10 (Gradle Kotlin DSL recommended)

Installation (JitPack)

Add the repository and dependency:

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

dependencies {
    implementation("com.github.Jadiefication:Void:<version>")
}

Hello, Void

Create a minimal server with one HTML route and one API route:

import io.voidx.router.router
import io.voidx.html.page.htmlRoute
import io.voidx.html.page.apiRoute
import io.voidx.generated.Div
import io.voidx.html.Fractal
import io.voidx.server.server
import io.voidx.dto.http.ok

fun main() {
    val r = router {
        +htmlRoute("/", { title = "Home" }) { _ ->
            Div("class" to "p-6 text-xl") { Fractal("Hello, Void!") }
        }
        +apiRoute("/api/health") { _ ->
            ok("ok", mutableMapOf("Content-Type" to "text/plain"))
        }
    }

    server {
        router = r
        port = 8080
        routeToHTTPS = false
    }
}

Then open http://localhost:8080.

Principles

Unopinionated

Void doesn’t force a particular logging, DI, templating, or persistence stack. Compose apps using functions and small DSLs. Middleware integrates via a simple interception mechanism.

Asynchronous

Request handling uses Kotlin coroutines under the hood to keep I/O non-blocking with a straightforward API.

Testable

Pages and routers can be constructed and invoked in tests without spinning up external containers. You can exercise handlers directly or run the tiny server in integration tests.

Documentation

Until a dedicated site is available, see this README and the test module for examples. Core entry points:

  • io.voidx.router.router { }
  • io.voidx.html.page.htmlRoute / apiRoute / dynamicHtmlRoute / dynamicApiRoute
  • io.voidx.server.server { }

Reporting Issues / Support

  • File bugs and feature requests using GitHub Issues.
  • For questions, Discussions or StackOverflow (tag: kotlin) are recommended.

Reporting Security Vulnerabilities

Please follow the process in SECURITY.md for private disclosure.

Contributing

We welcome contributions of all kinds. Before large changes, please open an issue to discuss direction. Keep PRs focused; add tests or examples where appropriate.

License

MIT — see LICENSE for details.

About

A fullstack web framework written in Kotlin, which uses the HTMX philosophy for interactivity.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •