One Schema to
Rule Them All
A JSON Schema-first framework for validation, persistence, SDK generation, and migrations (Extends JSON Schema, doesn't replace it). Ecosystem compatible with AJV, Hyperjump, OpenAPI, VS Code, and Spectral.
$npx schema-cast initThe Schema Divide
Building full-stack apps usually means rewriting the same data model four times.
Without schema-cast
Manual synchronization
With schema-cast
Single source of truth
See it in action
Write your schema once. Get perfectly synced outputs across your entire stack.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "User",
"type": "object",
"x-schema-cast": {
"tableName": "users"
},
"properties": {
"id": {
"type": "string",
"format": "uuid",
"x-schema-cast": { "primaryKey": true }
},
"email": {
"type": "string",
"format": "email",
"x-schema-cast": { "unique": true }
},
"age": {
"type": "number"
},
"role": {
"type": "string",
"enum": ["admin", "user", "guest"],
"default": "user"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"profile": {
"type": "object",
"properties": {
"bio": { "type": "string" },
"avatar": { "type": "string", "format": "uri" }
}
}
},
"required": ["id", "email", "createdAt"]
}export interface User {
id: string;
email: string;
age?: number;
role: 'admin' | 'user' | 'guest';
createdAt: Date;
profile?: {
bio?: string;
avatar?: string;
};
}Supported Field Types
Every type maps cleanly across all four output targets. No compromises, no edge cases.
| Type | TypeScript | Zod | Mongoose | PostgreSQL |
|---|---|---|---|---|
string | string | z.string() | String | VARCHAR |
number | number | z.number() | Number | NUMERIC |
boolean | boolean | z.boolean() | Boolean | BOOLEAN |
date | Date | z.date() | Date | TIMESTAMP |
uuid | string | z.string().uuid() | String | UUID |
email | string | z.string().email() | String | VARCHAR |
url | string | z.string().url() | String | VARCHAR |
enum | 'a' | 'b' | z.enum([...]) | { enum: [...] } | CHECK (col IN (...)) |
object | { ... } | z.object({...}) | Nested schema | JSONB |
array | T[] | z.array(...) | [{ type: T }] | JSONB |
json | any | z.any() | Schema.Types.Mixed | JSONB |
Command Center
Three commands to master your entire schema workflow. No config files needed.
>schema-cast generate --input ./schemas/user.schema.json --out ./generated>schema-cast generate --all --input ./schemas/ --out ./generated>schema-cast generate --input ./schemas/ --out ./generated --format typescript,zod,mongooseConfiguration Flags
--inputPath to a .schema.json / .schema.yaml file or directory--outOutput directory for generated files--allProcess all schema files in the input directory--formatComma-separated output formats (typescript, zod, mongoose, postgres)--watchAuto-regenerate on schema changesJSON & YAML Support
Write your schemas in whichever format your team prefers. Both produce identical outputs.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Post",
"type": "object",
"properties": {
"title": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"tags": {
"type": "array",
"items": { "type": "string" }
},
"status": {
"type": "string",
"enum": ["draft", "published", "archived"],
"default": "draft"
},
"author": {
"$ref": "./user.schema.json",
"x-schema-cast": {
"relationship": "many-to-one"
}
}
},
"required": ["title", "author"]
}Same Schema, Two Syntaxes
JSON for strict tooling. YAML for human readability. Switch between them freely — the generated output is identical.
Team Friendly
Non-TypeScript developers — designers, PMs — can read and review YAML schemas. Backend devs validate. Frontend devs get automatic types.
Validated on Parse
Both formats are validated at parse time. Catch missing required fields, invalid types, and conflicting constraints before generation.
Pro tip: Use .schema.json or .schema.yaml extensions for auto-detection.
Built for Velocity
Everything you need to eliminate schema drift and ship at lightspeed.
Standard JSON Schema
Built natively on the Draft 2020-12 JSON Schema standard. Fully compatible with AJV, OpenAPI, and Spectral. No proprietary DSL to learn.
TypeScript Types
Generates deeply nested, perfectly typed interfaces with full optional support.
Zod Validators
Runtime validation schemas, always in sync with your types. Composable and extensible.
Mongoose Models
Fully configured schemas with types, defaults, refs, and nested subdocuments.
PostgreSQL DDL
CREATE TABLE statements with constraints, enums, and JSONB columns.
Watch Mode
Auto-regenerates all outputs the instant you save. Non-destructive and fast.
Sub-100ms Generation
Blazing fast generation for your entire schema suite. No waiting, no bottlenecks.
Zero Dependencies
Generated code only imports libraries you already use. No extra packages.
Framework Agnostic
Works with Next.js, Express, NestJS, Fastify, or any Node.js stack.
Built for your workflow
Whether you're a solo dev or a platform team, schema-cast fits right in.
Fullstack Monorepos
Share one schemas/ directory across frontend, backend, and database. Every change auto-generates consistent types across your codebase.
API Contract Enforcement
Define API request/response shapes once. Backend validates with Zod, frontend has types, database enforces schema constraints.
Database Migrations
Generate CREATE TABLE statements automatically. No manual SQL writing, no mismatch between your ORM and actual database schema.
Type-Safe Forms
Use generated Zod schemas with React Hook Form, Formik, or any validation library. Types flow from schema → validation → UI.
Startups & MVPs
Ship your data layer in minutes, not days. Define once, generate everything, and focus on building features that matter.
Team Collaboration
Non-TypeScript developers (designers, PMs) can read the JSON schema. Backend devs validate. Frontend devs get automatic types.
How it compares
schema-cast is the only tool that generates all four outputs from a single source.
| Feature | schema-cast | Prisma | GraphQL | tRPC |
|---|---|---|---|---|
| TypeScript Types | Partial | |||
| Zod Validators | ||||
| Mongoose Models | ||||
| PostgreSQL DDL | ||||
| Single Source of Truth | ||||
| JSON/YAML Schemas | ||||
| Framework Agnostic | Partial | |||
| Zero Config | ||||
| Sub-100ms Generation | ||||
| Learn Curve | Low | High | High | Medium |
| Setup Time | 2 min | 15 min | 30 min | 10 min |
schema-cast's sweet spot: Start fast with JSON schemas, generate all four outputs, keep everything in sync. Perfect for startups, monorepos, and teams that want zero config, maximum sync.
Loved by developers
Real feedback from early adopters.
“schema-cast cut our data layer setup from 2 days to 15 minutes. We went from 4 files that constantly drifted to a single source of truth.”
Alex Chen
CTO at Stackflow
“The watch mode alone is worth it. Change a field, save, and everything updates. No more hunting down mismatched types across the codebase.”
Priya Sharma
Lead Engineer at Vortex
“As a solo dev, I can't afford to waste time on boilerplate. schema-cast lets me define my schema once and get back to building product.”
Marcus Weber
Solo Founder, Notely
What's next for schema-cast
Building towards a complete schema ecosystem.
Core
ReleasedEcosystem Integration
Q3 2026Pro Tier
Q4 2026Advanced
2027Project Structure
Clean, modular architecture. Each generator is independent and testable.
Contributing
Contributions are welcome. Omnikon is a community of builders creating developer tools for modern stacks.
Architecture Highlights
- ▸Each generator is a standalone module — add new outputs easily
- ▸Parser handles both JSON and YAML with unified AST
- ▸Watch mode via chokidar — only regenerates changed schemas
- ▸Full test coverage for all generators and parser
Ready to eliminate schema drift?
Define your data model once. Generate TypeScript, Zod, Mongoose, and PostgreSQL — all in sync, all the time.
$npm install -g schema-cast