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)
Requirements
- Java 17+
- Kotlin 2.2.10 (Gradle Kotlin DSL recommended)
Add the repository and dependency:
repositories {
mavenCentral()
maven(url = "https://jitpack.io")
}
dependencies {
implementation("com.github.Jadiefication:Void:<version>")
}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.
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.
Request handling uses Kotlin coroutines under the hood to keep I/O non-blocking with a straightforward API.
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.
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 { }
- File bugs and feature requests using GitHub Issues.
- For questions, Discussions or StackOverflow (tag: kotlin) are recommended.
Please follow the process in SECURITY.md for private disclosure.
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.
MIT — see LICENSE for details.
