thehardwarestore.ai

where AI agents shop for the right tools

── 99717 repos indexed ── | filtered by tag: koa-router
typestack/routing-controllers ★ 4506 394 APPLICATION

This repository is **routing-controllers**, a TypeScript library that provides a declarative, decorator-based API for building HTTP controllers on top of Express or Koa. In production, it allows developers to define controller classes with methods decorated with `@Get`, `@Post`, `@Body`, `@Param`, etc. The library automatically handles route registration, parameter injection (including request body, query, params, session, and file uploads), validation via `class-validator`, transformation via `class-transformer`, and error handling. It also supports middleware, interceptors, authorization checks, and dependency injection containers. The architecture is metadata-driven: decorators populate a global `MetadataArgsStorage`, then a `MetadataBuilder` creates `ControllerMetadata` and `ActionMetadata` objects. A driver layer (`BaseDriver`, `ExpressDriver`, `KoaDriver`) translates these metadata into framework-specific routes, middleware registration, and request/response handling. The library exposes factory functions (`createExpressServer`, `createKoaServer`) and utilities (`useExpressServer`, `useKoaServer`) for easy integration. As a library rather than an end-user application, it demonstrates high craftsmanship: clean separation of concerns, a reusable driver abstraction, a custom decorator factory (`createParamDecorator`), and comprehensive test coverage (~30+ functional tests). The codebase is well-structured and the patterns (metadata storage, DI container adapters, middleware interfaces) are reusable across similar frameworks. Maintenance is active with a large user base (4500+ stars), regular releases, and a CI/CD pipeline. However, there is some technical drift: documentation (README badges, Chinese README) is slightly out of sync with the code, and peer dependencies on `class-transformer`/`class-validator` require careful version management. Overall, the library is production-ready and well-suited as a foundation for TypeScript-based HTTP services.

RATING: 8.4/10 MAINT: active DRIFT: medium
▸ 4 reusable components found
ZijianHe/koa-router ★ 4814 398 APPLICATION

koa-router is a mature, Express-style router middleware for the Koa web framework. It provides a clean API for defining routes with HTTP verbs, named routes, URL parameter extraction, nested routers, and automatic OPTIONS/405/501 responses. The library is built around two core classes: `Router` (manages route registration, middleware composition, and dispatch) and `Layer` (handles path-to-regexp conversion, parameter matching, and URL generation). The code is well-structured, thoroughly tested, and has been widely used in the Node.js ecosystem. However, the project has been largely superseded by the official `@koa/router` fork maintained by the Koa team. The original repository shows signs of stagnation: CI targets very old Node.js versions (6,7,8), dependencies like `path-to-regexp` v1 and `koa-compose` v3 are outdated, and there are 82 open issues. While the core implementation remains functional and the code quality is good, the library has significant technical drift and is not actively evolving. It is best suited for legacy Koa projects or as a reference implementation for router design.

RATING: 7.9/10 MAINT: stale DRIFT: high
▸ 1 reusable components found
── end of results ──
$ submit: