Compose your backend
from independent blades.
Damat is a composable backend framework for TypeScript, built on Bun. Assemble exactly what your app needs from plug-and-play modules — database, auth, billing, queues, workflows — each self-contained and installable with one command.
Everything a backend needs, nothing it doesn't
Instead of fighting a monolith's opinions, you assemble the building blocks your app actually uses.
Composable modules
Every concern — users, billing, teams — is a self-contained module with its own models, migrations, service, config, and workflows. Author in isolation, install anywhere.
Learn moreFluent ORM
A type-safe model DSL over PostgreSQL with a real migration system, service base classes, auto-generated CRUD, transactions, and connection pooling.
Learn moreSaga workflows
A workflow engine built on Effect-TS with compensation, retries, and distributed locks — orchestrate multi-step operations that fail gracefully.
Learn moreRedis utilities
Batteries-included cache, queues, locks, sessions, and rate limiting — wired up the moment you set a REDIS_URL.
Learn moreFile-based HTTP
Define endpoints with file-based routing on top of Hono. Handlers, middleware, and validation compose cleanly per module.
Learn moreUnified CLI
One `damat` command for dev, build, migrations, codegen, and module management — plus an MCP server so an AI can install modules for you.
Learn moreOne config, fully wired
Register modules by id. Damat does the wiring.
A single damat.config.ts declares your project config and the modules you want. At startup Damat connects each module to the database and HTTP server — models, migrations, services, routes, and workflows included.
- Modules are portable — author one in isolation, install it into any app.
- Installing a module updates this block for you and syncs its env vars.
- Compose and link modules so one can depend on another’s service.
import { defineConfig } from "@damatjs/framework";
export default defineConfig({
projectConfig: {
databaseUrl: process.env.DATABASE_URL ?? "",
redisUrl: process.env.REDIS_URL,
http: { port: 6543 },
},
// Register each module by id — Damat wires
// it to the DB and HTTP server at startup.
modules: {
user: { resolve: "./src/modules/user", id: "user" },
billing: { resolve: "@acme/billing", id: "billing" },
},
});A tidy package map
Damat is a Bun + Turborepo monorepo. You rarely import most packages directly — but everything is documented.
App framework
- framework
- services
- module
- link
- workflow-engine
ORM
- orm
- orm-model
- orm-pg
- orm-migration
- codegen
Core
- logger
- redis
- load-env
- types
- cli
CLIs & AI
- damat-cli
- orm-cli
- create-damat-app
- mcp
Build a modular backend in minutes
Scaffold an app, define a model, install a module, ship. The guide walks you from zero to a running backend.