zenstack is a free, open source api development & testing project written in TypeScript and released under MIT. It has 2,945 GitHub stars, 156 forks and 182 open issues, and was last pushed 7 days ago. On this registry it ranks #85 of 154 tracked projects in API Development & Testing, with 5 head-to-head comparisons available.

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
  • 💎 Zod schema generation

What's New in V3

ZenStack V3 is a major rewrite. 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/schema @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

Previous Sponsors

Community

Join our discord server for chat and updates!

Contributors

Thanks to all the contributors who have helped make ZenStack better!

Source

Docs

License

MIT

Frequently asked questions

Is zenstack free to use?

zenstack is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does zenstack do?

Modern data layer for TypeScript apps - type-safe ORM, built-in access control, automatic query services

What is zenstack written in?

zenstack is primarily written in TypeScript. Its source is publicly available at https://github.com/zenstackhq/zenstack, and it has 2,945 GitHub stars.