Bun-first backend framework on Hono + Drizzle, decorator-driven, OOP composition. Vertical-slice architecture: a Drizzle table is the single source of truth an entity, its DTOs, its validation, and its OpenAPI schema are all derived from.
Two packages, released together:
@donilite/wrap— the framework.@donilite/create-wrap—bunx @donilite/create-wrap@latestscaffolds a new project, interactively, across five profiles (full backend, lightweight API, API aggregator, fullstack SSR, proxy/gateway).
Where to start
- New to the framework? → Getting started
- Understand how the pieces fit together first → Architecture guide
- Looking for a specific class/function’s exact signature → API reference (one page per module)
- Scaffolding a new project / CLI profiles →
create-wrapCLI reference
Guides
| Guide | Covers |
|---|---|
| Architecture | Wrap, controller/service/repository layers, feature slices, parent → children composition |
| Auth | AuthController, presets, guard(), combine(), registry-typed identity |
| Offline-first sync | findChangedSince/applyBatch, cursors, conflict resolution |
| Swagger / OpenAPI | Spec generation, security schemes, tags, path params |
API reference
Every exported class, function, interface, and type, grouped by module — full signatures, every parameter, every option.
| Page | Module |
|---|---|
| Wrap | wrap.ts — the composition root |
| Controllers | base.controller.ts — RouterController, BaseController |
| Services | base.service.ts — WrapService, BaseService |
| Repositories | base.repository.ts — BaseRepository, offline sync |
| Auth | middleware/auth/* — AuthController, JwtCookieAuthController |
| Decorators | decorators/* — every @Decorator |
| DTO & Entity | dto.ts, entity.ts — BaseDTO, SchemaDTO, SelectDTO, InsertDTO, Entity(), relationsOf() |
| Swagger | swagger/index.ts — SwaggerGenerator, setupSwagger |
| Registry, database & lifecycle | registry.ts, database.ts, transaction.ts, events.ts |
| Realtime | realtime/index.ts — @donilite/wrap/realtime (Bun-only) |
| Testing | testing/index.ts — @donilite/wrap/testing |
| Helpers, storage, cache, middleware | Everything else in the barrel |
Package exports
import { /* ... */ } from "@donilite/wrap"; // everything except realtime/testing
import { /* ... */ } from "@donilite/wrap/realtime"; // Bun-only: WebSocket topics + Redis relay
import { /* ... */ } from "@donilite/wrap/testing"; // PGlite-backed test helpers