@alevnyacow/nzmt 0.34.3 → 0.35.1
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 +46 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,20 +10,52 @@
|
|
|
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
|
+
Get production-ready backend + React Query hooks after one CLI command with NZMT. Install and initialize it, then run:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx nzmt crud-api user
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
This will instantly scaffold:
|
|
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
|
+
Everything is already setup and ready-to-use after a few tweaks. See `Quick start with Prisma` section for more detailed information.
|
|
47
|
+
|
|
48
|
+
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. List of all NZMT cli commands is provided in `CLI commands glossary` sections.
|
|
49
|
+
|
|
50
|
+
Fully wired flow:
|
|
51
|
+
```bash
|
|
52
|
+
# client fetching
|
|
53
|
+
Client → React Query → API → Controller → Service → Store → DB
|
|
54
|
+
|
|
55
|
+
# server actions
|
|
56
|
+
Server Action → Service → Store → DB
|
|
57
|
+
```
|
|
58
|
+
|
|
27
59
|
# Quick start with Prisma
|
|
28
60
|
|
|
29
61
|
Assuming you have
|
|
@@ -128,7 +160,7 @@ export default async function Page() {
|
|
|
128
160
|
}
|
|
129
161
|
```
|
|
130
162
|
|
|
131
|
-
#
|
|
163
|
+
# CLI commands glossary
|
|
132
164
|
|
|
133
165
|
## Initialization
|
|
134
166
|
|
|
@@ -296,12 +328,10 @@ A “Repository” is a specific design pattern for managing data. NZMT prefers
|
|
|
296
328
|
|
|
297
329
|
`NZMT` combines the best of both worlds in one package while staying in plain Next.js:
|
|
298
330
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
- Full control over your code
|
|
307
|
-
- No extra client-server layers
|
|
331
|
+
| Feature | NZMT | tRPC | Nest |
|
|
332
|
+
| ----------------- | ---- | ---- | ---- |
|
|
333
|
+
| Type safety | ✅ | ✅ | ⚠️ |
|
|
334
|
+
| Scaffolding | ✅ | ❌ | ⚠️ |
|
|
335
|
+
| Architecture | ✅ | ❌ | ✅ |
|
|
336
|
+
| Boilerplate | Low | Low | High |
|
|
337
|
+
| 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.1",
|
|
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": {
|