@alevnyacow/nzmt 0.34.2 → 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.
Files changed (2) hide show
  1. package/README.md +43 -16
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -6,25 +6,54 @@
6
6
  <p align="center">
7
7
  <a href="https://badge.fury.io/js/@alevnyacow%2Fnzmt" target="_blank"><img src='https://badge.fury.io/js/@alevnyacow%2Fnzmt.svg'></img></a>
8
8
  <img src='https://img.shields.io/npm/l/%40alevnyacow%2Fnzmt'></img>
9
- <img src='https://img.shields.io/bundlephobia/minzip/%40alevnyacow/nzmt'></img>
10
9
  </p>
11
10
 
12
11
  Scaffold full-stack modules in Next.js in seconds with **Next Zod Modules Toolkit (NZMT)**.
13
12
 
14
- Get a DDD-inspired architecture with a contract-first approach out of the box. NZMT also comes with useful infrastructure like DI, logging, in-memory stores, unified errors, and endpoint guards.
13
+ Get a DDD-inspired architecture with a contract-first approach out of the box.
15
14
 
16
15
  Batteries included! ✨
17
16
 
18
- # TL;DR
19
17
 
20
- Initialize NZMT once, run the scaffolder, and tweak a few files to get a production-ready backend usable via Server Actions with ready-to-use React Query hooks.
18
+ # Try it!
21
19
 
22
- # Playground on Stackblitz
23
-
24
- (may not work on Safari)
20
+ (stackblitz may not work on Safari)
25
21
 
26
22
  https://stackblitz.com/edit/nzmt-playground
27
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
+
28
57
  # Quick start with Prisma
29
58
 
30
59
  Assuming you have
@@ -297,12 +326,10 @@ A “Repository” is a specific design pattern for managing data. NZMT prefers
297
326
 
298
327
  `NZMT` combines the best of both worlds in one package while staying in plain Next.js:
299
328
 
300
- - From tRPC type safety and developer experience
301
- - From NestJS structured architecture (but more DDD-inspired) with intuitive DI
302
-
303
- Plus:
304
-
305
- - No framework lock-in
306
- - No magic runtime
307
- - Full control over your code
308
- - 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.34.2",
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": {