Skip to main content

Decorator-first. Koa underneath.

Build clear, typed APIs without hiding Koa.

Amala turns TypeScript controller classes into versioned REST APIs with focused request injection, validation, and OpenAPI support.

Node.js 18+ · TypeScript · MIT licensed

A controller is the contract
src/controllers/UserController.ts
import {Body, Controller, Get, Params, Post} from 'amala';

@Controller('/users')
export class UserController {
@Get('/:id')
getOne(@Params('id') id: string) {
return {id};
}

@Post('/')
create(@Body({required: true}) input: CreateUserInput) {
return input;
}
}

Small framework surface

Structure where it helps. Control where it matters.

01

Routes that read like code

Map controller methods to HTTP paths, versions, and middleware without giving up the underlying Koa router.

02

Inputs with a narrow shape

Inject the specific body, path, query, state, session, or context value each handler actually needs.

03

Validation at the edge

Transform decorated TypeScript classes and run class-validator before application logic receives the value.

04

An API others can inspect

Generate an OpenAPI 3 document and Swagger UI from the same metadata that powers the routes.

Own the boundary

Framework convenience, explicit security.

Configure CORS, input limits, uploads, API docs, authentication, and authorization for your deployment. The production guide makes every security-sensitive default visible.

Review the security guide