Skip to content

treks-app/zenstack-prisma-jsonapi

Repository files navigation

Zenstack prisma REST autogen

Autogenerates a REST API (JSONAPI) from prisma schema with ACL.

Features

  • Prisma schema is the single source of truth
  • ACL is embedded in prisma schema with zmodel from zenstack
  • REST API is generated for all CRUD endpoints for models
  • Only models with ACL defined (@allow) are accessbile in API

Todo

  • Add Zod validation
  • Generate OpenAPI spec

API Features

  • /api/model/post - list all posts
  • /api/model/post/1 - show post id=1
  • /api/model/post?filter[title]=Hello%20World - Get post with title "Hello World"
  • /api/model/post?filter[content$contains]=word - find Post.content that contain "word"

Full list of features - https://zenstack.dev/docs/reference/server-adapters/api-handlers/rest#filtering

Docs

About

Autogen jsonapi (rest api) from prisma with zenstack

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published