explaingit

doorman11991/marrowscript

16TypeScriptAudience · developerComplexity · 4/5ActiveSetup · moderate

TLDR

DSL and compiler that turns a single .marrow file describing entities, capabilities, events, and flows into a full Node.js backend with Express, Postgres, JWT, SDK, and admin UI.

Mindmap

mindmap
  root((MarrowScript))
    Inputs
      marrow file
      Entities
      Capabilities
      Flows
    Outputs
      Express API
      Postgres migrations
      TypeScript SDK
      OpenAPI spec
      React hooks
    Use Cases
      Scaffold a SaaS backend
      Reflect existing TS to marrow
      LLM-assisted code generation
    Tech Stack
      TypeScript
      Node
      Express
      Postgres
      Redis
      Docker

Things people build with this

USE CASE 1

Scaffold a complete SaaS backend by writing one .marrow file and running marrowc compile

USE CASE 2

Generate a TypeScript SDK and OpenAPI spec alongside the API in a single build

USE CASE 3

Define a multi-step saga with compensating actions using flows

USE CASE 4

Reflect an existing TypeScript codebase into a .marrow stub for iteration

Tech stack

TypeScriptNodeExpressPostgresRedisDocker

Getting it running

Difficulty · moderate Time to first run · 30min

Needs Node 18+, Docker for the generated Postgres and Redis containers, and global install of marrowscript-compiler.

In plain English

MarrowScript is a small programming language and compiler aimed at backend developers who want to describe an entire system in one file and get a full Node.js backend out the other end. You write a .marrow file using a few high-level building blocks: entities for data, capabilities for operations, events, flows for multi-step sagas, channels for websockets, and policies for things like rate limits. The compiler then produces a project with an Express API, PostgreSQL migrations, JWT auth, a TypeScript SDK, OpenAPI spec, React hooks, an admin panel, Dockerfile, and GitHub Actions CI. The same input always produces the same output. To use it, you install the compiler from npm with npm install -g marrowscript-compiler and you need Node.js 18 or later. A typical flow is marrowc init my-app --domain saas_platform to scaffold a project, marrowc compile to generate the backend, then docker compose up -d and npm run dev to start it locally on port 3000 with an admin panel at /admin. Postgres and Redis start automatically from the generated docker-compose file. Entities have fields with types like string, uint, uuid, json, list, and set, plus constraints, state machines, and relations. Sensitive fields can be tagged so they are redacted from logs, and renamed fields produce safe ALTER TABLE migrations. Capabilities declare preconditions, effects on entity fields, events to emit, and how they should run, including transactional or eventual mode, timeouts, idempotency, and retry behavior. Events go through a transactional outbox with delivery modes like at_least_once, at_most_once, and exactly_once. Flows define sagas where each step has a compensating action that runs on failure. The README also covers using the language with large language models. There is a suggested prompt for getting a model to write .marrow files, and two reflect commands that read an existing TypeScript codebase and produce a .marrow stub, either statically or with help from an LLM. MarrowScript can also call LLMs from inside the generated backend: you declare a model with an OpenAI-compatible endpoint and a prompt block with retry, cache, and validation rules, and the compiler emits the adapters, retry logic, and trace tables.

Copy-paste prompts

Prompt 1
Give me a 5-minute install guide for MarrowScript including marrowc init and docker compose up
Prompt 2
Write a .marrow file that defines a User entity with email, a signup capability, and a UserSignedUp event
Prompt 3
Explain the difference between at_least_once, at_most_once, and exactly_once delivery in MarrowScript events
Prompt 4
Show me how to declare an LLM model and a prompt block inside a .marrow capability
Prompt 5
How do I run marrowc reflect against an existing Express app to produce a starting .marrow file
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.