LangENKO

Mandu vs Hono

When the API layer is everything — Hono's router-as-library vs Mandu's full fullstack framework with built-in agent surface.

On this page

Mandu vs Hono

TL;DR — Hono is a router-as-library (~12 KB). Mandu is a full fullstack framework (router + React + build + Guard + MCP). They overlap on the API layer, but solve different problems beyond that.

When to pick which

You need… Pick
A 12 KB edge-first router for a pure API service Hono
To deploy to every edge runtime under the sun (Workers, Deno, Bun, Node, Lagon, Fastly) with one codebase Hono
API + React UI + content layer + tests + agent scaffolding in one framework Mandu
Type-safe contracts with auto OpenAPI + auto tests + auto client Mandu
Runtime architecture enforcement (Guard) Mandu

Side by side

Feature Hono Mandu 0.46
Scope API router (library) Fullstack framework
Bundle / install size ~12 KB core Framework — meaningful only at app level
Type-safe routes Strong (RPC mode) Strong (contract-derived)
Validation Hand-wired with zod-validator middleware Auto from Mandu.contract({...})
OpenAPI @hono/zod-openapi (manual wiring) Auto via mandu contract openapi
UI layer None — bring your own React, file-system pages, .island.tsx hydration
Architecture enforcement None Runtime Guard
AI agent surface None 100+ MCP tools
Test generation Manual ATE auto-generates contract tests
Edge runtimes Workers · Deno · Bun · Node · Lagon · Fastly · AWS Lambda — all first-class Workers · Vercel Edge · Deno Deploy · Netlify Edge — first-class

Code comparison — typed POST endpoint

Hono with zod-validator:

import { Hono } from "hono";
import { zValidator } from "@hono/zod-validator";
import { z } from "zod";

const app = new Hono();

app.post(
  "/signup",
  zValidator("json", z.object({ email: z.string().email(), password: z.string().min(8) })),
  async (c) => {
    const body = c.req.valid("json");
    const user = await db.user.create({ data: body });
    return c.json({ id: user.id }, 201);
  },
);

export default app;

Mandu — contract-first, response shape also locked in:

// spec/contracts/signup.contract.ts
export const signupContract = Mandu.contract({
  request:  { POST: { body: z.object({ email: z.string().email(), password: z.string().min(8) }) } },
  response: { 201: z.object({ id: z.string() }), 400: z.object({ error: z.string() }) },
});
// app/api/signup/route.ts
export default Mandu.handler(signupContract, {
  POST: async (ctx) => ({ id: (await ctx.db.user.create({ data: ctx.body })).id }),
});

The Mandu version validates request and response, exports OpenAPI for free, and generates a typed client. The Hono version is shorter for a single endpoint but each subsequent endpoint repeats the wiring.

When Hono wins

  • Pure API service, no UI, no content. Mandu's UI/build layer is overhead you don't need.
  • You target an edge runtime Mandu doesn't yet support first-class (Lagon, Fastly).
  • Embedding into an existing app where minimal dependency footprint matters.

When Mandu wins

  • You need API + React UI + docs/content in one repo.
  • You want one place to enforce architecture (FSD, Clean, Hexagonal — Guard ships 6 presets).
  • AI agents are doing significant scaffolding and you want them constrained by contracts and Guard.

🤖 Agent Prompt — port a Hono service to Mandu

🤖 Agent Prompt — Port Hono to Mandu
I have a Hono API service and I'm evaluating moving it under Mandu
(https://mandujs.com) so I can add a React UI in the same repo.

1. Pick 3 representative routes from my Hono app.
2. For each, show me the Mandu equivalent — contract file +
   handler using Mandu.handler(contract, ...).
3. Map Hono middleware to Mandu's filling chain `.use(...)`.
4. Identify any Hono-specific features I lose (edge adapters,
   bundler tricks).
5. Estimate the percentage of routes that port cleanly vs need
   rewriting.

For Agents

AI hint

Hono is a tiny edge-first router; Mandu is a fullstack framework that includes routing, React UI, build tooling, runtime guard, and 100+ MCP tools. Pick Hono if you only need an API; pick Mandu if you also want UI, contracts, and agent-driven scaffolding.