Zenstack
Modern Data Layer for TypeScript Apps - type-safe ORM, built-in access control, automatic query services
Install / Use
/learn @zenstackhq/ZenstackREADME
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:
- 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.
Try It Now
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
Sponsors
Thank you for your generous support!
Current Sponsors
<table> <tr> <td align="center"><a href="https://suhyl.com/"><img src="https://avatars.githubusercontent.com/u/124434734?s=200&v=4" width="100" style="border-radius:50%" alt="Suhyl"/><br />Suhyl</a></td> <td align="center"><a href="https://www.marblism.com/"><img src="https://avatars.githubusercontent.com/u/143199531?s=200&v=4" width="100" style="border-radius:50%" alt="Marblism"/><br />Marblism</a></td> <td align="center"><a href="https://www.mermaidchart.com/"><img src="https://avatars.githubusercontent.com/u/117662492?s=200&v=4" width="100" style="border-radius:50%" alt="Mermaid Chart"/><br />Mermaid Chart</a></td> <td align="center"><a href="https://coderabbit.ai/"><img src="https://avatars.githubusercontent.com/u/132028505?v=4" width="100" style="border-radius:50%" alt="CodeRabbit"/><br />CodeRabbit</a></td> <td align="center"><a href="https://github.com/j0hannr"><img src="https://avatars.githubusercontent.com/u/52762073?v=4" width="100" style="border-radius:50%" alt="Johann Rohn"/><br />Johann Rohn</a></td> </tr> </table>Previous Sponsors
<table> <tr> <td align="center"><a href="https://github.com/baenie"><img src="https://avatars.githubusercontent.com/u/58309104?v=4" width="100" style="border-radius:50%" alt="Benjamin Zecirovic"/><br />Benjamin Zecirovic</a></td> <td align="center"><a href="https://github.com/umussetu"><img src="https://avatars.githubusercontent.com/u/152648499?v=4" width="100" style="border-radius:50%" alt="Ulric"/><br />Ulric</a></td> <td align="center"><a href="https://github.com/iamfj"><img src="https://avatars.githubusercontent.com/u/24557998?v=4" width="100" style="border-radius:50%" alt="Fabian Jocks"/><br />Fabian Jocks</a></td> </tr> </table>Community
Join our discord server for chat and updates!
Contributors
Thanks to all the contributors who have helped make ZenStack better!
Source
<a href="https://github.com/zenstackhq/zenstack/graphs/contributors"> <img src="https://contrib.rocks/image?repo=zenstackhq/zenstack" /> </a>Docs
<a href="https://github.com/zenstackhq/zenstack-docs/graphs/contributors"> <img src="https://contrib.rocks/image?repo=zenstackhq/zenstack-docs" /> </a>License
Related Skills
gh-issues
337.7kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
node-connect
337.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
oracle
337.7kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
tmux
337.7kRemote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
