Skip to content

Repository files navigation

@crumbjs/core | Build, Validate & Document APIs. Fast.

CrumbJS Logo

- The tasty way to build fast apis.

License Bun Buy Me a Coffee

Full Documentation Page

CrumbJS is a lightweight API framework for Bun focused on backend development. It layers configuration, validation and documentation on top of Bun's built-in router while keeping a familiar Express-like developer experience. Validation is powered by Zod and every route can be automatically documented through OpenAPI.

The core system has only about 3,700 lines of code and just two dependencies (zod and openapi3-ts).

Features

  • Built for Bun.serve and only targets backend APIs
  • Zod-based validation for bodies, queries and headers
  • Automatic OpenAPI 3.1 document generation and UI (Swagger or Scalar)
  • Auto-generate type-safe clients (eg. for frontend), with zero allocations.
  • Simple middleware system and optional global middlewares
  • Simple proxy helpers to forward requests and (optionally) document them — use app.proxy() for a single route, or app.proxyAll() to forward all routes under a given path.

Included middlewares

  • cors
  • signals (log incomming request)
  • secureHeaders

Official Plugins

  • @crumbjs/bullmq -> Bullmq worker aside CrumbJS server. For simple redis queue system
  • @crumbjs/mongo -> Mongo connection handler, AUTO-CRUD! and simple repository provider based on zod

Documentation

Full Documentation Page

Contribute

The best contribution is to use CrumbJS in the wild. If you want to go further:

Thanks for helping us keep the framework lean, type-safe, and fast to ship.

Releases

Packages

Contributors

Languages