typestack/routing-controllers — explained in plain English
Analysis updated 2026-06-26
Organize an Express or Koa API into controller classes, each handling a group of related routes with decorators.
Automatically validate incoming JSON request bodies against TypeScript classes and return 400 errors for invalid data.
Protect API routes with authorization guards by adding a decorator that checks the user's role before running the handler.
Switch a Node.js API from Express to Koa with minimal code changes using the same decorator-based route definitions.
| typestack/routing-controllers | zdhxiong/mdui | auth0/express-jwt | |
|---|---|---|---|
| Stars | 4,509 | 4,509 | 4,510 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | moderate | easy | easy |
| Complexity | 3/5 | 2/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires enabling experimentalDecorators and emitDecoratorMetadata in tsconfig.json before decorators will work.
routing-controllers is a TypeScript library that lets you define the URL routes of a web server by writing plain classes with methods, rather than scattering route definitions across dozens of function calls. Each class represents a group of related routes, for example all user-related endpoints in one file, and each method in that class handles one kind of request. You attach small annotations called decorators to the class and its methods to tell the library what URL path each action responds to and what HTTP verb it uses (GET, POST, PUT, DELETE, and so on). The library works with two popular Node.js web frameworks: Express and Koa. You pick one, install it alongside routing-controllers, and the library registers all your routes automatically at startup. You do not have to wire up each route manually. It supports both frameworks with the same decorator syntax, so switching between them requires minimal changes. Beyond basic routing, the library can automatically pull values out of incoming requests and pass them into your method as function arguments. You can extract URL parameters, query string values, the request body, headers, cookies, and uploaded files, all by adding the appropriate decorator to each parameter. It can also automatically validate incoming data and convert raw string values into typed objects using companion libraries called class-validator and class-transformer. More advanced features include middleware support (code that runs before or after your handler), interceptors (code that can modify the response), authorization helpers that let you protect routes behind a login check, and integration with dependency injection containers so the library can automatically construct your controller classes with the services they need. Controllers can also inherit from one another to share common behavior. The project is maintained under the TypeStack organization, which also publishes related libraries like TypeORM and class-validator. Installation is done through npm and requires a couple of TypeScript compiler settings to be turned on. The full README is longer than what was shown.
A TypeScript library that lets you define Express or Koa web server routes using classes and decorators instead of scattered function calls, with built-in validation and dependency injection.
Mainly TypeScript. The stack also includes TypeScript, Node.js, Express.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.