# typestack/routing-controllers

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/typestack-routing-controllers).**

4,508 stars · 394 forks · TypeScript · MIT

## Links

- GitHub: https://github.com/typestack/routing-controllers
- awesome-repositories: https://awesome-repositories.com/repository/typestack-routing-controllers.md

## Topics

`controllers` `express-router` `framework` `koa-router` `node-framework` `router` `typescript-framework` `web-framework`

## Description

routing-controllers is a declarative API router and web framework controller for TypeScript. It provides a system for defining HTTP routes and request handling logic using class-based decorators and metadata to organize API endpoints into a structured architecture.

The project utilizes adapter-based server integration to decouple routing logic from the underlying web framework, providing specific integrations for Express and Koa. It features a reflection-based type transformation system that validates and transforms incoming request parameters into typed class instances.

The capability surface covers a full request-response pipeline, including middleware execution, response interception, and global error management. It supports advanced routing utilities such as global route prefixing, filesystem-based component discovery, and dependency injection integration. Additional functionality includes role-based access control, authenticated user injection, and specialized handlers for file uploads and response streaming.

## Tags

### Software Engineering & Architecture

- [Class-Based Logic Organization](https://awesome-repositories.com/f/software-engineering-architecture/class-based-logic-organization.md) — Organizes API endpoints into structured classes using decorators to define routes and shared behaviors. ([source](https://github.com/typestack/routing-controllers/blob/develop/package.json))
- [Integration Adapters](https://awesome-repositories.com/f/software-engineering-architecture/integration-adapters.md) — Decouples routing logic from underlying web frameworks using adapters for Express and Koa.
- [Reflection-Based Data Mapping](https://awesome-repositories.com/f/software-engineering-architecture/metadata-attachments/struct-tags/reflection-based-type-mapping/reflection-based-data-mapping.md) — Uses reflection and metadata to convert plain JSON request data into typed class instances.
- [Request Validation](https://awesome-repositories.com/f/software-engineering-architecture/request-validation.md) — Validates and transforms incoming request parameters into typed class instances using reflection.
- [Automatic Dependency Discovery](https://awesome-repositories.com/f/software-engineering-architecture/automatic-dependency-discovery.md) — Automatically discovers and registers controllers, middleware, and interceptors using filesystem glob patterns. ([source](https://github.com/typestack/routing-controllers/blob/develop/docs/lang/chinese/README.md))
- [Parameter](https://awesome-repositories.com/f/software-engineering-architecture/decorator-patterns/decorators/parameter.md) — Provides reusable decorators to extract specific values from the request context directly into action parameters. ([source](https://github.com/typestack/routing-controllers/blob/develop/docs/lang/chinese/README.md))
- [Dependency Injection](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/dependency-injection.md) — Supports injecting services into controllers and handlers using compatible dependency injection containers. ([source](https://github.com/typestack/routing-controllers#readme))
- [Authenticated User Injectors](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/dependency-injection/authenticated-user-injectors.md) — Injects the identity of the authenticated user directly into controller methods via a custom retrieval function. ([source](https://github.com/typestack/routing-controllers/blob/develop/docs/lang/chinese/README.md))
- [Filesystem Scanning](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/extensibility/plugin-architectures/developer-authoring-interfaces/custom-module-implementations/module-functionality-extenders/module-based-extensions/namespace-based-module-auto-discovery/filesystem-scanning.md) — Automatically registers controllers and middleware by scanning the filesystem using glob patterns.

### Web Development

- [REST API Frameworks](https://awesome-repositories.com/f/web-development/rest-api-frameworks.md) — Provides a declarative system for building JSON APIs with automated response formatting and input validation.
- [Declarative API Router Registrations](https://awesome-repositories.com/f/web-development/api-routers/declarative-api-router-registrations.md) — Implements a declarative system for defining HTTP routes and request handling using class-based decorators.
- [Automatic Parameter Injection](https://awesome-repositories.com/f/web-development/automatic-parameter-injection.md) — Automatically extracts data from request bodies or headers and injects them as typed arguments into handler methods.
- [Parameter Coercion and Validation](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/query-parameter-validations/parameter-coercion-and-validation.md) — Validates and coerces incoming request parameters against defined types and constraints, returning structured errors on failure. ([source](https://github.com/typestack/routing-controllers#readme))
- [Express Integrations](https://awesome-repositories.com/f/web-development/express-integrations.md) — Acts as a routing wrapper that adds structured class controllers and dependency injection to Express servers.
- [Express Routing Integration](https://awesome-repositories.com/f/web-development/express-routing-integration.md) — Organizes Express routes and request handlers using class-based decorators to reduce boilerplate.
- [Koa Integrations](https://awesome-repositories.com/f/web-development/koa-integrations.md) — Acts as a routing wrapper that adds structured class controllers and dependency injection to Koa servers.
- [Koa Routing Middleware](https://awesome-repositories.com/f/web-development/koa-routing-middleware.md) — Provides structured class-based routing and middleware definition for Koa servers using TypeScript.
- [Parameter Injections](https://awesome-repositories.com/f/web-development/parameter-injections.md) — Automatically extracts request parameters from bodies, headers, and queries and injects them into handler arguments. ([source](https://github.com/typestack/routing-controllers/tree/develop/lang/chinese))
- [Request Data Transformation](https://awesome-repositories.com/f/web-development/request-data-transformation.md) — Transforms plain JSON request payloads into typed class instances to ensure type safety and business logic consistency. ([source](https://github.com/typestack/routing-controllers#readme))
- [Decorator-Based Route Mappings](https://awesome-repositories.com/f/web-development/routing-systems/routing/decorator-based-route-mappings.md) — Uses TypeScript decorators to map HTTP endpoints to specific class methods via metadata.
- [TypeScript](https://awesome-repositories.com/f/web-development/typescript.md) — Builds structured server-side applications using TypeScript to organize endpoints into a declarative class-based architecture.
- [Web Framework Controllers](https://awesome-repositories.com/f/web-development/web-framework-controllers.md) — Provides a declarative class-based routing layer for organizing API endpoints using decorators in TypeScript.
- [Web Server Adapter Drivers](https://awesome-repositories.com/f/web-development/web-server-adapter-drivers.md) — Implements an adapter-based system to decouple routing logic from underlying web servers like Express and Koa. ([source](https://github.com/typestack/routing-controllers/blob/develop/CHANGELOG.md))
- [HTTP Response Builders](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/http-utilities/http-response-builders.md) — Provides decorators to programmatically define HTTP status codes, headers, and redirects for API responses. ([source](https://github.com/typestack/routing-controllers/blob/develop/README.md))
- [Global Error Handlers](https://awesome-repositories.com/f/web-development/global-error-handlers.md) — Captures exceptions across the application and converts them into a standardized format via a custom global handler. ([source](https://github.com/typestack/routing-controllers/tree/develop/lang/chinese))
- [Standard HTTP Error Responses](https://awesome-repositories.com/f/web-development/http-request-response-object-layers/standard-http-error-responses.md) — Returns standardized HTTP error responses using built-in or custom exception classes like NotFoundError. ([source](https://github.com/typestack/routing-controllers/blob/develop/docs/lang/chinese/README.md))
- [Request Middleware](https://awesome-repositories.com/f/web-development/request-middleware.md) — Enables running custom logic before or after route handlers at the global, controller, or method level. ([source](https://github.com/typestack/routing-controllers/blob/develop/docs/lang/chinese/README.md))
- [Ordered Middleware Pipelines](https://awesome-repositories.com/f/web-development/request-middleware-pipelines/service-middleware-pipelines/ordered-middleware-pipelines.md) — Provides an ordered pipeline for executing global, class-level, or method-level middleware.
- [Request-Response Interceptors](https://awesome-repositories.com/f/web-development/request-response-interceptors.md) — Implements application-level interceptors to modify the final result of a controller before it is sent to the client. ([source](https://github.com/typestack/routing-controllers/blob/develop/docs/lang/chinese/README.md))
- [Backend Middleware](https://awesome-repositories.com/f/web-development/typescript/backend-middleware.md) — Implements global and route-specific logic for authentication and authorization using TypeScript decorators.
- [Typed Path Parameter Decoders](https://awesome-repositories.com/f/web-development/url-parameter-extraction/typed-path-parameter-decoders.md) — Provides type-safe parsing and validation of URL path and query parameters into primitive types. ([source](https://github.com/typestack/routing-controllers/blob/develop/CHANGELOG.md))

### Artificial Intelligence & ML

- [Request and Response Interception](https://awesome-repositories.com/f/artificial-intelligence-ml/grpc-call-interception/request-and-response-interception.md) — Provides a layer to intercept and transform the data returned by controllers before the final response is delivered.

### Data & Databases

- [JSON Response Serializers](https://awesome-repositories.com/f/data-databases/data-structures/structured-return-objects/json-response-serializers.md) — Automatically serializes controller return values into JSON and sets the appropriate Content-Type headers. ([source](https://github.com/typestack/routing-controllers/blob/develop/docs/lang/chinese/README.md))

### Security & Cryptography

- [Role-Based Access Control](https://awesome-repositories.com/f/security-cryptography/role-based-access-control.md) — Implements access control via decorators to restrict controller actions based on assigned user roles and permissions. ([source](https://github.com/typestack/routing-controllers#readme))
