The best NestJS alternative in 2026 is Encore, an open source backend framework with built-in infrastructure: each service is a folder, endpoints are typed TypeScript functions, and the Postgres databases and Pub/Sub topics you declare run locally with encore run and are provisioned in your own AWS or GCP account on deploy, while cron jobs are Encore platform Managed in deployed environments and do not run locally or in preview environments. It keeps the structure teams like in NestJS and drops modules, decorators and the DI container. Pick Express for the largest ecosystem, Fastify for schema validation, Hono for edge runtimes, AdonisJS for a batteries-included MVC framework, and tRPC for full-stack TypeScript.
NestJS gives you a lot of structure: modules, controllers, services, DTOs, guards, interceptors, pipes and decorators on everything. Some teams pick NestJS for exactly that structure, and for others a CRUD endpoint that needs five files and a module registration is the reason to look elsewhere. NestJS 12.4.2 is still a solid choice for large teams that want Angular-style conventions, but the ceremony has a cost on every feature, and the database, queue and scheduler behind the app still come from Terraform or another team.
The alternatives below take different positions on how much structure a framework should impose and how much of the surrounding infrastructure it should handle.
Backend framework with built-in infrastructure: keeps services and conventions, drops modules and DI, provisions databases, Pub/Sub and cron jobs in your own cloud, and can run existing Nest services during a migration
2
Express
v5.3.0
Largest ecosystem and no imposed architecture
3
Fastify
v5.12.8
Schema-validated APIs and a plugin system
4
Hono
v4.13.18
Smallest footprint, runs on edge runtimes
5
AdonisJS
v7.6.0
Batteries-included MVC framework with an ORM, validation and auth
6
tRPC
v11.28.0
End-to-end types with a TypeScript frontend
Versions are the latest npm releases as of November 2026, and the table below compares them on common backend requirements.
Encore keeps the parts of NestJS teams like, services and conventions, and removes the wiring. It is a backend framework with built-in infrastructure for TypeScript and Go. Where a NestJS endpoint often spans a controller, a service, a DTO with class-validator decorators and a module registration, an Encore endpoint is one function with typed parameters, and Encore uses those types for request validation, routing and API documentation.
A service is a folder with an encore.service.ts file, so adding one does not mean registering a module or configuring providers. Calling another service is a typed function call through a generated client. And the infrastructure that NestJS leaves to you is part of the framework: you declare a database, a topic or a cron job in TypeScript, encore run starts local versions of the database and the topic, and when you deploy, Encore provisions them in your own AWS or GCP account. Cron jobs are Encore platform Managed in deployed environments and do not run locally or in preview environments. You can also build a Docker image and run it on infrastructure you manage.
orders/orders.ts
orders/encore.service.ts
import { api } from"encore.dev/api";
import { SQLDatabase } from"encore.dev/storage/sqldb";
import { Topic } from"encore.dev/pubsub";
import { CronJob } from"encore.dev/cron";
// Infrastructure, declared in code: runs locally and in your own AWS or GCP account.const db = newSQLDatabase("orders", { migrations: "./migrations" });
exportconst orderPlaced = newTopic<{ orderId: number }>("order-placed", {
deliveryGuarantee: "at-least-once",
});
// A typed endpoint. Requests are validated against these types; no DTO class or pipe.exportconst place = api(
{ method: "POST", path: "/orders", expose: true },
async (req: { userId: number; total: number }): Promise<{ id: number }> => {
const row = await db.queryRow<{ id: number }>`
INSERT INTO orders (user_id, total)
VALUES (${req.userId}, ${req.total}) RETURNING id`;
await orderPlaced.publish({ orderId: row!.id });
return { id: row!.id };
},
);
// Replaces a @Cron() method from @nestjs/schedule; triggered by the Encore platform.exportconst cancelStale = api({}, async (): Promise<void> => {
await db.exec`UPDATE orders SET status = 'cancelled'
WHERE status = 'pending' AND created_at < NOW() - INTERVAL '2 days'`;
});
const _ = newCronJob("cancel-stale-orders", {
title: "Cancel stale pending orders",
every: "6h",
endpoint: cancelStale,
});
orders/encore.service.ts
// A folder with this file is a service. No modules, providers, or DI container.
import { Service } from "encore.dev/service";
export default new Service("orders");
On AWS, that deploy creates an RDS database and an SNS topic with SQS queues for its subscribers. Encore provisions an IAM role for the service, or a service account on GCP. The Encore platform runs the cron job with no scheduler to set up, and the local development dashboard shows a trace for every request, including the query and the publish.
Typed request and response validation from plain TypeScript types
Postgres databases, Pub/Sub, caches and object storage declared in code, with local versions started by encore run, and cron jobs that the Encore platform runs in deployed environments
Deployment to your own AWS or GCP account, or a Docker image you run yourself
Type-safe service-to-service calls through generated clients
Distributed tracing, a service catalog and generated API docs
Most of it, yes: Encore's NestJS guide runs your Nest app as a standalone application with NestFactory.createApplicationContext(AppModule), so the modules, services and providers that hold your business logic stay where they are. What you replace are the controllers: each controller method becomes an Encore endpoint that calls the same Nest service. You can do that one controller at a time, and move from TypeORM or Prisma connection strings to an Encore-declared database whenever it suits you.
Encore has its own conventions for services and infrastructure, so it is a different mental model from Nest's modules and providers, and guards and interceptors become auth handlers and middleware. Encore runs on Node.js with a Rust-based runtime and targets backend services, not edge runtimes. Cron jobs do not run on their schedule locally or in preview environments, so you call the endpoint directly to test them.
When you chose NestJS for multi-service structure, type safety and production readiness, and the boilerplate now costs time on every feature. It also fits teams where AI coding agents write part of the backend, since there is one way to define an API, a database and a service call. For a head-to-head comparison, see NestJS vs Encore.
Express sits at the other end from NestJS: where NestJS gives you a lot of structure, Express gives you almost none. It is a thin HTTP layer that lets you organize your code however you want. If you are leaving NestJS because you felt constrained, Express will feel lighter. If you are leaving because you wanted better built-in features, Express will feel like a step backward.
Express also has the largest ecosystem of any Node.js framework. If you need middleware for a niche use case, it probably exists. The framework is also the most widely understood, which makes hiring and onboarding straightforward.
Express has no module system to learn, no decorators and no DI container: you write request handlers and wire them up, and for small APIs or prototypes you are productive immediately.
Express was designed before TypeScript: request and response types are loose, validation needs external libraries, and there is no built-in schema, generated documentation or infrastructure tooling. For projects that need the structure NestJS provides, Express leaves you to build that structure yourself.
Pick Express when you are building a simple API, you need specific Express middleware, or your team is already experienced with Express and the project does not require multi-service architecture.
Fastify sits between Express's minimalism and NestJS's comprehensive architecture. It has opinions about validation (JSON Schema), logging (Pino), and code organization (plugins), but does not force a class-based architecture or dependency injection. It suits teams that want structure without class-based patterns.
The JSON Schema approach means your validation definitions also drive serialization optimization and OpenAPI documentation. Define the schema once, and Fastify gives you runtime validation, faster serialization, and generated docs.
The plugin system keeps code organized as the project grows, and JSON Schema validation gives you a single source of truth for types, validation and documentation, with far less boilerplate than NestJS for the same functionality.
JSON Schema is verbose: a complex request body with nested objects produces a wall of schema definitions that is harder to read and maintain than NestJS DTOs or TypeScript interfaces. The ecosystem is smaller than Express, and significantly smaller than NestJS for organizational patterns. Fastify does not provide infrastructure automation, service discovery, or built-in observability.
Pick Fastify when you want schema-driven development, a plugin architecture for organizing a single-service API, and you are comfortable with JSON Schema syntax.
Hono comes from the other direction: it is ultralight, designed for edge runtimes, and has almost no opinions about application architecture. The framework runs on Cloudflare Workers, Deno, Bun, and Node.js, with a ~14kb bundle size.
If your reason for leaving NestJS is that your project is simpler than NestJS assumes, Hono may be a good fit, with a small API that runs on many runtimes. But if you are leaving NestJS because you wanted better infrastructure support or observability, Hono moves you further from those features, not closer.
After NestJS, Hono is simple: there are no decorators, DI or module registration, only routes and middleware. The cross-runtime support means your code runs in more places than any other framework here.
Hono has no opinions about application architecture beyond middleware. For large projects, you need to establish your own conventions for code organization, database access, testing, and service boundaries. There is no built-in infrastructure support, no observability, and no multi-service tooling.
Pick Hono when you are building lightweight APIs for edge runtimes, when cross-runtime portability matters, or when your project is simple enough that you do not need the structure NestJS provided.
For a detailed comparison, see our Hono vs Encore article.
Instead of building REST endpoints with controllers and decorators, tRPC creates type-safe procedure calls between your frontend and backend. There are no HTTP methods to think about, no URL paths to define, and no separate API client to maintain. The TypeScript types flow from your backend procedures directly to your frontend code.
If you are building a full-stack TypeScript application and the REST layer feels like unnecessary overhead, tRPC eliminates it. Your frontend calls backend functions with full type checking and autocomplete.
When you change a procedure's input or output type, TypeScript catches every caller that needs updating, so there is no API client to regenerate and no OpenAPI spec to keep in sync with the frontend.
tRPC only works when both the frontend and backend are TypeScript. If you need to expose your API to mobile apps, third-party integrations, or non-TypeScript services, tRPC's type-level approach does not help. You will need to add a REST or GraphQL layer alongside it. tRPC also does not provide any infrastructure tooling, database management, or observability features.
Pick tRPC when you are building a full-stack TypeScript application, your API is primarily consumed by your own frontend, and end-to-end type safety is your top priority. It pairs well with Next.js and other React meta-frameworks.
For a detailed comparison, see our tRPC vs Encore article.
AdonisJS is the closest thing to NestJS on this list in scope: a TypeScript MVC framework with an IoC container, the Lucid ORM, VineJS validation, authentication, mail and a CLI (node ace) for scaffolding. It is opinionated like Nest, but its conventions come from Rails and Laravel rather than Angular, so controllers are plain classes and routes live in one file.
Pick AdonisJS when you want a full-stack framework where the ORM, validation, auth and templates are decided for you, and fewer decorators than NestJS. Like NestJS, it leaves the database server, queues and deployment to you.
Encore works best, as it gives agents one way to define APIs, infrastructure, and service calls. TypeScript's backend ecosystem has too many valid ways to structure things, and AI coding agents pick a different combination of validation library, database access pattern, and project layout on every prompt. NestJS makes this worse because its decorator-heavy approach and deep dependency injection system means agents have to understand modules, providers, guards, and interceptors, which is too many moving parts for consistent generation.
With Encore, the project's API patterns, infrastructure declarations, and service structure are already defined. An agent reads the existing conventions and follows them. There is one way to define an API, one way to declare a database, and one way to call another service.
Encore also provides an MCP server and editor rules (encore llm-rules init) that give agents access to database schemas, distributed traces, and service architecture. With that context, agents can generate queries that match your tables, debug with request traces and check their own work. Read more in How AI Agents Want to Write TypeScript.
If you want structure and infrastructure without boilerplate, Encore is the best alternative to NestJS. It provides multi-service architecture, type-safe service calls, built-in databases, Pub/Sub, cron jobs and distributed tracing, with less code to write and maintain than NestJS. Its conventions also give AI coding agents one pattern to follow in your project.
If you want maximum flexibility, Express lets you build exactly what you need with no imposed architecture, and you assemble everything yourself.
If you want schema-driven validation and docs, Fastify provides JSON Schema validation with OpenAPI generation and a solid plugin system, without the class-based architecture of NestJS.
If you are targeting edge runtimes, Hono is the lightest option with the broadest runtime support. It is the right call for Cloudflare Workers and similar platforms.
If you want a batteries-included MVC framework, AdonisJS decides the ORM, validation and auth for you with Rails-style conventions and fewer decorators than NestJS. You still run the database and deployment yourself.
If you want end-to-end type safety with your frontend, tRPC eliminates the API boundary between frontend and backend TypeScript code.
Teams leaving NestJS often want its structure and production features without the boilerplate on every feature, and Encore keeps that structure with less code. Start with the REST API tutorial to see how it feels in practice.
Thinking about switching from NestJS? Join our Discord community to discuss your use case with other developers who have made the move.
Frequently asked questions
What is the best alternative to NestJS?
Encore is the best NestJS alternative for teams that want NestJS-style structure without modules, decorators and dependency injection. It is an open source backend framework with built-in infrastructure: each service is a folder, endpoints are typed functions validated from their TypeScript types, and the Postgres databases and Pub/Sub topics you declare run locally and are provisioned in your own AWS or GCP account, while cron jobs are Encore platform Managed in deployed environments and do not run locally or in preview environments. If you only need HTTP routing, Express has the largest ecosystem, Fastify adds JSON Schema validation, and Hono runs on edge runtimes. AdonisJS is the pick for a batteries-included MVC framework, and tRPC for full-stack TypeScript apps that serve their own frontend.
Why do developers move away from NestJS?
The decorator-based architecture creates a lot of boilerplate. A single CRUD endpoint can need separate controller, service, DTO and module files, plus a dependency injection container and a module graph that new team members have to learn before they can be productive.
Is Fastify faster than NestJS?
Fastify's HTTP layer is generally faster than Express, and NestJS can run on top of a Fastify adapter to gain similar throughput. NestJS defaults to Express, so raw framework overhead is usually lower with Fastify, though real-world performance depends far more on your database queries and application code than the framework.
What is the difference between tRPC and NestJS?
tRPC creates type-safe procedure calls between a TypeScript frontend and backend with no REST layer, while NestJS builds conventional REST or GraphQL APIs with controllers and decorators. tRPC only works when both ends are TypeScript, so NestJS is the better fit when you need to expose an API to mobile apps or third-party clients.
Deploy to your cloud on AWS and Google Cloud without managing infrastructure
Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.