OzzyRMOzzyRMDocs
Configuration

Project config

Full defineProject reference for schemas, output, unified, scenarios, watch, and security.

OzzyRM is configured with defineProject in ozzyrm.config.ts. You declare schema sources (adapters), then optionally add unified merges, scenarios, watch options, and security knobs.

The package targets React-based apps. Next.js App Router is one convenient host for the server helper. Vite, Remix, or any React setup that can load a catalog and render a client component also works.

Basic project

TypeScript
import { defineProject, prisma, drizzle, sql } from "ozzyrm";

export default defineProject({
  output: "./.ozzyrm",
  schemas: [
    prisma({
      id: "app-prisma",
      include: ["./prisma"],
      version: "1.0.0",
    }),
    drizzle({
      id: "app-drizzle",
      include: ["./src/db/schema.ts"],
    }),
    sql({
      id: "legacy-sql",
      include: ["./db/schema.sql"],
    }),
  ],
});

Teams often mix ORMs with hand-written SQL. OzzyRM normalizes them into one docs UI.

defineProject fields

FieldTypeDefaultPurpose
schemasOzzyRMSchemaSource[]requiredAdapter sources (prisma, drizzle, sql)
outputstring./.ozzyrmFolder for generated catalog artifacts
unifiedUnifiedSchemaDefinition[]optionalMerge selected sources into one validated graph
scenariosSchemaScenarioDefinition[]optionalUse-case slices attached to a catalog version
watchboolean | OzzyRMWatchConfigoptionalCLI watcher / HMR stamp options
securityOzzyRMSecurityConfigoptionalPath confinement and related hardening

schemas must be non-empty. Empty schemas: [] fails validation (EMPTY_SCHEMAS).

Full example

TypeScript
import { defineProject, prisma, sql } from "ozzyrm";

export default defineProject({
  output: "./.ozzyrm",
  schemas: [
    prisma({
      id: "app-prisma",
      label: "App (Prisma)",
      include: ["./prisma"],
      file: "schema.prisma",
      version: "1.0.0",
    }),
    sql({
      id: "legacy-sql",
      include: ["./db/legacy.sql"],
      version: "1.0.0",
    }),
  ],
  unified: [
    {
      id: "company-schema",
      sources: ["app-prisma", "legacy-sql"],
      file: "company",
      version: "1.0.0",
    },
  ],
  scenarios: [
    {
      id: "billing-flow",
      label: "Billing flow",
      description: "Org to invoice line items and products.",
      schemaId: "company-schema",
      models: [
        "Organization",
        "BillingAccount",
        "Invoice",
        "InvoiceLine",
        "Product",
      ],
      enums: ["InvoiceStatus"],
      path: ["Organization", "Invoice", "InvoiceLine", "Product"],
    },
  ],
  watch: {
    enabled: true,
    debounceMs: 200,
    generateOnStart: true,
    hot: true,
  },
  security: {
    restrictPathsToCwd: true,
  },
});

How config is loaded

  • OzzyRMDocsFromConfig and loadCatalog(config) import your config module and resolve adapters into a catalog.
  • Treat ozzyrm.config.ts as trusted code (dynamic import runs the module).
  • Generated JSON under output should not contain database credentials. Datasource URLs are stripped before catalog write.

Deep dives

On this page