Skip to content

Schema

The Mzizi portal uses a JSON schema based on the shadcn registry schema. This document details the schema structure and item types.

The registry.json file at the project root is the single source of truth for all registry items:

{
"$schema": "https://ui.shadcn.com/schema/registry.json",
"name": "mukoko",
"homepage": "https://mzizi.dev",
"items": [
// ... registry items
]
}
Field Type Description
$schema string Schema URL for validation
name string Registry name identifier
homepage string Registry homepage URL
items array Array of registry item objects

Each item in the items array follows this structure:

{
"name": "button",
"type": "registry:ui",
"description": "Displays a button or a component that looks like a button.",
"dependencies": ["radix-ui", "class-variance-authority"],
"registryDependencies": [],
"files": [
{
"path": "components/ui/button.tsx",
"type": "registry:ui"
}
]
}
Field Type Required Description
name string Yes Unique kebab-case identifier
type string Yes Item type (see below)
description string Yes Human-readable description
dependencies string[] Yes npm package names required
registryDependencies string[] Yes Other registry item names required
files object[] Yes Files that compose this item
Field Type Description
path string Relative path from project root
type string File type (matches parent item type)
content string Source code (populated by the API, not in manifest)

UI components installed to components/ui/. These are React components with CVA variants, Radix primitives, and cn() composition.

{
"name": "dialog",
"type": "registry:ui",
"files": [{ "path": "components/ui/dialog.tsx", "type": "registry:ui" }]
}

82 items of this type in the registry.

React hooks installed to hooks/. These are custom hooks that manage state, side effects, or browser APIs.

{
"name": "use-toast",
"type": "registry:hook",
"files": [{ "path": "hooks/use-toast.ts", "type": "registry:hook" }]
}

3 items: use-toast, use-mobile, use-memory-pressure

Library utilities installed to lib/. These are pure functions, patterns, and infrastructure code.

{
"name": "circuit-breaker",
"type": "registry:lib",
"files": [{ "path": "lib/circuit-breaker.ts", "type": "registry:lib" }]
}

9 items: utils, observability, circuit-breaker, retry, timeout, fallback-chain, chaos, ai-safety, architecture

When the API serves a component at /api/v1/ui/{name}, it returns the manifest data enriched with inline source code:

{
"name": "button",
"type": "registry:ui",
"description": "Displays a button or a component that looks like a button.",
"dependencies": ["radix-ui", "class-variance-authority"],
"registryDependencies": [],
"files": [
{
"path": "components/ui/button.tsx",
"type": "registry:ui",
"content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n..."
}
]
}

The content field contains the complete, installable source code.

The index endpoint at /api/v1/ui returns all items without source code:

{
"$schema": "https://ui.shadcn.com/schema/registry.json",
"name": "mukoko",
"homepage": "https://mzizi.dev",
"items": [
{ "name": "accordion", "type": "registry:ui", "description": "..." },
{ "name": "alert", "type": "registry:ui", "description": "..." },
// … every registry item (live count: GET /api/v1/stats)
]
}

Running pnpm registry:build generates individual JSON files:

public/r/
button.json
card.json
dialog.json
use-toast.json
circuit-breaker.json
...

Each file contains the full item data including inline source code, identical to the API response format.