Skip to content

Commit 79a4362

Browse files
authored
doc: v3 GA (#531)
* doc: v3 GA * update nestjs guide * update homepage * update * update * update * update * update docs * update * update
1 parent 86bbb8c commit 79a4362

File tree

437 files changed

+1069
-16481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

437 files changed

+1069
-16481
lines changed

blog/better-auth/index.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ The initial dashboard UI looks like:
204204

205205
## Setting up ZenStack
206206

207-
In the following sections, we'll use ZenStack to implement the access control requirements. ZenStack uses its own DSL called [ZModel](/docs/the-complete-guide/part1/zmodel) to define data models and access policy rules. ZModel is a superset of the Prisma schema language. The ZenStack CLI can generate a Prisma schema from a ZModel file so that downstream Prisma consumers (like better-auth) will continue to work seamlessly.
207+
In the following sections, we'll use ZenStack to implement the access control requirements. ZenStack uses its own DSL called [ZModel](/docs/2.x/the-complete-guide/part1/zmodel) to define data models and access policy rules. ZModel is a superset of the Prisma schema language. The ZenStack CLI can generate a Prisma schema from a ZModel file so that downstream Prisma consumers (like better-auth) will continue to work seamlessly.
208208

209209
Let's initialize the project with ZenStack:
210210

@@ -346,9 +346,9 @@ export {
346346
};
347347
```
348348
349-
This will expose a set of CRUD endpoints like `/api/model/TodoList/findMany`, `/api/model/TodoList/create`, etc. You can find more details [here](https://zenstack.dev/docs/reference/server-adapters/api-handlers/rpc).
349+
This will expose a set of CRUD endpoints like `/api/model/TodoList/findMany`, `/api/model/TodoList/create`, etc. You can find more details [here](https://zenstack.dev/docs/2.x/reference/server-adapters/api-handlers/rpc).
350350
351-
Although we can call these APIs with `fetch` directly, a much easier way is to leverage ZenStack's [TanStack Query plugin](https://zenstack.dev/docs/reference/plugins/tanstack-query) to generate client-side hooks.
351+
Although we can call these APIs with `fetch` directly, a much easier way is to leverage ZenStack's [TanStack Query plugin](https://zenstack.dev/docs/2.x/reference/plugins/tanstack-query) to generate client-side hooks.
352352
353353
```bash
354354
npm install @zenstackhq/tanstack-query
@@ -434,7 +434,7 @@ type Auth {
434434
}
435435
```
436436
437-
Now, we're ready to write the policy rules. You can find more information about access policies [here](https://zenstack.dev/docs/the-complete-guide/part1/access-policy/).
437+
Now, we're ready to write the policy rules. You can find more information about access policies [here](https://zenstack.dev/docs/2.x/the-complete-guide/part1/access-policy/).
438438
439439
#### 1. Tenant segregation
440440

blog/check-function/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ There are two possible ways to add such support:
181181
}
182182
```
183183

184-
- B: make it work with [collection predicate expressions](../docs/reference/zmodel-language#collection-predicate-expressions)
184+
- B: make it work with [collection predicate expressions](../docs/2.x/reference/zmodel-language#collection-predicate-expressions)
185185

186186
```zmodel
187187

blog/clerk-multitenancy/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ npm install --save-dev prisma zenstack
105105
npm install @prisma/client @zenstackhq/runtime
106106
```
107107

108-
Then we can create the database schema. Please note that we're creating a **schema.zmodel** file (as a replacement of "schema.prisma"). The [ZModel language](/docs/the-complete-guide/part1/zmodel) is a superset of Prisma schema language, allowing you to model both the data schema and access control policies. In this section, we'll only focus on the data modeling part.
108+
Then we can create the database schema. Please note that we're creating a **schema.zmodel** file (as a replacement of "schema.prisma"). The [ZModel language](/docs/2.x/the-complete-guide/part1/zmodel) is a superset of Prisma schema language, allowing you to model both the data schema and access control policies. In this section, we'll only focus on the data modeling part.
109109

110110
```zmodel title="/schema.zmodel"
111111
datasource db {

blog/code-as-doc/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ I will walk you through the steps of how to create this tool.
105105
106106
Like many wonderful tools in the web development world, ZenStack adopts a plugin-based architecture. At the core of the system is the ZModel schema, around which features are implemented as plugins. Let's create a plugin to generate a markdown for a ZModel so it can be easily adopted by others.
107107
108-
> For brevity, we'll focus on core parts. See the [ZenStack documentation](https://zenstack.dev/docs/the-complete-guide/part2/writing-plugins) for complete plugin development details.
108+
> For brevity, we'll focus on core parts. See the [ZenStack documentation](https://zenstack.dev/docs/2.x/the-complete-guide/part2/writing-plugins) for complete plugin development details.
109109
>
110110
111111
A plugin is simply a Node.js module that has the two parts:

blog/custom-attributes.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ So as Dan Abramov said in the [React Documentary](https://youtu.be/8pDqJVdNa44?t
196196
197197
# Custom attributes of ZenStack
198198
199-
[ZenStack](https://zenstack.dev/?utm_campaign=devto&utm_medium=organic&utm_content=custom_attribute) is the toolkit that supercharges Prisma with a powerful access control layer and unleashes its full potential for full-stack development. Its schema file [ZModel](https://zenstack.dev/docs/reference/zmodel-language) is a superset of Prisma schema.
199+
[ZenStack](https://zenstack.dev/?utm_campaign=devto&utm_medium=organic&utm_content=custom_attribute) is the toolkit that supercharges Prisma with a powerful access control layer and unleashes its full potential for full-stack development. Its schema file [ZModel](https://zenstack.dev/docs/2.x/reference/zmodel-language) is a superset of Prisma schema.
200200
201201
Regardless of ZenStack, the above Prisma file is supposed to be looks like below ideally:
202202
@@ -212,7 +212,7 @@ model User {
212212
213213
Actually, that’s exactly what the ZModel would be. You can find it in our example code:
214214
215-
[https://zenstack.dev/docs/category/quick-start/nextjs#3-preparing-the-user-model-for-authentication](https://zenstack.dev/docs/category/quick-start/nextjs#3-preparing-the-user-model-for-authentication)
215+
[https://zenstack.dev/docs/2.x/category/quick-start/nextjs#3-preparing-the-user-model-for-authentication](https://zenstack.dev/docs/2.x/category/quick-start/nextjs#3-preparing-the-user-model-for-authentication)
216216
217217
The above attributes are already predefined in our standard library as below:
218218

blog/form-validation/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ model Signup {
8181
A few quick notes:
8282
- We used attributes like `@email` and `@endsWith` to attach validation rules to fields.
8383
- We also used the model-level attribute `@@validate` to express validation rules involving multiple fields and conditions.
84-
- The `@@allow` attribute grants "create" and "read" access to the table. By default, all operations are denied. Access control is not a focus of this post, but you can learn more [here](https://zenstack.dev/docs/the-complete-guide/part1/access-policy/) if interested.
84+
- The `@@allow` attribute grants "create" and "read" access to the table. By default, all operations are denied. Access control is not a focus of this post, but you can learn more [here](https://zenstack.dev/docs/2.x/the-complete-guide/part1/access-policy/) if interested.
8585

8686
Run the following commands to generate a Prisma schema and synchronize it to the database:
8787

blog/json-typing/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,4 @@ const images = await db.image.findMany({
166166
});
167167
```
168168

169-
Is it useful, or can it be confusing (as it looks the same as relation filters)? Let us know by leaving a comment below. You can also learn more about this feature in the [official guide](https://zenstack.dev/docs/guides/typing-json).
169+
Is it useful, or can it be confusing (as it looks the same as relation filters)? Let us know by leaving a comment below. You can also learn more about this feature in the [official guide](https://zenstack.dev/docs/2.x/guides/typing-json).

blog/modern-sql-dx/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ There have been many security concerns about using cloud-based databases directl
3434

3535
Beneath the simple surface, cloud database providers have been working hard to automate many things for you:
3636

37-
- Scaling up and down? Don’t worry about it. When idle, the services can shrink to [literally zero CPU usage](https://neon.tech/docs/reference/glossary#scale-to-zero) and rapidly scale up as traffic surges.
37+
- Scaling up and down? Don’t worry about it. When idle, the services can shrink to [literally zero CPU usage](https://neon.tech/docs/2.x/reference/glossary#scale-to-zero) and rapidly scale up as traffic surges.
3838
- Bottomless storage, so running out of disk space is never a worry anymore.
3939
- Sharding has always been a headache to manage and used to require lots of application code changes. Now, it can be achieved in a [much less intrusive way](https://planetscale.com/docs/concepts/sharding).
4040
- Not proficient with managing indexes? The services monitor query patterns and auto-tune indexes for you.

blog/multi-tenant/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ Then whenever the place you use the Prisma client, just wrap it with the `enhanc
277277

278278
If you feel interested in the access policy, you can find more detail below:
279279

280-
**[Understanding Access Policies](https://zenstack.dev/docs/the-complete-guide/part1/access-policy/)**
280+
**[Understanding Access Policies](https://zenstack.dev/docs/2.x/the-complete-guide/part1/access-policy/)**
281281

282282
There is also a tutorial for how to create the project step by step:
283283

blog/nest-api/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ export class AppModule implements NestModule {
325325
}
326326
```
327327
328-
That's it! Now we have a complete set of RESTful CRUD APIs at "/api/zen" that conforms to the [JSON:API](https://jsonapi.org/) specification, and the access policies fully protect the APIs. The API provides rich filtering and relation-fetching capabilities. The following are some examples; you can find more details [here](https://zenstack.dev/docs/reference/server-adapters/api-handlers/rest#endpoints-and-features).
328+
That's it! Now we have a complete set of RESTful CRUD APIs at "/api/zen" that conforms to the [JSON:API](https://jsonapi.org/) specification, and the access policies fully protect the APIs. The API provides rich filtering and relation-fetching capabilities. The following are some examples; you can find more details [here](https://zenstack.dev/docs/2.x/reference/server-adapters/api-handlers/rest#endpoints-and-features).
329329
330330
```bash
331331
# Fetch posts together with their authors

0 commit comments

Comments
 (0)