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-wrapbunx @donilite/create-wrap@latest scaffolds a new project, interactively, across five profiles (full backend, lightweight API, API aggregator, fullstack SSR, proxy/gateway).

Where to start

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.tsRouterController, BaseController
Services base.service.tsWrapService, BaseService
Repositories base.repository.tsBaseRepository, offline sync
Auth middleware/auth/*AuthController, JwtCookieAuthController
Decorators decorators/* — every @Decorator
DTO & Entity dto.ts, entity.tsBaseDTO, SchemaDTO, SelectDTO, InsertDTO, Entity(), relationsOf()
Swagger swagger/index.tsSwaggerGenerator, 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

This site uses Just the Docs, a documentation theme for Jekyll.