Skip to content

TypeScript ORM and more. Schema-first, Prisma-compatibility, built-in access control, automatic CRUD API, and other goodies. V3 is an ongoing major rewrite of V2.

License

Notifications You must be signed in to change notification settings

zenstackhq/zenstack-v3

Repository files navigation

ZenStack: Modern Data Layer for TypeScript Apps

What's ZenStack

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

What's New in V3

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:

  1. Pure TypeScript implementation without any Rust/WASM components.
  2. More TypeScript type inference, less code generation.
  3. Fully-typed query-builder API as a better escape hatch compared to Prisma's raw queries or typed SQL.

Try It Now

Open in StackBlitz

Installation

1. Creating a new project

Use the following command to scaffold a simple TypeScript command line application with ZenStack configured:

npm create zenstack@latest my-project

2. Setting up an existing project

Or, if you have an existing project, use the CLI to initialize it:

npx @zenstackhq/cli@latest init

3. Setting up manually

Alternatively, you can set it up manually:

npm install -D @zenstackhq/cli
npm install @zenstackhq/orm

Then create a zenstack folder and a schema.zmodel file in it.

Documentation

https://zenstack.dev/docs/

Sponsors

Thank you for your generous support!

Current Sponsors

Suhyl
Suhyl
Marblism
Marblism
Mermaid Chart
Mermaid Chart
CodeRabbit
CodeRabbit
Johann Rohn
Johann Rohn

Previous Sponsors

Benjamin Zecirovic
Benjamin Zecirovic
Ulric
Ulric
Fabian Jocks
Fabian Jocks

Community

Join our discord server for chat and updates!

About

TypeScript ORM and more. Schema-first, Prisma-compatibility, built-in access control, automatic CRUD API, and other goodies. V3 is an ongoing major rewrite of V2.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published