1. Introduction
Damat is a composable backend framework for TypeScript, built on Bun, Hono, Effect-TS, Better Auth, 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
workflows. You register modules in a single damat.config.ts; Damat wires them
to the database and HTTP server at startup. Modules are portable: author one in
isolation, then install it into any Damat app with a single command (or let an
AI assistant do it for you).
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,
- file-based HTTP routing via Hono,
- Redis utilities for cache, queues, locks, sessions, and rate limiting,
- 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. You rarely import most packages directly —
the app-facing ones are @damatjs/framework, @damatjs/orm-model, and (for
standalone modules) @damatjs/module.
| Layer | Packages |
|---|---|
| App framework | @damatjs/framework · @damatjs/services · @damatjs/module |
| ORM | @damatjs/orm (umbrella) · orm-model · orm-pg · orm-connector · orm-migration · orm-processor · orm-core · orm-type |
| Workflows | @damatjs/workflow-engine |
| Core | @damatjs/logger · @damatjs/redis · @damatjs/codegen @damatjs/load-env · @damatjs/types · @damatjs/cli · @damatjs/deps |
| CLIs | @damatjs/damat-cli (damat) · @damatjs/orm-cli (damat-orm) · @damatjs/create-damat-app |
| 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.