~/shivansh.dev — boot
shivansh@portfolio:~$
All projects
DEV TOOLS2024

Define

Type-safe resource DSL and code generation library to eliminate schema drift.

TypeScriptDrizzle ORMFastifyOpenAPI 3.1pnpm workspaces
100%
schema consistency
0
drift incidents
1
source of truth
// problem

Engineering velocity decreases and bugs spike when database schemas, backend validators, and public API documentation drift out of sync. Writing database migrations in Drizzle, route schemas in Fastify, and OpenAPI documentation by hand leads to inevitable discrepancies. We needed a single compiler-verified source of truth that generates all three targets dynamically.

// architecture
Resource DSLDefine CoreDrizzle SchemaFastify SchemaOpenAPI Spec
// key decisions
// results
100%
sync guarantee
0ms
runtime overhead
10x
faster migrations

Define completely eliminates manual synchronization errors by generating all schema, repository, and validation layers from a single source of truth. Developers write their resource specs once, run `define generate`, and receive fully-typed code and swagger documentation instantly, dropping schema-drift incidents to absolute zero.