Comparisons
How Cleverbrush compares to popular TypeScript frameworks. We aim to be precise — where competitors are ahead, we say so.
Before
- RPC-only clients or server-first routing
- OpenAPI and validation often live in separate tools
- Retry, timeout, cache, auth, and DI are assembled later
with Cleverbrush→
After
- Contract-first REST with an auto-typed client
- OpenAPI 3.1 comes from the same endpoint contract
- Resilience, auth, DI, and forms share schema metadata
Feature matrix
| Feature | Cleverbrush | tRPC | ts-rest | Hono |
|---|---|---|---|---|
| API style | REST (contract-first) | RPC only | REST (contract-first) | REST (server-first) |
| Typed client | Zero codegen, Proxy-based | Yes | Yes | hc helper |
| Exhaustive handler mapping | mapHandlers() compile error | No | Yes (Express/Fastify) | No |
| OpenAPI generation | Full 3.1 (links, callbacks, webhooks) | @trpc/openapi (alpha) | @ts-rest/open-api | @hono/zod-openapi |
| Client retry & timeout | Built-in with backoff + jitter | Via TanStack Query | DIY | No client-side |
| Client dedup & batching | Both built-in | Batching via httpBatchLink | No | No |
| Client caching | Built-in TTL cache | Via TanStack Query | No | No |
| Auth | JWT, cookies, OAuth2, OIDC, RBAC | Context pattern | DIY | Basic/Bearer/JWT middleware |
| Dependency injection | Schema-as-key, .NET-style | No | No | No |
| WebSocket subscriptions | Typed, bidirectional, reconnect | Yes, with tracked events | No | Via WebSocket Helper |
| Schema-driven forms | @cleverbrush/react-form | No | No | No |
| Multi-runtime | Node.js | Node.js, Bun, Deno, CF Workers | Node.js (adapters) | All major runtimes |
| Schema library | @cleverbrush/schema (own) | Any (Zod, Valibot, etc.) | Zod, Valibot, ArkType | Zod (via @hono/zod-openapi) |
vs tRPC
Where Cleverbrush is stronger
- Standard REST endpoints — tRPC uses RPC semantics exclusively. Cleverbrush produces standard REST endpoints that work with any HTTP client, not just the tRPC client.
- Client resilience — built-in retry with exponential backoff + jitter, timeout, deduplication, TTL caching, and request batching. tRPC relies on TanStack Query for retry/cache.
- Integrated auth & DI — JWT, OAuth2, OIDC, policy-based authorization, and schema-driven dependency injection. tRPC uses a manual context pattern.
- OpenAPI completeness— response links, callbacks, webhooks, response headers, and security schemes. tRPC's OpenAPI support is alpha-stage.
- Schema-driven forms — generate headless React forms from the same schemas used by the server.
Where tRPC is stronger
- Community & ecosystem — 36k+ GitHub stars, extensive tutorials, adapter ecosystem, and widespread adoption.
- Multi-runtime — tRPC works in Cloudflare Workers, Deno, Bun, AWS Lambda, and more. Cleverbrush currently targets Node.js.
- Any validator — tRPC works with Zod, Valibot, ArkType, Yup, and any Standard Schema validator. Cleverbrush uses its own schema library (which supports Standard Schema and can wrap other validators via
extern()).
Code comparison: defining an endpoint
Cleverbrush
// contract.ts — shared between server and client
const api = defineApi({
users: {
create: endpoint.post('/api/users')
.body(CreateUserBody)
.returns(User)
}
});
// server.ts — exhaustive handler mapping
mapHandlers(server, api, {
users: {
create: async ({ body }) => db.users.insert(body)
}
});
// client.ts — zero codegen
const client = createClient(api, { baseUrl });
const user = await client.users.create({ body: { name: 'Alice' } });tRPC
// server.ts — define procedures inline
const appRouter = router({
createUser: publicProcedure
.input(z.object({ name: z.string() }))
.mutation(async ({ input }) => db.users.insert(input))
});
type AppRouter = typeof appRouter;
// client.ts — needs the server type
const trpc = createTRPCClient<AppRouter>({ links: [...] });
const user = await trpc.createUser.mutate({ name: 'Alice' });vs ts-rest
ts-rest is the closest competitor architecturally — both use contract-first REST with typed clients.
Where Cleverbrush is stronger
- Client resilience — retry, timeout, deduplication, caching, and batching are all built-in. ts-rest provides a lightweight fetch client with no resilience features.
- Auth & DI — integrated JWT, OAuth2, OIDC, policy-based authorization, and schema-driven DI. ts-rest has no auth or DI system.
- WebSocket subscriptions — typed bidirectional channels with automatic reconnection. ts-rest has no WebSocket support.
- OpenAPI completeness — typed response links, callbacks, webhooks, and response headers. ts-rest generates basic OpenAPI specs.
- Schema-driven forms & mapping — the schema powers form generation and object mapping with compile-time completeness checking.
Where ts-rest is stronger
- Server adapter ecosystem — ts-rest works with Express, Fastify, Next.js, and NestJS. Cleverbrush has its own server.
- Validator agnostic — ts-rest works with Zod, Valibot, and ArkType out of the box.
- Community — more established with a growing ecosystem and community resources.
vs Hono
Hono is a lightweight, multi-runtime web framework. Different philosophy — Hono is server-first and runtime-flexible; Cleverbrush is schema-first and full-stack.
Where Cleverbrush is stronger
- Contract-first architecture— shared contract with exhaustive handler mapping. Hono's
hcclient infers types fromtypeof appwhich can cause IDE performance issues in large apps. - Client resilience— built-in retry, timeout, deduplication, caching, batching. Hono's
hcis a minimal fetch wrapper. - Auth & DI — comprehensive auth system with OAuth2, OIDC, and policy-based authorization. Hono has basic auth/JWT middleware but no authorization framework or DI container.
- Full-stack integration — schemas drive server endpoints, client types, OpenAPI, forms, DI, and object mapping. Hono focuses on the server layer only.
Where Hono is stronger
- Multi-runtime — runs on Cloudflare Workers, Deno, Bun, AWS Lambda, Fastly, and more. Cleverbrush currently targets Node.js.
- Middleware ecosystem — 20+ built-in middleware (CORS, ETag, compress, logger, etc.) plus third-party packages.
- Lightweight & fast — optimized for edge runtimes with minimal overhead.
- Community — large, active community with extensive tutorials and production usage.
Schema library comparison
@cleverbrush/schema is the foundation. For detailed benchmarks, bundle size comparisons, and feature matrix vs Zod, Valibot, ArkType, and TypeBox, see the dedicated schema site:
Where we're honest about gaps
- Multi-runtime support — currently Node.js only. Cloudflare Workers, Deno, and Bun support is planned.
- Community size — pre-1.0 vs established ecosystems with thousands of stars and extensive community resources.
- Server adapter flexibility — Cleverbrush has its own server rather than adapters for Express/Fastify/Next.js.
- Validator lock-in — built around
@cleverbrush/schema. Theextern()wrapper allows using Zod/Valibot schemas inside Cleverbrush schemas for incremental adoption.