Updated Nov 12, 202617 min read

NestJS Alternatives in 2026

Six TypeScript backend frameworks for teams that want less NestJS boilerplate, ranked, with versions, code and what each one asks you to give up.

Illustration for NestJS Alternatives in 2026

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.

What are the best NestJS alternatives at a glance?

RankAlternativeLatest versionWhy it is on this list
1Encorev1.58.8Backend 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
2Expressv5.3.0Largest ecosystem and no imposed architecture
3Fastifyv5.12.8Schema-validated APIs and a plugin system
4Honov4.13.18Smallest footprint, runs on edge runtimes
5AdonisJSv7.6.0Batteries-included MVC framework with an ORM, validation and auth
6tRPCv11.28.0End-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.

FeatureEncoreExpressFastifyHonoAdonisJStRPC
Primary use caseBackends with built-in infrastructureGeneral purpose APIsSchema-validated APIsEdge and serverlessFull-stack MVC appsType-safe API layer for your own frontend
ArchitectureServices and infrastructure declarationsMiddleware chainPluginsMiddleware chainMVC with an IoC containerProcedures and routers
Built-in validationYes(from TypeScript types)NoYes(JSON Schema)Via middlewareYes(VineJS)Yes(Zod or similar)
DatabasePostgres declared in code, provisioned for youBring your ownBring your ownBring your ownLucid ORM, you run the databaseBring your own
Built-in tracingYesNoNoNoNoNo
Infrastructure from codeYesNoNoNoNoNo
Dependency injectionNot neededNoNoNoYes(IoC container)No
Generated API docsYesNoVia pluginsVia pluginsNoNo

Why is Encore the first NestJS alternative?

Encore

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 = new SQLDatabase("orders", { migrations: "./migrations" }); export const orderPlaced = new Topic<{ orderId: number }>("order-placed", { deliveryGuarantee: "at-least-once", }); // A typed endpoint. Requests are validated against these types; no DTO class or pipe. export const 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. export const cancelStale = api({}, async (): Promise<void> => { await db.exec`UPDATE orders SET status = 'cancelled' WHERE status = 'pending' AND created_at < NOW() - INTERVAL '2 days'`; }); const _ = new CronJob("cancel-stale-orders", { title: "Cancel stale pending orders", every: "6h", endpoint: cancelStale, });

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.

Key features

  • 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
  • Streaming APIs with WebSocket support
  • Open source under MPL-2.0, used by teams like Groupon and Echo

Can you keep your NestJS code?

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.

What are the tradeoffs?

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 should you consider Encore?

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.

How do you try Encore?

Install the CLI with brew install encoredev/tap/encore, then create an app with encore app create:

Get started
brew install encoredev/tap/encore &&
encore app create
Copy

Run in your terminal to get started locally.

See the Encore documentation, follow the REST API tutorial to build a complete application, or read Encore AI integration for using Encore with AI coding agents.


Is Express.js a good NestJS alternative?

Express

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.

import express from 'express'; import { z } from 'zod'; const app = express(); app.use(express.json()); const CreateUserSchema = z.object({ email: z.string().email(), name: z.string().min(1), }); app.post('/users', async (req, res) => { const result = CreateUserSchema.safeParse(req.body); if (!result.success) { return res.status(400).json({ errors: result.error.issues }); } const user = await createUser(result.data); res.status(201).json(user); }); app.get('/users/:id', async (req, res) => { const user = await getUserById(req.params.id); res.json(user); }); app.listen(3000);

Key features

  • Minimal core with the largest middleware ecosystem
  • Flexible routing with no architectural opinions
  • Template engine support for server-rendered pages
  • Static file serving out of the box

Benefits

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.

Limitations

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.

When should you pick Express?

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.

For a detailed comparison, see our Express.js vs Encore article.

Try Express →


Is Fastify a good NestJS alternative?

Fastify

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.

import Fastify from 'fastify'; const fastify = Fastify({ logger: true }); fastify.post('/users', { schema: { body: { type: 'object', required: ['email', 'name'], properties: { email: { type: 'string', format: 'email' }, name: { type: 'string', minLength: 1 } } }, response: { 201: { type: 'object', properties: { id: { type: 'number' }, email: { type: 'string' }, name: { type: 'string' } } } } } }, async (request, reply) => { const user = await createUser(request.body); reply.code(201); return user; }); fastify.listen({ port: 3000 });

Key features

  • JSON Schema validation with automatic serialization
  • Plugin-based architecture with encapsulated scopes
  • Built-in Pino logging integration
  • First-class TypeScript support
  • OpenAPI generation from schemas

Benefits

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.

Limitations

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.

When should you pick Fastify?

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.

For a deeper comparison, see our Fastify vs Encore article.

Try Fastify →


Is Hono a good NestJS alternative?

Hono

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.

import { Hono } from 'hono'; import { zValidator } from '@hono/zod-validator'; import { z } from 'zod'; const app = new Hono(); const createUserSchema = z.object({ email: z.string().email(), name: z.string().min(1), }); app.post('/users', zValidator('json', createUserSchema), async (c) => { const data = c.req.valid('json'); const user = await createUser(data); return c.json(user, 201); }); app.get('/users/:id', async (c) => { const id = c.req.param('id'); const user = await getUserById(id); return c.json(user); }); export default app;

Key features

  • Universal runtime support (Node.js, Deno, Bun, Cloudflare Workers)
  • Minimal bundle size for edge deployment
  • Built-in middleware for JWT, CORS, logging
  • Clean, Express-like API
  • First-class TypeScript support

Benefits

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.

Limitations

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.

When should you pick Hono?

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.

Try Hono →


Is tRPC a good NestJS alternative?

tRPC

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.

import { initTRPC } from '@trpc/server'; import { z } from 'zod'; const t = initTRPC.create(); const appRouter = t.router({ getUser: t.procedure .input(z.object({ id: z.number() })) .query(async ({ input }) => { return await getUserById(input.id); }), createUser: t.procedure .input(z.object({ email: z.string().email(), name: z.string().min(1), })) .mutation(async ({ input }) => { return await createUser(input); }), }); export type AppRouter = typeof appRouter;

Key features

  • End-to-end type safety between frontend and backend
  • No code generation required
  • Zod-based input validation
  • Subscriptions support for real-time data
  • Works with React Query, Next.js, and other frontend frameworks

Benefits

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.

Limitations

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.

When should you pick tRPC?

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.

Try tRPC →


Is AdonisJS a good NestJS alternative?

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.

// app/validators/user.ts import vine from '@vinejs/vine' export const createUserValidator = vine.create({ email: vine.string().email(), name: vine.string().minLength(1), }) // app/controllers/users_controller.ts import type { HttpContext } from '@adonisjs/core/http' import { createUserValidator } from '#validators/user' import User from '#models/user' export default class UsersController { async store({ request, response }: HttpContext) { const payload = await request.validateUsing(createUserValidator) const user = await User.create(payload) return response.created(user) } }

When should you pick AdonisJS?

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.

Try AdonisJS →


Which NestJS alternative works best with AI coding agents?

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.

How do you choose a NestJS alternative?

Start at the top and follow the first question you can answer with a yes:

Question 1

Do you want NestJS-style structure plus infrastructure from code, without the boilerplate or a DevOps team?

Yes →
EncoreServices, typed APIs, and infrastructure provisioned in your own AWS or GCP account
Question 2

Are you building several services that share databases, Pub/Sub, or cron jobs?

Yes →
EncoreType-safe service calls and built-in tracing
Question 3

Do you need high request throughput from a Node.js backend?

Yes →
EncoreRust-based runtime with 9x the throughput of Express.js
Question 4

Are you targeting edge runtimes like Cloudflare Workers?

Yes →
HonoThe lightest option with the broadest runtime support
Question 5

Do you want end-to-end type safety between a TypeScript frontend and backend?

Yes →
tRPCProcedures typed straight through to the client
Question 6

Do you want schema-driven validation and OpenAPI docs, without class-based architecture?

Yes →
FastifyJSON Schema validation and a plugin system
Question 7

Do you want a batteries-included MVC framework with an ORM, validation and auth decided for you?

Yes →
AdonisJSRails-style conventions in TypeScript
Question 8

Do you want maximum flexibility and are happy to assemble everything yourself?

Yes →
ExpressNo imposed architecture

The throughput figure comes from our performance benchmark.

In more detail:

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.

For a broader comparison, see our Best TypeScript Backend Frameworks guide.

Start with the quickstart to see how Encore compares.


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.

~/orders — claude
Claude Code
Claude Code v2.1.180Opus 5.5~/orders