Damat is a composable backend framework for TypeScript, built on Bun, Hono, Effect-TS, and PostgreSQL. Instead of one monolithic framework with fixed opinions, you assemble exactly what your app needs from independent, plug-and-play modules.
The core idea: every domain concern — users, billing, teams, webhooks — is a
self-contained module with its own models, migrations, service, config, and
optional route/workflow/durable providers. The backend owner registers and
composes those blades in damat.config.ts.
On top of the module system, Damat gives you:
- a fluent ORM with a type-safe model DSL and a real migration system,
- service base classes with auto-generated CRUD, transactions, and pooling,
- a saga/workflow engine (Effect-TS) with compensation and distributed locks,
- PostgreSQL-backed jobs and durable events with retries, leases, history, inspection, and controls,
- durable pipelines for persisted waits, branches, and multi-stage processes,
- file-based HTTP routing via Hono,
- Redis utilities and optional acceleration for cache, pub/sub, locks, sessions, rate limiting, wake-ups, and invalidations,
- a unified CLI for dev, build, migrations, codegen, and module management.
New here? Read Concepts next for the mental model, then jump to Getting started.
The package map
Damat is a Bun + Turborepo monorepo. Import APIs from the package that owns the
capability; @damatjs/framework also re-exports the app-facing runtime surface.
| Layer | Packages |
|---|---|
| App framework | @damatjs/framework · @damatjs/services · @damatjs/module · @damatjs/module-generator |
| ORM | @damatjs/orm (umbrella) · orm-model · orm-pg · orm-connector · orm-migration · orm-processor · orm-core · orm-type |
| Orchestration | @damatjs/workflow-engine · @damatjs/durability · @damatjs/jobs · @damatjs/events · @damatjs/pipelines |
| Core | @damatjs/logger · @damatjs/redis · @damatjs/schema-codegen · @damatjs/load-env · @damatjs/types · @damatjs/cli · @damatjs/deps |
| Providers | @damatjs/provider · @damatjs/provider-auth · @damatjs/provider-payment · @damatjs/provider-subscription |
| CLIs | @damatjs/damat-cli (damat) · @damatjs/cli-codegen · @damatjs/orm-cli (damat-orm) |
| AI | @damatjs/mcp (module install over MCP) |
| Reference app | @damatjs/default |
Each package ships a README.md (overview) and a docs/ folder (internals).
The Package reference chapter links them all.