v1.0.6
- @damatjs/cliRepeatable command options now preserve every supplied value.
- @damatjs/cli-appGenerated backends now choose their runtime environment from
NODE_ENV.
+23 more packages
Open source, built on Bun. Assemble models, services, routes, and workflows from plug-and-play modules — installed with one command, wired to your database and HTTP server at startup.
Self-contained features you author in isolation and install anywhere.
Typed models over PostgreSQL with real migrations and generated CRUD.
File-based routes on Hono with per-route validation and middleware.
Multi-step sagas with retries, timeouts, and compensation.
One CLI for everything — exposed to AI agents over MCP.
import { defineConfig } from "@damatjs/framework"; export default defineConfig({ projectConfig: { databaseUrl: process.env.DATABASE_URL!, redisUrl: process.env.REDIS_URL, http: { port: 6543 }, }, modules: { user: { resolve: "./src/modules/user", id: "user" }, // ← added },});Framework
Each capability is a first-class part of the framework — built to compose with the others, documented end to end, and replaceable module by module.
src/modules/billing/
├─ models/table-named
├─ service.tstyped CRUD
├─ config/zod-validated
├─ migrations/reversible
└─ workflows/sagas
Every concern — users, billing, teams — is a module with its own models, migrations, service, config, and workflows.
Learn moremodel("users", {
id: columns.id({ prefix: "usr" }),
email: columns.text().unique(),
sessions: columns.hasMany("sessions"),
}).timestamps();
A type-safe model DSL over PostgreSQL with real migrations, generated CRUD, transactions, and pooling.
Learn moreMulti-step operations on Effect-TS with per-step compensation, retries, timeouts, and distributed locks.
Learn moreroutes/posts/route.ts→POST/api/posts
routes/users/[userId]/→GET/api/users/:userId
Routes map from files on top of Hono. Handlers, middleware, and zod validation compose cleanly per module.
Learn moreREDIS_URL=redis://localhost:6379
Cache, queues, locks, sessions, and rate limiting — available the moment you set a REDIS_URL.
Learn more$ damat dev · build · codegen · module add
or let your agent drive it over MCP
A single damat command for dev, build, migrations, codegen, and module management — exposed to agents over MCP.
Learn moreDeveloper experience
Real Damat code, not pseudocode. Define a model and the table, migration, and CRUD service come with it. Add a route file and it mounts. Failed workflow steps roll themselves back.
import { model, columns } from "@damatjs/orm-model";
export const UserModel = model("users", {
id: columns.id({ prefix: "usr" }).primaryKey(),
email: columns.text().unique(),
emailVerified: columns.boolean().default(false),
name: columns.text().nullable(),
// relations reference the target table name
accounts: columns.hasMany("accounts"),
sessions: columns.hasMany("sessions"),
})
.indexes([columns.indexes().columns(["email"]).unique()])
.timestamps(); // adds createdAt / updatedAtThe registry
Pull a module from the registry, a git URL, or a local path. Every registry entry carries an owner and a verification status — gate installs with DAMAT_MODULE_VERIFY=require.
Authentication, sessions and accounts — drop-in users, credentials, and session management for any Damat app.
Stripe subscriptions and one-time credits — plans, checkout, webhooks, and a credits ledger.
your-org/your-module
Scaffold a module offline with damat module init, build and test it on its own, then publish it from any git repo.
Add auth to my app.
⚙ add_module { source: "damatjs/user" }
✓ registered "user" in damat.config.ts
✓ env keys synced → .env
Done — run bun damat-orm migrate:up to apply the 4 new tables.
Changelog
Every package releases together under one version, each with a before/after note and exact upgrade steps — no archaeology required.
NODE_ENV.+23 more packages
+17 more packages
Open source
The framework, the ORM, the workflow engine, the CLI, the docs, and the registry index all live side by side in a single MIT-licensed monorepo. What you deploy is code you can read — and every release ships a note saying exactly what changed and how to move to it.
FAQ
The short version of what people ask first. Everything here is covered in depth in the guide.
Damat is an open-source, composable backend framework for TypeScript on Bun. You assemble a backend from plug-and-play modules — models, services, HTTP routes, and workflows — wired to PostgreSQL and an HTTP server at startup.
A starter template copies code into your repo that you maintain forever. A Damat module is a versioned, self-contained package: installing it wires its models, service, config, and migrations into your app, and upgrading it is a version bump rather than a manual merge.
Three sources: the module registry (entries carry an owner and a verification status), any git URL pinned to a branch or tag, or a local path on disk. Installs can be gated to verified entries with DAMAT_MODULE_VERIFY=require.
Bun as the runtime, Hono for HTTP, Effect-TS for typed business logic, PostgreSQL as the system of record, and Redis for caching — all strict-mode TypeScript end to end.
Yes. Damat ships an MCP server that lets AI assistants list, search, inspect, and install registry modules directly into an app.
Yes — MIT licensed, developed in a single public monorepo on GitHub. All packages release in lockstep, so there is one version to care about.
Scaffold an app, define a model, install a module, ship. The guide takes you from zero to a running backend.