Recipes
Kest vs NestJS
Every NestJS feature, following docs.nestjs.com, with its Kest equivalent and an honest status.
Honest status of every NestJS feature, following the structure of docs.nestjs.com. Done = implemented and covered by a test that runs against the real thing. Partial = works, with a stated gap. Missing = not built.
Test modules: examples/store-api, java-api, parity, microservices-tests, platform-tests, and packages/cli. Start the servers they need with tools/test-infra.sh up all.
Overview
| NestJS | Kest | Status |
|---|---|---|
Controllers, routing, @Get/@Post/... | same names; routes compiled into a segment trie, checked at build time | Done |
@Param, @Query, @Body, @Headers, @Ip, @Session, @HostParam | @Param, @Query, @Body, @Header, @Cookie, @Ip, Session, @HostParam; whole-object @Query dto, @Body("field") | Partial (no all-headers map) |
@Req(), @Res(), @Res({ passthrough: true }) | @Request, @Response, @Response(passthrough = true) with RawResponse | Done |
@HttpCode, @Header, @Redirect | @HttpCode, @SetHeader, @Redirect | Done |
| Providers, constructor injection | @Injectable, checked at build time | Done |
Modules, imports/exports, global modules | @Module, global = true | Done (one provider per type across the app, not per module) |
| Middleware | Middleware, useMiddleware(forRoutes, exclude) | Done |
Exception filters, @Catch, @UseFilters | ExceptionFilter, @UseFilters | Done |
Pipes: ValidationPipe, Parse*Pipe, DefaultValuePipe, custom | typed binding, @Query(defaultValue), ValidationPipe, Pipe, @UsePipes | Done |
Guards, @UseGuards, roles | Guard, @UseGuards, @Role/@Roles | Done |
| Interceptors | Interceptor, @UseInterceptors; logging, timeout, cache | Done |
Custom route decorators, applyDecorators, SetMetadata + Reflector | @Guarded, @Intercepted, @Metadata, composite annotations, @ParamDecorator, @MethodAspect (@Async, @Retry, @Cacheable, @Timed, @Traced, your own) | Done (method aspects need open classes) |
Fundamentals
| NestJS | Kest | Status |
|---|---|---|
Custom providers: useValue, useFactory, useExisting, useClass | override<T>(), provide<T> { }, alias<A, B>(), @Injectable(binds) | Done |
Injection tokens, @Inject() | Token<T>, @Inject("name") | Done |
| Async providers | provideAsync { future }, provideSuspend { } with a timeout | Done |
Dynamic modules (forRoot, register, forFeature) | DynamicModule, forRoot { } / register { } | Done (no forFeature) |
| Injection scopes | SINGLETON, TRANSIENT, REQUEST with bubbling | Partial (request scope for HTTP only; guards and interceptors stay singletons) |
Circular dependencies, forwardRef | by inject() | Done |
Module reference (ModuleRef.get/resolve/create) | Container: get, resolve, create | Done |
| Lazy-loading modules | Missing | |
Execution context, ArgumentsHost | ExecutionContext with annotations of handler and controller | Partial (HTTP-centred; guards on other transports get the message as an HTTP-like request) |
| Lifecycle events (five hooks) | same names | Done |
| Discovery service | methodsWith<A>(), classesWith<A>() | Done |
| Platform agnosticism | HttpAdapter SPI: Netty (default), JDK | Done |
Testing: Test.createTestingModule, overrideProvider, overrideGuard, e2e | Testing.createModule, overrideProvider/Guard/Interceptor/Pipe/Filter/Middleware, TestServer | Done |
| Standalone applications | Kest.create<AppModule>(); the worker template | Done |
Logger | Logger("Ctx"), pluggable LogSink | Done |
Techniques
| NestJS | Kest | Status |
|---|---|---|
Configuration (.env, schema validation, namespaces, registerAs, forRootAsync with ConfigService) | config: env, .env, .properties, YAML, JSON, loaders, validate, getOrThrow, typed getAs, registerAs; forRootAsync { config: ConfigService -> } on the ORM, JWT, cache, queue, mailer, throttler, metrics and tracing modules | Done |
Database: TypeORM, @InjectRepository | orm: @InjectRepository(Entity::class, "ds") with Repository<T> (SQL) and MongoRepository<T>, entities, @CreateDate/@UpdateDate/soft delete, @Column options, @Index, derived queries, relations (foreign keys and junction tables), cascades, orphan removal, lazy loading, join fetch, @Transactional, generated migrations | Done on PostgreSQL, MySQL, MongoDB |
| Mongo (Mongoose) | orm-mongo shares the entity model; MongoDB migrations (indexes, collections) | Partial (no schemas or middleware) |
| Sequelize, MikroORM, Prisma | Missing | |
| Validation | validation: constraints, groups, custom constraints, @Valid | Done |
| Caching | cache: service, interceptor, @Cacheable/@CachePut/@CacheEvict; memory, Caffeine, file, Redis, Memcached, layered | Done |
Serialization (class-transformer, ClassSerializerInterceptor) | @Exclude, @Expose (name, groups), @Transform, @SerializeGroups, ClassSerializerInterceptor | Done (Jackson codec) |
| Versioning | enableVersioning URI, header, media type | Done |
| Task scheduling | schedule: @Cron, @Interval, @Timeout, registry | Done |
| Queues (BullMQ) | queue, queue-redis: delays, retries, priorities (also in Redis), repeatable and cron jobs, rate limiter | Partial (no flows or job dependencies, no pause) |
| Logging | Logger in core: NestJS layout, colour per level, Logging.configure, JSON mode, overrideLogger, start-up lines in the NestJS structure | Done (no request logging beyond LoggingInterceptor) |
| Cookies, Session | @Cookie, ResponseCookie, useSession (memory or Redis) | Done |
| Events | event-emitter: @OnEvent, wildcards, priority | Done |
| Compression, Helmet, CORS, CSRF | useCompression, useSecurityHeaders, enableCors, useCsrf | Done |
| File upload, streaming files, SSE | @FormFile, StreamableFile, SseStream | Done (uploads held in memory) |
| HTTP module | http-client with timeouts, retries, interceptors | Done |
| MVC and template engines | views: @Render, View; Mustache built in, FreeMarker, Thymeleaf | Done |
| Performance (Fastify) | Netty engine; @NonBlocking with a watchdog | Done |
| Task: Server-Sent Events | SseStream | Done |
| Mailer | mailer with Mustache, FreeMarker or Thymeleaf templates | Done |
Security
| NestJS | Kest | Status |
|---|---|---|
Authentication, @nestjs/jwt | security: JwtService (HS256/384/512, RS256), JwtAuthGuard, @Public, API-key and Basic strategies | Done |
| OAuth and social login | OAuth2Provider: authorization code with PKCE; Google, GitHub, Microsoft, any OIDC provider | Partial (tested against a local provider, not the real ones; no SAML, no LDAP) |
| Authorization (roles, claims, policies) | @Role, @Roles, custom guards | Partial (no CASL-style policy engine) |
| Encryption and hashing | PasswordHasher: PBKDF2, bcrypt, argon2id | Done (bcrypt and argon2id need Bouncy Castle on the classpath) |
| Rate limiting | throttler, throttler-redis | Done |
GraphQL, WebSockets, microservices
| NestJS | Kest | Status |
|---|---|---|
GraphQL schema-first, resolvers, @ResolveField | graphql | Done |
| GraphQL dataloader | @BatchLoader with DataLoader parameters | Done |
| GraphQL subscriptions | @Subscription with Publisher, graphql-transport-ws, Topics | Done (in-process topics) |
| GraphQL code-first, federation | Missing | |
| WebSocket gateways, rooms, guards and pipes on messages | websocket (Netty) | Partial (plain WebSocket; rooms per instance) |
| Socket.IO adapter | the same gateways answer Socket.IO v4 (namespaces, acks, rooms) over the WebSocket transport | Partial (no long polling, no binary, no Redis adapter) |
| Microservices: TCP, Redis, NATS, MQTT, RabbitMQ, Kafka | microservices and one package per broker, same handler model | Partial (single reply per request; single-broker restarts tested, cluster failover not; NestJS interop untested) |
| gRPC | microservices-grpc: four call types, metadata, guards, TLS and mutual TLS | Partial (no reflection or health service; Wire version pinned) |
| Hybrid applications | http plus microservice(...) on one container | Done |
Recipes and tooling
| NestJS | Kest | Status |
|---|---|---|
| CQRS: buses, aggregates, events | cqrs | Done |
| CQRS sagas as RxJS streams | @Saga fun f(events: Stream<Any>): Stream<*> with ofType, delay, debounce, buffer, merge... | Partial (a small push stream, not RxJS) |
| OpenAPI (Swagger) | api-docs: annotations, reference site with sandbox, OpenAPI 3 export | Done |
| Health checks (Terminus) | health, health-orm (PostgreSQL, MySQL, MongoDB indicators) | Done |
| OpenTelemetry, metrics | opentelemetry (tracing over OTLP), metrics (Prometheus) | Partial (no OTel metrics or logs, no ORM or messaging spans) |
Nest CLI: new, generate, library | kest new, kest generate (19 schematics), library, Gradle tasks | Partial (no build/start --watch, no monorepo app mode) |
| REPL, Devtools | Missing | |
| HTTP/2, raw HTTPS | Netty TLS | Partial (no HTTP/2) |
| Prisma, Sentry, Nest Commander | Missing |
Beyond NestJS
- Compile-time module graph and route, validator and ORM generation (KSP): wiring mistakes fail the build; no runtime reflection.
- Handlers run on virtual threads in parallel, jobs and messages likewise; one process can use every core, and processes can still be added. See the concurrency page.
- Java support: records, plain classes and Java annotations as entities, DTOs, controllers and guards (
examples/java-api). - One generated entity mapper serves SQL and MongoDB; several databases in one app; atomic writes,
@Version,@Unique. - A watchdog that catches
@NonBlockinghandlers that block.