express-project-builder 1.0.37 → 1.0.38
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 +16 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -137,6 +137,7 @@ my-test-project/
|
|
|
137
137
|
├── eslint.config.mjs
|
|
138
138
|
├── package-lock.json
|
|
139
139
|
├── package.json
|
|
140
|
+
├── prisma.config.ts
|
|
140
141
|
└── tsconfig.json
|
|
141
142
|
```
|
|
142
143
|
|
|
@@ -152,11 +153,13 @@ my-test-project/
|
|
|
152
153
|
- [eslint-plugin-prettier (5.5.4)](https://www.npmjs.com/package/eslint-plugin-prettier)
|
|
153
154
|
- [express (5.1.0)](https://www.npmjs.com/package/express)
|
|
154
155
|
- [jsonwebtoken (9.0.2)](https://www.npmjs.com/package/jsonwebtoken)
|
|
155
|
-
- [mongoose (
|
|
156
|
+
- [mongoose (9.1.5)](https://www.npmjs.com/package/mongoose)
|
|
156
157
|
- [multer (2.0.2-lts.1)](https://www.npmjs.com/package/multer)
|
|
157
158
|
- [node-cache (5.1.2)](https://www.npmjs.com/package/node-cache)
|
|
158
159
|
- [nodemailer (7.0.6)](https://www.npmjs.com/package/nodemailer)
|
|
159
|
-
- [@prisma/client (
|
|
160
|
+
- [@prisma/client (7.3.0)](https://www.npmjs.com/package/@prisma/client)
|
|
161
|
+
- [@prisma/adapter-pg (7.3.0)](https://www.npmjs.com/package/@prisma/adapter-ppg)
|
|
162
|
+
- [pg (8.18.0)](https://www.npmjs.com/package/pg)
|
|
160
163
|
- [zod (3.24.1)](https://www.npmjs.com/package/zod)
|
|
161
164
|
|
|
162
165
|
### Development Dependencies
|
|
@@ -173,7 +176,7 @@ my-test-project/
|
|
|
173
176
|
- [eslint (9.35.0)](https://www.npmjs.com/package/eslint)
|
|
174
177
|
- [eslint-config-prettier (10.1.8)](https://www.npmjs.com/package/eslint-config-prettier)
|
|
175
178
|
- [globals (16.4.0)](https://www.npmjs.com/package/globals)
|
|
176
|
-
- [prisma (
|
|
179
|
+
- [prisma (7.3.0)](https://www.npmjs.com/package/prisma)
|
|
177
180
|
- [prettier (3.6.2)](https://www.npmjs.com/package/prettier)
|
|
178
181
|
- [ts-node-dev (2.0.0)](https://www.npmjs.com/package/ts-node-dev)
|
|
179
182
|
- [typescript (5.9.2)](https://www.npmjs.com/package/typescript)
|
|
@@ -301,14 +304,14 @@ import auth from "../../middlewares/auth";
|
|
|
301
304
|
router.get(
|
|
302
305
|
"/users",
|
|
303
306
|
auth("user", "admin", "superAdmin", "developer"), // Only users with these roles can access
|
|
304
|
-
UsersControllers.getAllUsers
|
|
307
|
+
UsersControllers.getAllUsers,
|
|
305
308
|
);
|
|
306
309
|
|
|
307
310
|
// Protect a route without role checking (just verify token)
|
|
308
311
|
router.get(
|
|
309
312
|
"/profile",
|
|
310
313
|
auth("user", "admin", "superAdmin", "developer", true), // Any authenticated user can access
|
|
311
|
-
UsersController.getUserProfile
|
|
314
|
+
UsersController.getUserProfile,
|
|
312
315
|
);
|
|
313
316
|
```
|
|
314
317
|
|
|
@@ -380,7 +383,7 @@ router.post(
|
|
|
380
383
|
},
|
|
381
384
|
]),
|
|
382
385
|
formDataToSetJSONformatData, // Convert form data to JSON
|
|
383
|
-
ProductController.createProduct
|
|
386
|
+
ProductController.createProduct,
|
|
384
387
|
);
|
|
385
388
|
```
|
|
386
389
|
|
|
@@ -428,7 +431,7 @@ import { ProductValidation } from "../../app/models/product_validationZodSchema"
|
|
|
428
431
|
router.post(
|
|
429
432
|
"/create",
|
|
430
433
|
validateRequest(ProductValidation.createProduct_ValidationZodSchema),
|
|
431
|
-
ProductControllers.createProduct
|
|
434
|
+
ProductControllers.createProduct,
|
|
432
435
|
);
|
|
433
436
|
|
|
434
437
|
// /src/app/models/product_validationZodSchema.ts
|
|
@@ -508,7 +511,7 @@ const get_All_Products = catchAsync(async (req, res) => {
|
|
|
508
511
|
// Your async controller logic here
|
|
509
512
|
const result = await Product_Services.get_All_Products_FromDB(
|
|
510
513
|
req.body,
|
|
511
|
-
req.query
|
|
514
|
+
req.query,
|
|
512
515
|
);
|
|
513
516
|
|
|
514
517
|
res.status(200).json({
|
|
@@ -579,7 +582,7 @@ const barcodeId = generateRandomBarcodeId(); // Returns: "153.04.55.022"
|
|
|
579
582
|
const token = createToken(
|
|
580
583
|
{ user_id: "123", role: "admin" },
|
|
581
584
|
config.jwt_access_token_secret,
|
|
582
|
-
config.jwt_access_token_expires_in
|
|
585
|
+
config.jwt_access_token_expires_in,
|
|
583
586
|
); // Returns JWT token
|
|
584
587
|
|
|
585
588
|
// JWT Token Verify and Decode
|
|
@@ -606,7 +609,7 @@ const isInvalid = isValidDate(payload.date); // Returns: false
|
|
|
606
609
|
// Validate and normalize start and end dates
|
|
607
610
|
const { start, end } = Start_End_DateTime_Validation(
|
|
608
611
|
payload.start_date,
|
|
609
|
-
payload.end_date
|
|
612
|
+
payload.end_date,
|
|
610
613
|
);
|
|
611
614
|
// Returns: { start: Date, end: Date } with proper date objects
|
|
612
615
|
|
|
@@ -621,7 +624,7 @@ const isoDate = formatDateToISOString(new Date());
|
|
|
621
624
|
const daysDiff = getDateDifference(
|
|
622
625
|
payload.start_date,
|
|
623
626
|
payload.end_date,
|
|
624
|
-
"days"
|
|
627
|
+
"days",
|
|
625
628
|
); // Returns: 9
|
|
626
629
|
```
|
|
627
630
|
|
|
@@ -729,7 +732,7 @@ import sendResponse from "../../utils/sendResponse";
|
|
|
729
732
|
const get_AllProducts = catchAsync(async (req, res) => {
|
|
730
733
|
const result = await Product_Services.fetch_AllProductsFromDB(
|
|
731
734
|
req.params.user_id,
|
|
732
|
-
req.query
|
|
735
|
+
req.query,
|
|
733
736
|
);
|
|
734
737
|
|
|
735
738
|
res.status(200).json({
|
|
@@ -744,7 +747,7 @@ const get_AllProducts = catchAsync(async (req, res) => {
|
|
|
744
747
|
const get_AllProducts = catchAsync(async (req, res) => {
|
|
745
748
|
const result = await Product_Services.fetch_AllProductsFromDB(
|
|
746
749
|
req.params.user_id,
|
|
747
|
-
req.query
|
|
750
|
+
req.query,
|
|
748
751
|
);
|
|
749
752
|
|
|
750
753
|
sendResponse(res, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "express-project-builder",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.38",
|
|
4
4
|
"description": "A powerful and professional Express.js project generator CLI that instantly scaffolds a production-ready backend with TypeScript, modular architecture, and built-in support for MongoDB (Mongoose) or PostgreSQL (Prisma). Includes authentication, error handling, rate limiting, file upload, caching, and utility functions—so you can focus on building features instead of boilerplate. Perfect for kickstarting your next Express.js API project with best practices and modern tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/bin/index.js",
|