6 min readUpdated: November 24, 2026

Why I Picked Bun and Hono for QuotyAI's Backend

A bounded case for Bun and Hono on a solo-founder TypeScript backend: less framework ceremony, typed request contracts, and tradeoffs you should audit before switching.

Available in:

I didn’t want to rewrite the backend.

In the original April 11, 2026 post, I described a working NestJS backend that handled Facebook webhooks, connected to MongoDB, and calculated prices. It worked—but adding an endpoint felt like opening a 1,000-page government form. There would be thirty minutes of ceremony before the one line that mattered.

I didn’t rewrite it in Rust. I rewrote it in Bun and Hono. It remains one of the best decisions I made for this project, with a few important qualifications added since then.

“Optimize for your constraints, not everyone else’s best practices.”

The Decision Matrix

I had three real options:

  1. Keep NestJS on Node.js.
  2. Rewrite in .NET 10.
  3. Move to Hono or ElysiaJS on Bun.

My criteria were simple: one developer, one language across the stack, strict types, and a framework that coding agents could work with without inventing an enterprise architecture.

Option 1: Keep NestJS

NestJS gives a team conventions: modules, providers, controllers, decorators, and a documented structure. For a growing team, that is valuable.

For me, the friction was the distance between a small endpoint and the number of files and annotations required to expose it. In my April 2026 notes, I reported roughly 50,000 lines of working code, 20-second rebuilds, and several hours a week waiting on the toolchain. Those are personal observations, not controlled benchmarks.

The module-system complaints were real too. TypeScript with NodeNext commonly requires .js specifiers that point to .ts source files. Mixed ESM/CommonJS dependencies can still cause friction.

Bun reduces that friction; it does not abolish it. Bun runs TypeScript directly, resolves many extensionless imports, and handles a lot of CommonJS/ESM interop. But packages can still depend on Node internals, native addons, or behavior Bun does not replicate exactly. The right claim is “fewer module-system problems in this project,” not “no module-system problems anywhere.”

Option 2: Rewrite in .NET 10

I am a .NET developer and I still like it. For a team, an enterprise product, or a system with demanding background processing, .NET would be a serious choice.

My earlier post went further: it called .NET the objectively better general-purpose backend and claimed TypeScript was years behind for queues and distributed workflows. That was too absolute.

Both ecosystems can build reliable background systems. The difference is which primitives, hosting model, and operational knowledge your team already has. If reliable job processing is the center of your product, evaluate .NET, a durable TypeScript workflow engine, or a dedicated queue on their merits.

My narrower reason for staying TypeScript was integration velocity. QuotyAI uses SDKs and examples for LLMs, real-time communication, and messaging. In April 2026, most of the tools I evaluated had first-class TypeScript examples. That does not mean every SDK ships in TypeScript months before .NET; I no longer make that universal claim.

I also reported that agents wrote about 90% of this project’s code and often added unnecessary C# abstractions. That is a self-reported workflow observation, not a benchmark of model quality. Agent output varies by model, prompt, context, and repository conventions.

Option 3: Hono on Bun

I tried ElysiaJS too. Its functional composition is capable and pleasant for many developers; it simply did not match my taste.

Hono felt like ordinary request handling:

import { Hono } from 'hono';

const app = new Hono();

app.get('/health', (c) => c.json({ ok: true }, 200));

The core is small and has no runtime dependencies. It handles routing and Web Standards requests/responses. Validation, OpenAPI, dependency injection, and most production concerns come from middleware or your own modules. That is the trade: less scaffolding, more ownership.

Bun contributes fast startup, native TypeScript execution, a package manager, a test runner, and APIs such as Bun.SQL. The current stable release was 1.4.5 on the snapshot date. Check the Bun release notes for the exact version you deploy.

The Real Win: One Schema for Validation and Documentation

The biggest improvement was not raw speed. It was defining a request contract once and reusing it.

Here is the shape of a current hono-openapi route:

import { Hono } from 'hono';
import {
  validator as zValidator,
  resolver,
  describeRoute,
} from 'hono-openapi';
import { z } from 'zod';

const FactsSchema = z.object({
  facts: z.array(z.object({
    content: z.string(),
    tags: z.array(z.string()),
  })),
});

const app = new Hono();

app.post(
  '/facts',
  describeRoute({
    responses: {
      200: {
        description: 'Facts accepted',
        content: {
          'application/json': {
            schema: resolver(z.object({ ok: z.boolean() })),
          },
        },
      },
    },
  }),
  zValidator('json', FactsSchema),
  (c) => c.json({ ok: true }, 200),
);

This gives you runtime validation and input documentation from the same Zod schema. It does not automatically produce perfect descriptions, examples, authentication metadata, or every error response. hono-openapi is also a separate package still under active development.

In April 2026, I reported completing the migration in three days and removing roughly 2,000 lines of ceremony. Treat that as a dated anecdote about one migration, not a forecast for yours. The current repository is much larger and has changed substantially since that rewrite.

Diagram comparing NestJS boilerplate with Hono validation and OpenAPI definitions derived from one schema

The Cost of Admission

Here is what I give up:

  • Conventions. Hono does not impose a module architecture. A large team needs agreed rules or the codebase will drift.
  • A complete platform. Database access, queues, auth, tracing, and deployment remain your responsibility.
  • Universal npm compatibility. Bun is strong, but dependencies that rely on Node-specific behavior still need testing.
  • Cheap type inference at every scale. Hono’s RPC types are powerful, but large route graphs can stress TypeScript and the IDE.
  • Automatic safety. Types cannot validate authorization, business rules, or untrusted runtime input by themselves.

My earlier “MongoDB driver had a memory leak last week” line was a stale relative-time anecdote from April 2026, not a current defect report. I removed it rather than implying an unfixed issue today.

Current Repository Snapshot

Package constraints checked on 2026-11-24:

Layer Repository constraint
Runtime Bun (@types/bun ^1.4.5)
HTTP framework Hono ^4.13.19
WebSocket Socket.IO ^4.8.4 + @socket.io/bun-engine ^0.1.2
DI tsyringe ^4.10.0
Validation Zod 4.6.7
Database MongoDB driver ^7.9.1
AI orchestration LangChain ^1.6.7 + LangGraph ^1.7.5
Logging LogTape ^2.4.2

The backend currently mounts 33 Hono sub-apps and shares one Bun process with Socket.IO. That is a repository fact, not a recommendation that every application should run in one process.

Decision flow for choosing between NestJS, .NET, and Bun with Hono based on team size, runtime needs, and dependency constraints

The Verdict

For QuotyAI, Bun and Hono are still a good fit. I can add a typed endpoint without building a module hierarchy, and the TypeScript contracts are reusable across the backend and generated clients.

I would not call the stack perfect, and I would not tell every team to switch. If you need strong conventions, a large hiring pool, or a batteries-included application framework, NestJS or .NET may serve you better.

The point is not that Hono writes the code for you. The point is that it gives a small team fewer framework-specific layers to maintain while keeping the important TypeScript boundaries visible.

Frequently Asked Questions

Why choose Bun and Hono over NestJS? For QuotyAI, Bun reduced friction around running TypeScript and installing packages, while Hono made routing and typed request contracts compact. NestJS still offers more built-in structure for larger teams. Startup and build timings are anecdotal and depend on the application, machine, and toolchain.

Does Bun eliminate ESM and CommonJS problems? No. Bun handles many mixed-module cases smoothly and supports TypeScript execution without a separate build step, but it cannot guarantee that every npm package or Node-specific API behaves identically. Test your dependency tree rather than assuming compatibility.

Does Hono generate OpenAPI automatically? Hono’s core does not generate OpenAPI. Packages such as hono-openapi can derive a specification from validation schemas and route metadata. You still need to describe responses, security requirements, and error shapes; the output is only as complete as the annotations.

What are the tradeoffs of Bun and Hono? You get less framework ceremony, but you also own more decisions: project structure, observability conventions, background jobs, testing patterns, and dependency compatibility. Bun’s Node compatibility is strong but not universal, and Hono’s type inference can make large route graphs expensive for TypeScript.

Sources


Tags: bun hono backend typescript ai-development

Found this useful? Share it.

Related articles