Damat
Backends composed from modules

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.

$ bunx create-damat-app@latest my-app
Built onBunHonoEffect-TSPostgreSQL

Everything a backend needs, nothing it doesn't

Instead of fighting a monolith's opinions, you assemble the building blocks your app actually uses.

One 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.
How composing & linking works
damat.config.ts
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.

Read the guide
$ bunx create-damat-app@latest my-app