@alevnyacow/nzmt 0.15.0 → 0.15.2

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 +23 -19
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -6,35 +6,32 @@
6
6
 
7
7
  # About
8
8
 
9
- NZMT is a combination of a convenient library for building application modules validated with Zod schemas and a powerful scaffolding tool.
9
+ **Not** a framework. Seriously, we have enough of those. NZMT is just the tools you always wanted in Next.js, plus a scaffolder that spins up server logic and client queries. Full-stack, the Next.js way!
10
10
 
11
- It combines dependency injection, Zod validation and a DDD-inspired architecture,
12
- while removing most of the boilerplate through code generation out of the box.
11
+ Think: dependency injection + Zod validation + DDD vibes... but without drowning in boilerplate. You write the fun stuff; NZMT handles the boring stuff.
13
12
 
14
- Batteries included!
13
+ Batteries included.
15
14
 
16
15
  ## Why NZMT?
17
16
 
18
- - You want to focus on domain logic without full DDD complexity
19
- - You’re tired of rewriting CRUD, data layer logic, DTOs, and validation
20
- - You want to follow best practices without overengineering or repetitive boilerplate
21
- - You want your application to be runtime-safe
22
- - You don't want to waste time on another framework, you want to keep using plain Next.js, but with better structure and speed
23
- - You want a backend that can evolve into a full-stack solution
24
- - You dig cool cartoonish fonts in logos and you don't see it this much nowadays
17
+ - Focus on your domain logic without drowning in full-blown DDD.
18
+ - Keep using plain Next.js, just faster and cleaner no extra framework required.
19
+ - Watch entities, stores, services, controllers, handlers, and client-side queries appear automatically (and yes, it’s actually fun).
25
20
 
26
- You focus on business logic; NZMT handles the infrastructure.
21
+ # Quick start (Prisma + client-side queries)
27
22
 
28
- # Quick start with Prisma
23
+ Assuming you have a Next.js project with a generated Prisma client, `User` Prisma model and configured `@tanstack/react-query`:
29
24
 
30
- Assuming you have a Next.js project with a generated Prisma client and a `User` Prisma model:
25
+ ## Initialization
26
+
27
+ 1. Install required dependencies and NZMT itself:
31
28
 
32
- 1. Install required peer dependencies and the toolkit itself.
33
29
  ```bash
34
30
  npm install inversify zod reflect-metadata @alevnyacow/nzmt
35
31
  ```
36
32
 
37
33
  2. Enable `Experimental decorators` and `Emit Decorator Metadata` options in your `tsconfig.json`.
34
+
38
35
  ```json
39
36
  {
40
37
  "compilerOptions": {
@@ -45,11 +42,15 @@ npm install inversify zod reflect-metadata @alevnyacow/nzmt
45
42
  ```
46
43
 
47
44
  3. Initialize NZMT (must be done once). This will set up all required infrastructure and configuration for you:
45
+
48
46
  ```bash
49
47
  npx nzmt init prismaClientPath:@/app/generated/prisma/client
50
48
  ```
51
49
 
52
- 4. Now you can scaffold everything you need for `User` entity CRUD API in one CLI command:
50
+ ## Scaffolding
51
+
52
+ Now you can scaffold everything you need for `User` entity CRUD API in one CLI command:
53
+
53
54
  ```bash
54
55
  npx nzmt crud-api user
55
56
  ```
@@ -62,12 +63,15 @@ This will generate:
62
63
  - `UserController` with ready-to-use API endpoints
63
64
  - Fully typed `UserAPI` contract (endpoints + DTOs) for client usage
64
65
  - API `route handlers` inside your `app` folder
66
+ - `React queries`. Fully typed and ready to be used in your client-side code!
67
+
68
+ **All code is editable - you stay in full control!**
65
69
 
66
- All code is editable - you stay in full control.
70
+ So, only two things left to do:
67
71
 
68
- 5. **Describe entity properties and validation rules using Zod** for the `User` entity in the scaffolded file `/shared/entities/user/user.entity.ts`.
72
+ - Describe entity properties and validation rules using Zod for the `User` entity in the scaffolded file `/shared/entities/user/user.entity.ts`.
69
73
 
70
- 6. **Implement Prisma mappers** in `/server/stores/user/user.store.prisma.ts`.
74
+ - Implement Prisma mappers in `/server/stores/user/user.store.prisma.ts`.
71
75
  All methods and contracts are already scaffolded; you only need to describe the mappers themselves. RAM store implementation works out of the box.
72
76
 
73
77
  # Design principles
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alevnyacow/nzmt",
3
- "version": "0.15.0",
3
+ "version": "0.15.2",
4
4
  "description": "Next Zod Modules Toolkit",
5
5
  "repository": {
6
6
  "type": "git",