Read full documentation at ππ» https://zenstack.dev/docs.
ZenStack is a TypeScript database toolkit for developing full-stack or backend Node.js/Bun applications. It provides a unified data modeling and query solution with the following features:
- π§ Modern schema-first ORM that's compatible with Prisma's schema and API
- π Versatile API - high-level ORM queries + low-level Kysely query builder
- π Built-in access control and data validation
- π Advanced data modeling patterns like polymorphism
- π§© Designed for extensibility and flexibility
- βοΈ Automatic CRUD web APIs with adapters for popular frameworks
- ποΈ Automatic TanStack Query hooks for easy CRUD from the frontend
ZenStack V3 is a major rewrite of V2. It replaced Prisma ORM with its own ORM engine built on top of Kysely while keeping a Prisma-compatible query API. This architecture change brings the level of flexibility that we couldn't imagine in previous versions. Please check this blog post for why we made this bold decision.
Even without using advanced features, ZenStack offers the following benefits as a drop-in replacement to Prisma:
- Pure TypeScript implementation without any Rust/WASM components.
- More TypeScript type inference, less code generation.
- Fully-typed query-builder API as a better escape hatch compared to Prisma's raw queries or typed SQL.
Use the following command to scaffold a simple TypeScript command line application with ZenStack configured:
npm create zenstack@latest my-projectOr, if you have an existing project, use the CLI to initialize it:
npx @zenstackhq/cli@latest initAlternatively, you can set it up manually:
npm install -D @zenstackhq/cli
npm install @zenstackhq/ormThen create a zenstack folder and a schema.zmodel file in it.
Thank you for your generous support!
Suhyl |
Marblism |
Mermaid Chart |
CodeRabbit |
Johann Rohn |
Benjamin Zecirovic |
Ulric |
Fabian Jocks |
Join our discord server for chat and updates!