Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zenstack

Package Overview
Dependencies
Maintainers
1
Versions
308
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zenstack - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

9

package.json

@@ -5,7 +5,8 @@ {

"displayName": "ZenStack Language Tools",
"description": "ZenStack is a toolkit that simplifies full-stack development",
"version": "0.3.0",
"description": "A toolkit for modeling data and access policies in full-stack development with Next.js and Typescript",
"version": "0.3.1",
"author": {
"name": "ZenStack Team"
},
"license": "MIT",
"keywords": [

@@ -68,6 +69,6 @@ "fullstack",

"dependencies": {
"@zenstackhq/internal": "0.3.0",
"@zenstackhq/internal": "0.3.1",
"change-case": "^4.1.2",
"chevrotain": "^9.1.0",
"colors": "^1.4.0",
"colors": "1.4.0",
"commander": "^8.3.0",

@@ -74,0 +75,0 @@ "langium": "^0.5.0",

@@ -10,3 +10,3 @@ <div align="center">

</a>
<a href="https://discord.gg/6HhebQynfz">
<a href="https://go.zenstack.dev/chat">
<img src="https://img.shields.io/discord/1035538056146595961">

@@ -19,18 +19,16 @@ </a>

## 📣 Our Discord Server is Live
[JOIN US](https://go.zenstack.dev/chat) to chat about questions, bugs, plans, or anything off the top of your head.
## What is ZenStack?
ZenStack is a toolkit for simplifying full-stack development with Node.js web frameworks like [Next.js](https://nextjs.org/), [Nuxt.js](https://nuxtjs.org/) <img src="https://img.shields.io/badge/-Coming%20Soon-lightgray" height="12" align="top">, and [SvelteKit](https://kit.svelte.dev/) <img src="https://img.shields.io/badge/-Coming%20Soon-lightgray" height="12" align="top">, using Typescript language.
[![ZenStack Full-stack Development Toolkit Introduction](https://cdn.loom.com/sessions/thumbnails/76ba1308fb734af993765a6696b62c96-1668251534738-with-play.gif)](https://www.loom.com/share/76ba1308fb734af993765a6696b62c96)
Thanks to the increasing power of frameworks, building a complex web app within one unified framework is becoming more practical than ever. However, you'll still need to spend a significant amount of energy designing and building up your app's server-side part.
ZenStack is a toolkit for modeling data and access policies in full-stack development with [Next.js](https://nextjs.org/) and Typescript.
Things that make you stressed include:
Next.js is an excellent full-stack framework. However, building the backend part of a web app is still quite challenging. For example, implementing CRUD services efficiently and securely is tricky and not fun.
- What kind of API to use? RESTful or GraphQL?
- How to model your data and map the model to both source code and database (ORM)?
- How to implement CRUD operations? Manually construct it or use a generator?
- How to evolve your data model?
- How to authenticate users and authorize their requests?
ZenStack simplifies it by providing:
ZenStack aims to simplify these tasks by providing:
- An intuitive data modeling language for defining data types, relations, and access policies

@@ -65,3 +63,3 @@

- Auto-generated CRUD services and strongly typed front-end library
- Auto-generated CRUD services and strongly typed React hooks

@@ -83,14 +81,12 @@ ```jsx

Since CRUD APIs are automatically generated with access policies injected, you can safely implement most of your business logic in your front-end code. Read operations never return data that's not supposed to be visible to the current user, and writes will be rejected if unauthorized. The generated front-end library also supports nested writes, allowing you to make a batch of creates/updates atomically, eliminating the need for explicitly using a transaction.
Since CRUD APIs are automatically generated with access policies injected, you can safely implement most of your business logic in your front-end code. Read operations never return data that's not supposed to be visible to the current user, and writes will be rejected if unauthorized.
ZenStack is heavily inspired and built over [Prisma](https://www.prisma.io) ORM, which is, in our opinion, the best ORM toolkit in the market. Familiarity with Prisma should make it easy to pick up ZenStack, but it's not a prerequisite since the modeling language is intuitive and the development workflow is straightforward.
ZenStack is heavily inspired and built above [Prisma](https://www.prisma.io) ORM, which is, in our opinion, the best ORM toolkit in the market. Familiarity with Prisma should make it easy to pick up ZenStack, but it's not a prerequisite since the modeling language is intuitive and the development workflow is straightforward.
## Getting started
### [For Next.js](docs/get-started/next-js.md)
[A step by step guide for getting started](docs/get-started/next-js.md)
### For Nuxt.js <img src="https://img.shields.io/badge/-Coming%20Soon-lightgray" height="12" align="top">
[A complete sample with a collaborative todo app](tree/main/samples/todo)
### For SvelteKit <img src="https://img.shields.io/badge/-Coming%20Soon-lightgray" height="12" align="top">
## How does it work?

@@ -100,6 +96,6 @@

1. Modeling data and mapping the model to DB schema and program types
1. Modeling data and mapping the model to DB schema and programmable client library
1. Integrating with authentication
1. Generating CRUD APIs and enforcing data access policies
1. Providing type-safe client CRUD library
1. Providing type-safe React hooks

@@ -166,6 +162,8 @@ Let's briefly go through each of them in this section.

Please **beware** that policy checking is only applied when data access is done using the generated client-side hooks or, equivalently, the RESTful API. If you use `service.db` to access the database directly from server-side code, policies are bypassed, and you have to do all necessary checking by yourself. We've planned to add helper functions for "injecting" the policy checking on the server side in the future.
Please **BEWARE** that policy checking is only applied when data access is done using the generated client-side hooks or, equivalently, the RESTful API. If you use `service.db` to access the database directly from server-side code, policies are bypassed, and you have to do all necessary checking by yourself. We've planned to add helper functions for "injecting" the policy checking on the server side in the future.
### Type-safe client library
### Type-safe React hooks
Strongly-typed React hooks are generated for CRUD operations, saving the need to write boilerplate code.
Thanks to Prisma's power, ZenStack generates accurate Typescript types for your data models:

@@ -183,8 +181,4 @@

#### For Next.js
The generated CRUD services should be mounted at `/api/zenstack` route. The following React hooks are generated for each data model:
The generated CRUD services should be mounted at `/api/zenstack` route. React hooks are generated for calling these services without explicitly writing Http requests.
The following hooks methods are generated:
- find: listing entities with filtering, ordering, pagination, and nested relations

@@ -286,3 +280,3 @@

[Discord](https://discord.gg/dbuC9ZWc) [Twitter](https://twitter.com/zenstackhq)
[Discussions](../discussions) [Issues](../issues)
[Discord](https://go.zenstack.dev/chat) | [Twitter](https://twitter.com/zenstackhq) |
[Discussions](../discussions) | [Issues](../issues)

@@ -66,3 +66,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

'ζ'
)} ZenStack simplifies fullstack development by generating backend services and Typescript clients from a data model.\n\nDocumentation: https://zenstack.dev/doc.`
)} ZenStack simplifies fullstack development by generating backend services and Typescript clients from a data model.\n\nDocumentation: https://go.zenstack.dev/doc.`
)

@@ -69,0 +69,0 @@ .showHelpAfterError()

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc