DEV Community

Cover image for Introducing ZenStack: a schema-first toolkit for creating CRUD services in Next.js projects
ymc9 for ZenStack

Posted on โ€ข Edited on

6 1 1 1 1

Introducing ZenStack: a schema-first toolkit for creating CRUD services in Next.js projects


Next.js is evolving fast to become an increasingly appealing choice for building full-stack web apps. However, coding up the backend part of an app, especially implementing CRUD services efficiently and securely, is still tricky (and boring ๐Ÿ˜’ too).

ZenStack is a toolkit that simplifies the construction of CRUD services with a schema-first approach. It offers a modeling language for defining data models, relations, and access policies and then generates RESTful CRUD services (with authorization) and React hooks for you. It also allows you to share types between client and server-side coding and achieve end-to-end type safety without pain.

Our goal is to let you save time writing boilerplate code and focus on building what matters - the user experience.

If it feels relevant, please also check out the excellent detailed tutorial by @jiasheng for how to use it in action:

, or find more details directly at Github:

GitHub logo zenstackhq / zenstack

Fullstack TypeScript toolkit that enhances Prisma ORM with flexible Authorization layer for RBAC/ABAC/PBAC/ReBAC, offering auto-generated type-safe APIs and frontend hooks.

ZenStack

What it is

ZenStack is a Node.js/TypeScript toolkit that simplifies the development of a web app's backend. It enhances Prisma ORM with a flexible Authorization layer and auto-generated, type-safe APIs/hooks, unlocking its full potential for full-stack development.

Our goal is to let you save time writing boilerplate code and focus on building real features!

How it works

Read full documentation at ๐Ÿ‘‰๐Ÿป zenstack.dev. Join Discord for feedback and questions.

ZenStack incrementally extends Prisma's power with the following four layers:

1. ZModel - an extended Prisma schema language

ZenStack introduces a data modeling language called "ZModel" - a superset of Prisma schema language. It extended Prisma schema with custom attributes and functions and, based on that, implemented a flexible access control layer around Prisma.

// base.zmodel
abstract model Base {
    id String @id
    author User @relation(fields: [authorId], references: [id
โ€ฆ
Enter fullscreen mode Exit fullscreen mode

Also, join us on discord for chat and the latest updates!

Have fun!

Neon image

Next.js applications: Set up a Neon project in seconds

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Get started โ†’

Top comments (0)

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

๐Ÿ‘‹ Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someoneโ€™s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay