@alevnyacow/nzmt 0.34.3 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,20 +10,50 @@
|
|
|
10
10
|
|
|
11
11
|
Scaffold full-stack modules in Next.js in seconds with **Next Zod Modules Toolkit (NZMT)**.
|
|
12
12
|
|
|
13
|
-
Get a DDD-inspired architecture with a contract-first approach out of the box.
|
|
13
|
+
Get a DDD-inspired architecture with a contract-first approach out of the box.
|
|
14
14
|
|
|
15
15
|
Batteries included! ✨
|
|
16
16
|
|
|
17
|
-
# TL;DR
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
# Try it!
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
(may not work on Safari)
|
|
20
|
+
(stackblitz may not work on Safari)
|
|
24
21
|
|
|
25
22
|
https://stackblitz.com/edit/nzmt-playground
|
|
26
23
|
|
|
24
|
+
# What you get
|
|
25
|
+
|
|
26
|
+
Production-ready backend + React Query hooks in seconds. After running:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx nzmt crud-api user
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
You instantly have:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
server/
|
|
36
|
+
entities/user/... # user entity
|
|
37
|
+
stores/user/... # user stores (contract, in-memory, prisma)
|
|
38
|
+
services/user/... # service
|
|
39
|
+
controllers/user/... # API controller
|
|
40
|
+
|
|
41
|
+
app/api/user/... # api routes
|
|
42
|
+
|
|
43
|
+
ui/shared/queries/user/... # react queries
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
NZMT also comes with useful infrastructure like DI, logging, in-memory stores, unified errors, and endpoint guards. All code is editable, so you stay in full control. Full `crud-api` is only one of cases, you can scaffold entities, stores, services, controllers and infrastructure helpers on its own and combine them any way you want. Glossary of NZMT cli commands is provided below.
|
|
47
|
+
|
|
48
|
+
Fully wired flow:
|
|
49
|
+
```bash
|
|
50
|
+
# client fetching
|
|
51
|
+
Client → React Query → API → Controller → Service → Store → DB
|
|
52
|
+
|
|
53
|
+
# server actions
|
|
54
|
+
Server Action → Service → Store → DB
|
|
55
|
+
```
|
|
56
|
+
|
|
27
57
|
# Quick start with Prisma
|
|
28
58
|
|
|
29
59
|
Assuming you have
|
|
@@ -296,12 +326,10 @@ A “Repository” is a specific design pattern for managing data. NZMT prefers
|
|
|
296
326
|
|
|
297
327
|
`NZMT` combines the best of both worlds in one package while staying in plain Next.js:
|
|
298
328
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
- Full control over your code
|
|
307
|
-
- No extra client-server layers
|
|
329
|
+
| Feature | NZMT | tRPC | Nest |
|
|
330
|
+
| ----------------- | ---- | ---- | ---- |
|
|
331
|
+
| Type safety | ✅ | ✅ | ⚠️ |
|
|
332
|
+
| Scaffolding | ✅ | ❌ | ⚠️ |
|
|
333
|
+
| Architecture | ✅ | ❌ | ✅ |
|
|
334
|
+
| Boilerplate | Low | Low | High |
|
|
335
|
+
| No framework lock-in | ✅ | ✅ | ❌ |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alevnyacow/nzmt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "Next Zod Modules Toolkit",
|
|
5
5
|
"keywords": ["next", "full-stack", "server", "backend", "cli", "scaffolding", "zod", "rest", "contract programming", "contract-first", "react-query", "ddd", "domain-driven"],
|
|
6
6
|
"repository": {
|