Building blocks · technical details

What each piece does, and where to check it.

Each line below names the function, file or doc that backs it. The plain version is on Building blocks.

How they fit

Every dependency, from prisma-map up.

Colour: part
  • Building blocks
  • Developer experience
Fill: status
  • Done
Lines: relation
  • Builds on
  • Reads its map
  • Template will adopt
How the building blocks fit togetherprisma-map is the base: json-rules and permissions read its map. permissions is built on json-rules. transitions is built on json-rules and permissions. rules-builder is built on json-rules. Developer experience: atlas (uses json-rules), gloss, config (the toolchain under every package), and the worktrees, init and CI rules that come with template. template uses prisma-map, json-rules, permissions, rules-builder, atlas and config, and moves onto transitions and gloss next.The librariesDeveloper experienceComes with templatejson-rules reads the field map prisma-map producespermissions walks your data through the map prisma-map producespermission rules are json-rulesrules-builder builds json-rules conditionstransition guards are json-rulesa transition is checked by permissionsatlas checks its annotations with json-rulestemplate uses prisma-maptemplate uses permissionstemplate moves onto transitions nexttemplate uses json-rulestemplate uses rules-buildertemplate uses atlastemplate adopts gloss nextworktrees comes with templateinit comes with templateCI rules comes with templateprisma-mapData shapejson-rulesRulespermissionsWho can do whattransitionsLifecyclesrules-builderRule screensatlasMap of the codeglossNotes beside the codeworktreesinitCI rulesconfigThe toolchain every package builds withtemplateThe whole SaaS appunder construction

Hover or focus a piece to light what it builds on and what builds on it.

The librariestemplate on top, prisma-map at the base
  • templateThe whole SaaS appBuilt on prisma-map, json-rules, permissions, rules-builder, atlas, transitions, gloss
  • rules-builderRule screensBuilt on json-rules
  • transitionsLifecyclesBuilt on json-rules, permissions
  • permissionsWho can do whatBuilt on prisma-map, json-rules
  • json-rulesRulesBuilt on prisma-map
  • prisma-mapData shape
Developer experienceconfig is the toolchain under every package
  • atlasMap of the codeBuilt on json-rules
  • glossNotes beside the code
  • worktreesA copy per taskComes with template
  • initProject setupComes with template
  • CI rulesConvention checksComes with template
  • configShared setup
Read the map as text

How to read the map: colour shows which part a piece belongs to (amber building blocks, teal developer experience, lime agentic, blue outside your machine, violet governance; charcoal marks closed source and pink marks a connection that goes through a Signet). Fill shows status: a solid block is done, a block in scaffolding is under construction, a dashed outline is planned. Lines show the relation: solid builds on or runs with, dotted reads prisma-map's map, pink goes through a Signet, a scaffold-dashed line is under construction (on the technical graph: what template will adopt), a long-dashed grey line reaches a planned piece.

  • prisma-map: Your Prisma schema, readable at runtime. Built on config.
  • json-rules: One rule that runs in memory, in Prisma and in SQL. Built on prisma-map (reads its map), config.
  • permissions: RBAC, ABAC and ReBAC on your own records. Built on prisma-map (reads its map), json-rules, config.
  • transitions: Declarative lifecycles. Built on json-rules, permissions, config.
  • rules-builder: A headless rule builder. Built on json-rules, config.
  • atlas: A map of your code. Built on json-rules, config.
  • gloss: Explanations kept out of the source. Built on config.
  • config: The shared toolchain and theme.
  • worktrees: A worktree per task, with its own database and ports.
  • init: Sets up hosting, database and secrets for a new project.
  • CI rules: Checks that hold the codebase to its own conventions.
  • template: The whole SaaS app, built from the libraries. Under construction. Built on prisma-map, json-rules, permissions, rules-builder, atlas, config, worktrees, init, CI rules, transitions (to adopt), gloss (to adopt).
templateMIT

An API, web, admin and superadmin apps and a shared UI package.

  • Sign-inBetterAuth for email/password and OAuth, then an ES256 JWT per person; API tokens for scripts. No session cookies. Doc
  • TenancyOrganizations and spaces, each with memberships and roles (owner, admin, member); a space membership needs the org membership first. Doc
  • PermissionsDeclarative rules over the data graph, checked by the permissions package. Doc
  • Field-level encryptionAES-256-GCM per field, declared in the ENCRYPTED_MODELS registry; the rotateEncryptionKeys job re-encrypts records on a stale key. Doc
  • Audit logModels listed in AUDIT_ENABLED_MODELS get an immutable trail of every mutation, with its actor and subject. Doc
  • Background jobsmakeJob, makeSingletonJob and makeSupersedingJob on BullMQ, staged jobs that fan out and wait, and rolling caches. Doc
  • WebhooksSubscriptions per organization or space, RSA-SHA256 signatures, delivery through jobs with retries and tracking. Doc
  • Live dataAuthenticated WebSockets with open/snapshot/append/close data streams and authorized query channels over Redis pub/sub. Doc
  • EmailStored MJML templates and components, a planner that picks the template, preferences and verification. Doc
  • Routes write their own contractAdd a route and controller; it registers itself, emits OpenAPI 3.1 and regenerates a typed SDK. Doc
  • Responses checked against the specA controller can only send the responses its route declares, and payloads are validated at runtime. Doc
  • Errors as a systemOne error body everywhere, with guidance per status and request correlation. Doc

bun · hono · prisma 7 · react · turborepo · postgres

The packages

Building blocks, in dependency order from the bottom up.

prisma-map sits at the bottom: json-rules and permissions read your schema through it. Transitions builds on permissions, and rules-builder on json-rules. Each is MIT and published on npm.

Developer experience

Tools for working on the code. None of them ships in your product.

Atlas, gloss and config are packages of their own; template uses atlas and config. Worktrees, init and the CI rules ship in template's repo.