schema-cast v2.0 is live

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.

bash
$npx schema-cast init
Zero Dependencies
< 100ms Generation
Type Safe

The Schema Divide

Building full-stack apps usually means rewriting the same data model four times.

Without schema-cast

Manual synchronization

interface User { ... }Out of sync
z.object({ ... })Missing field
new Schema({ ... })Type error
CREATE TABLE users ...Failed

With schema-cast

Single source of truth

schema.json
TS
Zod
Mongo
SQL
100% Synced Automatically
Live Preview

See it in action

Write your schema once. Get perfectly synced outputs across your entire stack.

InputOutput
user.schema.jsonSource
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{
  "$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"]
}
user.types.ts
1
2
3
4
5
6
7
8
9
10
11
export interface User {
  id: string;
  email: string;
  age?: number;
  role: 'admin' | 'user' | 'guest';
  createdAt: Date;
  profile?: {
    bio?: string;
    avatar?: string;
  };
}
Generated:user.types.tsuser.zod.tsuser.model.tsuser.sql< 100ms
11 Built-In Types

Supported Field Types

Every type maps cleanly across all four output targets. No compromises, no edge cases.

TypeTypeScriptZodMongoosePostgreSQL
stringstringz.string()StringVARCHAR
numbernumberz.number()NumberNUMERIC
booleanbooleanz.boolean()BooleanBOOLEAN
dateDatez.date()DateTIMESTAMP
uuidstringz.string().uuid()StringUUID
emailstringz.string().email()StringVARCHAR
urlstringz.string().url()StringVARCHAR
enum'a' | 'b'z.enum([...]){ enum: [...] }CHECK (col IN (...))
object{ ... }z.object({...})Nested schemaJSONB
arrayT[]z.array(...)[{ type: T }]JSONB
jsonanyz.any()Schema.Types.MixedJSONB
Terminal Access

Command Center

Three commands to master your entire schema workflow. No config files needed.

Terminal // schema-cast
Single file
>schema-cast generate --input ./schemas/user.schema.json --out ./generated
Entire directory
>schema-cast generate --all --input ./schemas/ --out ./generated
Custom format
>schema-cast generate --input ./schemas/ --out ./generated --format typescript,zod,mongoose

Configuration 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 changes
Dual Format

JSON & 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.

System Capabilities

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.

Use Cases

Built for your workflow

Whether you're a solo dev or a platform team, schema-cast fits right in.

Most Popular

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.

Comparison

How it compares

schema-cast is the only tool that generates all four outputs from a single source.

Feature
schema-cast
PrismaGraphQLtRPC
TypeScript TypesPartial
Zod Validators
Mongoose Models
PostgreSQL DDL
Single Source of Truth
JSON/YAML Schemas
Framework AgnosticPartial
Zero Config
Sub-100ms Generation
Learn CurveLowHighHighMedium
Setup Time2 min15 min30 min10 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.

Testimonials

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.

AC

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.

PS

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.

MW

Marcus Weber

Solo Founder, Notely

Roadmap

What's next for schema-cast

Building towards a complete schema ecosystem.

Core

Released
JSON/YAML parsing
TypeScript generation
Zod generation
Mongoose generation
PostgreSQL DDL
CLI tool
Watch mode
npm package published

Ecosystem Integration

Q3 2026
Prisma schema generation
GraphQL schema generation
gRPC proto generation
Validation CLI
Web UI for schema builder
Schema versioning

Pro Tier

Q4 2026
Cloud schema sync
Team collaboration & permissions
Schema diffing & migration helpers
CI/CD pipeline integration
Advanced validation rules

Advanced

2027
Database migration generation
OpenAPI/Swagger generation
Language support (Python, Go, Rust, Java)
IDE extensions (VS Code, IntelliJ)
schema-cast Desktop app
Open Source

Project Structure

Clean, modular architecture. Each generator is independent and testable.

Explorer
schema-cast/
src/
index.ts
parser.ts
validators.ts
generators/
typescript.ts
zod.ts
mongoose.ts
postgres.ts
cli.ts
watcher.ts
tests/
generators.test.ts
parser.test.ts
cli.test.ts
README.md

Contributing

Contributions are welcome. Omnikon is a community of builders creating developer tools for modern stacks.

$ git clone https://github.com/Omnikon-Org/schema-cast.git
$ cd schema-cast && npm install
$ npm run dev

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
<100ms
Generation Time
4
Output Formats
0
Config Files