One Model, Several Layers
DocTypes drive database tables, standard forms, lists, REST endpoints, and generated TypeScript interfaces automatically.
Build business applications from TypeScript models. Define your data dictionary once; ddcore drives database tables, forms, lists, APIs, and access controls automatically.
MIT-licensed · Data Driven Core (Go + TypeScript + PostgreSQL) · Self-hosted
Install the standalone ddcore command-line tool on macOS or Linux:
curl -fsSL https://raw.githubusercontent.com/jrvidotti/ddcore/main/install.sh | shNote: This command installs the
ddcoreCLI binary to~/.local/bin(or/usr/local/bin). To create an application and connect it to PostgreSQL, follow the step-by-step Build Your First App guide.
In ddcore, you define business entities as DocTypes in TypeScript. The engine takes care of the schema, validation, REST endpoints, and UI:
// doctypes/task/task.doctype.ts
import { defineDoctype } from "@ddcore/sdk";
export default defineDoctype({
name: "Task",
module: "Projects",
label: "Task",
naming: { field: "code" },
titleField: "title",
trackChanges: true,
fields: [
{ fieldname: "code", fieldtype: "Data", label: "Code", reqd: true, unique: true, inListView: true },
{ fieldname: "project", fieldtype: "Link", label: "Project", options: "Project", reqd: true, inListView: true },
{ fieldname: "title", fieldtype: "Data", label: "Title", reqd: true, inListView: true },
{ fieldname: "priority", fieldtype: "Select", label: "Priority", options: ["Low", "Medium", "High"], default: "Medium" },
{ fieldname: "status", fieldtype: "Select", label: "Status", options: ["Open", "In progress", "Completed"], default: "Open" },
{ fieldname: "due_date", fieldtype: "Date", label: "Due date", reqd: true, inListView: true },
],
permissions: [
{ role: "Project Manager", read: true, write: true, create: true, delete: true },
{ role: "Project Contributor", read: true, write: true, create: true },
],
});Server-side business rules are written synchronously in controllers:
// doctypes/task/task.controller.ts
import { defineController, _ } from "@ddcore/sdk";
import type { Task } from "../../.ddcore/types";
export default defineController<Task>("Task", {
validate(doc) {
const projectStart = ddcore.db.getValue<string>("Project", doc.project!, "start_date");
if (projectStart && doc.due_date && doc.due_date < projectStart) {
ddcore.throw(_("The due date cannot be earlier than the project start ({0}).", [projectStart]), {
title: _("Invalid due date"),
});
}
},
});Once defined, ddcore migrate automatically creates the PostgreSQL table tab_task, indexes, and generated TypeScript types. Running ddcore dev starts the application with automatic hot reload and an interactive Desk at http://localhost:8090.
Test the live demo, explore the complete reference implementation in the ddcore-demo repository, and read the Example App Walkthrough.
Why "Data Driven Core"?
In ddcore, your data dictionary (DocType) is the single source of truth that drives all application layers: PostgreSQL relational schemas, REST APIs, reactive Svelte 5 Desk screens, strict TypeScript types, and permission rules.
A single DocType declaration creates:
/api/v1/document/:doctype) with field-level permissions..ddcore/types.d.ts for strict typing across controllers and desk scripts.Controllers run inside an embedded JavaScript engine (goja) synchronously without async/await. Each mutation runs inside a single PostgreSQL transaction:
ddcore.throw()), the database transaction is cleanly rolled back.The user interface is powered by Svelte 5 and embedded directly inside the Go binary:
defineForm).defineWorkspace, defineReport).ddcore includes a native Model Context Protocol (MCP) server accessible via stdio (ddcore mcp) or HTTP during development:
Common enterprise requirements are built into the framework rather than reimplemented per application:
permlevel).Running ddcore in production requires just the single binary, your application folder, and a PostgreSQL database. No Node.js runtime, build pipelines, or container orchestrators are required for base deployments.
ddcore is designed for software teams building business and administrative applications:
Ready to explore? Follow the Build Your First App tutorial to get started.