backend-scaffold-cli 1.0.0 → 1.0.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.
- package/README.md +92 -0
- package/package.json +6 -2
package/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# backend-scaffold-cli
|
|
2
|
+
|
|
3
|
+
A CLI tool to quickly scaffold Express.js backend projects with MongoDB, middleware, and common setup. It automatically generates production-ready projects with JWT authentication, error handling, request logging, input validation, DNS configuration, and pre-configured MongoDB Atlas connection. Perfect for developers who want to skip boilerplate and start coding immediately.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
✨ **Quick Setup**
|
|
8
|
+
- Complete folder structure
|
|
9
|
+
- Pre-configured Express server
|
|
10
|
+
- MongoDB Atlas connection (cloud-based)
|
|
11
|
+
- Environment variables template
|
|
12
|
+
- DNS configuration
|
|
13
|
+
|
|
14
|
+
🔐 **Security**
|
|
15
|
+
- JWT authentication middleware
|
|
16
|
+
- Error handling middleware
|
|
17
|
+
- CORS configuration
|
|
18
|
+
|
|
19
|
+
📝 **Developer Experience**
|
|
20
|
+
- Logging middleware
|
|
21
|
+
- Input validation
|
|
22
|
+
- Sample routes
|
|
23
|
+
- Git initialization
|
|
24
|
+
- Auto dependency installation
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
### Using npx (Recommended)
|
|
29
|
+
```bash
|
|
30
|
+
npx backend-scaffold-cli my-app
|
|
31
|
+
cd my-app
|
|
32
|
+
npm start
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Global Installation
|
|
36
|
+
```bash
|
|
37
|
+
npm install -g backend-scaffold-cli
|
|
38
|
+
create-express-backend my-app
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx backend-scaffold-cli <project-name>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
You'll be prompted to select features:
|
|
48
|
+
- ✅ Include JWT authentication
|
|
49
|
+
- ✅ Include logging middleware
|
|
50
|
+
- ✅ Include input validation
|
|
51
|
+
- ✅ Install dependencies
|
|
52
|
+
|
|
53
|
+
## Project Structure
|
|
54
|
+
```
|
|
55
|
+
my-app/
|
|
56
|
+
├── src/
|
|
57
|
+
│ ├── server.js
|
|
58
|
+
│ ├── config/db.js
|
|
59
|
+
│ ├── middleware/
|
|
60
|
+
│ ├── routes/
|
|
61
|
+
│ ├── controllers/
|
|
62
|
+
│ ├── models/
|
|
63
|
+
│ └── utils/
|
|
64
|
+
├── .env.example
|
|
65
|
+
├── .gitignore
|
|
66
|
+
└── package.json
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Quick Start
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npx backend-scaffold-cli my-app
|
|
73
|
+
cd my-app
|
|
74
|
+
cp .env.example .env
|
|
75
|
+
npm start
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Visit: `http://localhost:5000/api/health`
|
|
79
|
+
|
|
80
|
+
## Environment Variables
|
|
81
|
+
|
|
82
|
+
```env
|
|
83
|
+
PORT=5000
|
|
84
|
+
NODE_ENV=development
|
|
85
|
+
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/dbname
|
|
86
|
+
JWT_SECRET=your-secret-key
|
|
87
|
+
DNS_SERVERS=8.8.8.8,8.8.4.4
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "backend-scaffold-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "CLI tool to scaffold Express.js backend projects with MongoDB, middleware, and common setup",
|
|
5
5
|
"main": "bin/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"mongodb"
|
|
19
19
|
],
|
|
20
20
|
"author": "abhi0605",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/abhi-0605/express-backend.git"
|
|
24
|
+
},
|
|
21
25
|
"license": "MIT",
|
|
22
26
|
"preferGlobal": true,
|
|
23
27
|
"engines": {
|
|
@@ -29,4 +33,4 @@
|
|
|
29
33
|
"fs-extra": "^11.1.0",
|
|
30
34
|
"inquirer": "^8.2.5"
|
|
31
35
|
}
|
|
32
|
-
}
|
|
36
|
+
}
|