katal
v2.0.0
Published
A simple yet powerful web framework for Bun with TypeScript
Maintainers
Readme
Katal
A lightweight, TypeScript-first web framework for Bun.
Features
- Controller-per-route HTTP architecture
- Global and named middleware (
before/afterhooks) - JWT authentication + policy-based authorization (
can:*) - Request validation with nested schema support
- Built-in rate limiting (pluggable stores)
- OpenAPI 3.1 generation from route metadata
- Request observability (correlation IDs, trace headers, timing)
- Cache abstraction with pluggable stores
- Queue core with retries, delay, and scheduling
- Event bus (
on,once,emit,emitSync) - Health checks (
/health,/health/ready,/health/live) - Plugin and service provider support
- Test helpers (
AppFactory,RequestClient, fake auth/time)
Installation
bun add katalQuick Start
import { Application, Controller } from "katal";
import type { RequestContext } from "katal";
const app = new Application({ port: 3000 });
const router = app.getRouter();
class HealthController extends Controller {
async handle(_ctx: RequestContext) {
return this.success({ status: "ok" });
}
}
router.get("/health", HealthController);
await app.listen();Documentation
- Full docs: docs/index.md
- Getting started: docs/getting-started.md
- Core API: docs/CORE.md
- HTTP Controllers: docs/HTTP.md
- Middleware: docs/MIDDLEWARE.md
- Testing: docs/TESTING.md
Examples
Contributing
Contributions are welcome. Please read CONTRIBUTING.md before opening a pull request.
License
This project is licensed under the MIT License. See LICENSE.
