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
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
| Field | Type | Default | Purpose |
|---|---|---|---|
schemas | OzzyRMSchemaSource[] | required | Adapter sources (prisma, drizzle, sql) |
output | string | ./.ozzyrm | Folder for generated catalog artifacts |
unified | UnifiedSchemaDefinition[] | optional | Merge selected sources into one validated graph |
scenarios | SchemaScenarioDefinition[] | optional | Use-case slices attached to a catalog version |
watch | boolean | OzzyRMWatchConfig | optional | CLI watcher / HMR stamp options |
security | OzzyRMSecurityConfig | optional | Path confinement and related hardening |
schemas must be non-empty. Empty schemas: [] fails validation (EMPTY_SCHEMAS).
Full example
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
OzzyRMDocsFromConfigandloadCatalog(config)import your config module and resolve adapters into a catalog.- Treat
ozzyrm.config.tsas trusted code (dynamic import runs the module). - Generated JSON under
outputshould not contain database credentials. Datasource URLs are stripped before catalog write.