exp-node-server 1.1.0 → 1.1.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 +65 -115
- package/package.json +4 -2
- package/templates/mongoose/readme.md +65 -115
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# ⚡ Express
|
|
1
|
+
# ⚡ Express Server CLI
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/exp-cli-gen)
|
|
4
4
|
[](https://www.npmjs.com/package/exp-cli-gen)
|
|
@@ -14,167 +14,117 @@
|
|
|
14
14
|
|
|
15
15
|
## 🚀 Overview
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
It automatically creates a complete module structure — including **models, controllers, services, routes, Zod validations, and Swagger documentation** — all in one command.
|
|
17
|
+
A powerful `Express + TypeScript CLI` that instantly generates scalable `backend` modules with `Mongoose `/ `Prisma`, `Zod` `validation`, and `Swagger` documentation.
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
---
|
|
19
|
+
This tool helps developers quickly scaffold `clean`, `modular` `Express` APIs with minimal setup.
|
|
23
20
|
|
|
24
21
|
## ✨ Features
|
|
25
22
|
|
|
26
|
-
-
|
|
27
|
-
- 🧩
|
|
28
|
-
- 📘 Adds Swagger documentation automatically
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
23
|
+
- ⚡ Generate complete `Express` + `TypeScript` modules
|
|
24
|
+
- 🧩 Built-in `Mongoose` / `Prisma` support
|
|
25
|
+
- 📘 Adds Swagger documentation automatically
|
|
26
|
+
- 📘 Automatic `Swagger` documentation
|
|
27
|
+
- 🔐 `Zod` validation ready
|
|
28
|
+
- 🏗️ `Modular` clean architecture
|
|
29
|
+
- 🚀 One command project setup
|
|
30
|
+
- 🔄 Add modules anytime
|
|
31
|
+
- 📦 Zero boilerplate setup
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
## 📦 Quick Start
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
Run directly using npx (recommended):
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
npm install -g exp-cli-gen
|
|
37
|
+
```Bash
|
|
38
|
+
npx exp-node-server -c my-api
|
|
42
39
|
```
|
|
43
|
-
Or run directly using npx (recommended):
|
|
44
40
|
|
|
45
|
-
|
|
46
|
-
npx exp-cli-gen <module-name>
|
|
47
|
-
```
|
|
48
|
-
## Usage
|
|
49
|
-
🏗️ Generate your first module
|
|
41
|
+
This will:
|
|
50
42
|
|
|
51
|
-
|
|
43
|
+
- Create an Express starter project
|
|
44
|
+
- Install dependencies
|
|
45
|
+
- Prepare the project for development
|
|
52
46
|
|
|
53
|
-
|
|
54
|
-
npx exp-cli-gen test
|
|
55
|
-
```
|
|
56
|
-
First run example:
|
|
47
|
+
## 🧩 Generate a Module
|
|
57
48
|
|
|
58
|
-
|
|
59
|
-
Need to install the following packages:
|
|
60
|
-
exp-cli-gen@1.0.1
|
|
61
|
-
Ok to proceed? (y)
|
|
49
|
+
Inside your project run:
|
|
62
50
|
|
|
63
|
-
|
|
64
|
-
|
|
51
|
+
```bash
|
|
52
|
+
npx express-server-cli -g <module-name>
|
|
53
|
+
```
|
|
65
54
|
|
|
66
|
-
|
|
55
|
+
Example: `npx express-server-cli -g order`
|
|
67
56
|
|
|
68
|
-
|
|
57
|
+
Output:
|
|
69
58
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
✔
|
|
73
|
-
✔
|
|
74
|
-
✔
|
|
75
|
-
✔
|
|
76
|
-
✔
|
|
77
|
-
✔
|
|
78
|
-
✔ test.swagger.ts created
|
|
59
|
+
```Bash
|
|
60
|
+
✔ order.interface.ts created
|
|
61
|
+
✔ order.schema.ts created
|
|
62
|
+
✔ order.validation.ts created
|
|
63
|
+
✔ order.route.ts created
|
|
64
|
+
✔ order.controller.ts created
|
|
65
|
+
✔ order.service.ts created
|
|
66
|
+
✔ order.swagger.ts created
|
|
79
67
|
|
|
80
|
-
🔗 Route
|
|
81
|
-
📘 Swagger
|
|
82
|
-
✨ Module 'test' created successfully!
|
|
68
|
+
🔗 Route registered in routes.ts
|
|
69
|
+
📘 Swagger docs registered
|
|
83
70
|
|
|
84
71
|
```
|
|
85
72
|
|
|
86
73
|
## 📁 Generated Module Structure
|
|
87
74
|
|
|
88
|
-
Each
|
|
75
|
+
Each module follows a clean structure:
|
|
89
76
|
|
|
90
|
-
```
|
|
77
|
+
```Bash
|
|
91
78
|
src/app/modules/<module-name>/
|
|
92
|
-
├── <module
|
|
93
|
-
├── <module
|
|
94
|
-
├── <module
|
|
95
|
-
├── <module
|
|
96
|
-
├── <module
|
|
97
|
-
├── <module
|
|
98
|
-
└── <module
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
## 🔄 Add More Modules
|
|
102
|
-
|
|
103
|
-
Need another module? Just run:
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
npx exp-cli-gen products
|
|
79
|
+
├── <module>.interface.ts
|
|
80
|
+
├── <module>.schema.ts
|
|
81
|
+
├── <module>.validation.ts
|
|
82
|
+
├── <module>.route.ts
|
|
83
|
+
├── <module>.controller.ts
|
|
84
|
+
├── <module>.service.ts
|
|
85
|
+
└── <module>.swagger.ts
|
|
107
86
|
```
|
|
108
87
|
|
|
109
|
-
|
|
88
|
+
## ⚙️ Run the Project
|
|
110
89
|
|
|
111
|
-
Example output:
|
|
112
90
|
```bash
|
|
113
|
-
|
|
114
|
-
📦 Dependencies already installed. Skipping npm install.
|
|
115
|
-
🧩 Generating module: products...
|
|
116
|
-
✔ products files created
|
|
117
|
-
✨ Module 'products' created successfully!
|
|
118
|
-
|
|
119
|
-
src/app/modules/products/
|
|
120
|
-
├── products.interface.ts
|
|
121
|
-
├── products.schema.ts
|
|
122
|
-
├── products.validation.ts
|
|
123
|
-
├── products.route.ts
|
|
124
|
-
├── products.controller.ts
|
|
125
|
-
├── products.service.ts
|
|
126
|
-
└── products.swagger.ts
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
Then, refresh your Swagger docs at:
|
|
130
|
-
```bash
|
|
131
|
-
http://localhost:5000/docs
|
|
91
|
+
npm run dev
|
|
132
92
|
```
|
|
133
93
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
## ⚙️ Configuration
|
|
94
|
+
Swagger docs available at:
|
|
139
95
|
|
|
140
|
-
After setup, update your .env file following the .env.example file in the starter project.
|
|
141
|
-
|
|
142
|
-
To start the server:
|
|
143
|
-
```bash
|
|
144
|
-
npm run dev
|
|
145
|
-
```
|
|
146
|
-
Open Swagger documentation at:
|
|
147
96
|
```bash
|
|
148
97
|
http://localhost:5000/docs
|
|
149
98
|
```
|
|
150
99
|
|
|
151
|
-
---
|
|
152
100
|
## 🧠 Tech Stack
|
|
153
101
|
|
|
154
102
|
- Express.js — Backend framework
|
|
155
103
|
- TypeScript — Strongly typed JavaScript
|
|
156
|
-
- Mongoose — MongoDB
|
|
104
|
+
- Mongoose — MongoDB ODM
|
|
105
|
+
- Prisma — PostgreSQL ORM
|
|
157
106
|
- Zod — Runtime schema validation
|
|
107
|
+
- JWT — Authentication
|
|
158
108
|
- Swagger — API documentation
|
|
159
|
-
- CLI (Node.js) — Command-line automation
|
|
160
109
|
|
|
161
|
-
|
|
162
|
-
## 🧩 Starter Pack Repository
|
|
110
|
+
## 👨💻 Author
|
|
163
111
|
|
|
164
|
-
|
|
112
|
+
### Abumahid
|
|
165
113
|
|
|
166
|
-
|
|
114
|
+
GitHub
|
|
115
|
+
https://github.com/dev-abumahid
|
|
167
116
|
|
|
168
|
-
|
|
169
|
-
|
|
117
|
+
npm
|
|
118
|
+
https://www.npmjs.com/~dev_abumahid
|
|
170
119
|
|
|
171
|
-
|
|
120
|
+
Portfolio
|
|
121
|
+
https://abumahid.me
|
|
172
122
|
|
|
173
|
-
|
|
123
|
+
LinkedIn
|
|
124
|
+
https://linkedin.com/in/md-abu-mahid-islam
|
|
174
125
|
|
|
175
|
-
|
|
126
|
+
## ⭐ Support
|
|
176
127
|
|
|
177
|
-
|
|
178
|
-
### ⭐ Star this project
|
|
128
|
+
If you find this project helpful, consider giving it a ⭐ on `GitHub`.
|
|
179
129
|
|
|
180
|
-
|
|
130
|
+
It helps the project grow and reach more developers.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "exp-node-server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"exp-node-server": "./bin/cli.js"
|
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
"nodejs",
|
|
25
25
|
"api",
|
|
26
26
|
"module-generator",
|
|
27
|
-
"exp-
|
|
27
|
+
"exp-node-server",
|
|
28
|
+
"exp-node",
|
|
29
|
+
"server"
|
|
28
30
|
],
|
|
29
31
|
"engines": {
|
|
30
32
|
"node": ">=20.0.0"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# ⚡ Express
|
|
1
|
+
# ⚡ Express Server CLI
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/exp-cli-gen)
|
|
4
4
|
[](https://www.npmjs.com/package/exp-cli-gen)
|
|
@@ -14,167 +14,117 @@
|
|
|
14
14
|
|
|
15
15
|
## 🚀 Overview
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
It automatically creates a complete module structure — including **models, controllers, services, routes, Zod validations, and Swagger documentation** — all in one command.
|
|
17
|
+
A powerful `Express + TypeScript CLI` that instantly generates scalable `backend` modules with `Mongoose `/ `Prisma`, `Zod` `validation`, and `Swagger` documentation.
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
---
|
|
19
|
+
This tool helps developers quickly scaffold `clean`, `modular` `Express` APIs with minimal setup.
|
|
23
20
|
|
|
24
21
|
## ✨ Features
|
|
25
22
|
|
|
26
|
-
-
|
|
27
|
-
- 🧩
|
|
28
|
-
- 📘 Adds Swagger documentation automatically
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
23
|
+
- ⚡ Generate complete `Express` + `TypeScript` modules
|
|
24
|
+
- 🧩 Built-in `Mongoose` / `Prisma` support
|
|
25
|
+
- 📘 Adds Swagger documentation automatically
|
|
26
|
+
- 📘 Automatic `Swagger` documentation
|
|
27
|
+
- 🔐 `Zod` validation ready
|
|
28
|
+
- 🏗️ `Modular` clean architecture
|
|
29
|
+
- 🚀 One command project setup
|
|
30
|
+
- 🔄 Add modules anytime
|
|
31
|
+
- 📦 Zero boilerplate setup
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
## 📦 Quick Start
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
Run directly using npx (recommended):
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
npm install -g exp-cli-gen
|
|
37
|
+
```Bash
|
|
38
|
+
npx exp-node-server -c my-api
|
|
42
39
|
```
|
|
43
|
-
Or run directly using npx (recommended):
|
|
44
40
|
|
|
45
|
-
|
|
46
|
-
npx exp-cli-gen <module-name>
|
|
47
|
-
```
|
|
48
|
-
## Usage
|
|
49
|
-
🏗️ Generate your first module
|
|
41
|
+
This will:
|
|
50
42
|
|
|
51
|
-
|
|
43
|
+
- Create an Express starter project
|
|
44
|
+
- Install dependencies
|
|
45
|
+
- Prepare the project for development
|
|
52
46
|
|
|
53
|
-
|
|
54
|
-
npx exp-cli-gen test
|
|
55
|
-
```
|
|
56
|
-
First run example:
|
|
47
|
+
## 🧩 Generate a Module
|
|
57
48
|
|
|
58
|
-
|
|
59
|
-
Need to install the following packages:
|
|
60
|
-
exp-cli-gen@1.0.1
|
|
61
|
-
Ok to proceed? (y)
|
|
49
|
+
Inside your project run:
|
|
62
50
|
|
|
63
|
-
|
|
64
|
-
|
|
51
|
+
```bash
|
|
52
|
+
npx express-server-cli -g <module-name>
|
|
53
|
+
```
|
|
65
54
|
|
|
66
|
-
|
|
55
|
+
Example: `npx express-server-cli -g order`
|
|
67
56
|
|
|
68
|
-
|
|
57
|
+
Output:
|
|
69
58
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
✔
|
|
73
|
-
✔
|
|
74
|
-
✔
|
|
75
|
-
✔
|
|
76
|
-
✔
|
|
77
|
-
✔
|
|
78
|
-
✔ test.swagger.ts created
|
|
59
|
+
```Bash
|
|
60
|
+
✔ order.interface.ts created
|
|
61
|
+
✔ order.schema.ts created
|
|
62
|
+
✔ order.validation.ts created
|
|
63
|
+
✔ order.route.ts created
|
|
64
|
+
✔ order.controller.ts created
|
|
65
|
+
✔ order.service.ts created
|
|
66
|
+
✔ order.swagger.ts created
|
|
79
67
|
|
|
80
|
-
🔗 Route
|
|
81
|
-
📘 Swagger
|
|
82
|
-
✨ Module 'test' created successfully!
|
|
68
|
+
🔗 Route registered in routes.ts
|
|
69
|
+
📘 Swagger docs registered
|
|
83
70
|
|
|
84
71
|
```
|
|
85
72
|
|
|
86
73
|
## 📁 Generated Module Structure
|
|
87
74
|
|
|
88
|
-
Each
|
|
75
|
+
Each module follows a clean structure:
|
|
89
76
|
|
|
90
|
-
```
|
|
77
|
+
```Bash
|
|
91
78
|
src/app/modules/<module-name>/
|
|
92
|
-
├── <module
|
|
93
|
-
├── <module
|
|
94
|
-
├── <module
|
|
95
|
-
├── <module
|
|
96
|
-
├── <module
|
|
97
|
-
├── <module
|
|
98
|
-
└── <module
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
## 🔄 Add More Modules
|
|
102
|
-
|
|
103
|
-
Need another module? Just run:
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
npx exp-cli-gen products
|
|
79
|
+
├── <module>.interface.ts
|
|
80
|
+
├── <module>.schema.ts
|
|
81
|
+
├── <module>.validation.ts
|
|
82
|
+
├── <module>.route.ts
|
|
83
|
+
├── <module>.controller.ts
|
|
84
|
+
├── <module>.service.ts
|
|
85
|
+
└── <module>.swagger.ts
|
|
107
86
|
```
|
|
108
87
|
|
|
109
|
-
|
|
88
|
+
## ⚙️ Run the Project
|
|
110
89
|
|
|
111
|
-
Example output:
|
|
112
90
|
```bash
|
|
113
|
-
|
|
114
|
-
📦 Dependencies already installed. Skipping npm install.
|
|
115
|
-
🧩 Generating module: products...
|
|
116
|
-
✔ products files created
|
|
117
|
-
✨ Module 'products' created successfully!
|
|
118
|
-
|
|
119
|
-
src/app/modules/products/
|
|
120
|
-
├── products.interface.ts
|
|
121
|
-
├── products.schema.ts
|
|
122
|
-
├── products.validation.ts
|
|
123
|
-
├── products.route.ts
|
|
124
|
-
├── products.controller.ts
|
|
125
|
-
├── products.service.ts
|
|
126
|
-
└── products.swagger.ts
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
Then, refresh your Swagger docs at:
|
|
130
|
-
```bash
|
|
131
|
-
http://localhost:5000/docs
|
|
91
|
+
npm run dev
|
|
132
92
|
```
|
|
133
93
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
## ⚙️ Configuration
|
|
94
|
+
Swagger docs available at:
|
|
139
95
|
|
|
140
|
-
After setup, update your .env file following the .env.example file in the starter project.
|
|
141
|
-
|
|
142
|
-
To start the server:
|
|
143
|
-
```bash
|
|
144
|
-
npm run dev
|
|
145
|
-
```
|
|
146
|
-
Open Swagger documentation at:
|
|
147
96
|
```bash
|
|
148
97
|
http://localhost:5000/docs
|
|
149
98
|
```
|
|
150
99
|
|
|
151
|
-
---
|
|
152
100
|
## 🧠 Tech Stack
|
|
153
101
|
|
|
154
102
|
- Express.js — Backend framework
|
|
155
103
|
- TypeScript — Strongly typed JavaScript
|
|
156
|
-
- Mongoose — MongoDB
|
|
104
|
+
- Mongoose — MongoDB ODM
|
|
105
|
+
- Prisma — PostgreSQL ORM
|
|
157
106
|
- Zod — Runtime schema validation
|
|
107
|
+
- JWT — Authentication
|
|
158
108
|
- Swagger — API documentation
|
|
159
|
-
- CLI (Node.js) — Command-line automation
|
|
160
109
|
|
|
161
|
-
|
|
162
|
-
## 🧩 Starter Pack Repository
|
|
110
|
+
## 👨💻 Author
|
|
163
111
|
|
|
164
|
-
|
|
112
|
+
### Abumahid
|
|
165
113
|
|
|
166
|
-
|
|
114
|
+
GitHub
|
|
115
|
+
https://github.com/dev-abumahid
|
|
167
116
|
|
|
168
|
-
|
|
169
|
-
|
|
117
|
+
npm
|
|
118
|
+
https://www.npmjs.com/~dev_abumahid
|
|
170
119
|
|
|
171
|
-
|
|
120
|
+
Portfolio
|
|
121
|
+
https://abumahid.me
|
|
172
122
|
|
|
173
|
-
|
|
123
|
+
LinkedIn
|
|
124
|
+
https://linkedin.com/in/md-abu-mahid-islam
|
|
174
125
|
|
|
175
|
-
|
|
126
|
+
## ⭐ Support
|
|
176
127
|
|
|
177
|
-
|
|
178
|
-
### ⭐ Star this project
|
|
128
|
+
If you find this project helpful, consider giving it a ⭐ on `GitHub`.
|
|
179
129
|
|
|
180
|
-
|
|
130
|
+
It helps the project grow and reach more developers.
|