create-fullstack-boilerplate 2.1.10 → 2.2.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.
- package/README.md +6 -6
- package/index.js +1 -141
- package/lib/addDB.js +0 -2
- package/lib/addRoute.js +4 -6
- package/lib/copyProject.js +0 -1
- package/lib/prompts.js +10 -10
- package/lib/setupExtraDB.js +87 -89
- package/lib/testDBConnection.js +1 -35
- package/lib/utils.js +1 -130
- package/package.json +86 -46
- package/template/Frontend/package-lock.json +421 -63
- package/template/Frontend/package.json +2 -1
- package/template/Frontend/src/App.jsx +2 -0
- package/template/Frontend/src/config/routes.js +9 -1
- package/template/Frontend/src/pages/Architecture.jsx +137 -0
- package/template/Frontend/src/pages/Dashboard.jsx +503 -116
- package/lib/assertDependency.js +0 -14
- package/lib/ensureDir.js +0 -7
- package/lib/installDeps.js +0 -11
- package/lib/runInstall.js +0 -10
package/lib/utils.js
CHANGED
|
@@ -1,132 +1,3 @@
|
|
|
1
|
-
// const fs = require("fs-extra");
|
|
2
|
-
// const path = require("path");
|
|
3
|
-
// const execa = require("execa");
|
|
4
|
-
|
|
5
|
-
// // ------------------ Logging ------------------
|
|
6
|
-
// function log(step) {
|
|
7
|
-
// console.log(`\n➡️ ${step}`);
|
|
8
|
-
// }
|
|
9
|
-
|
|
10
|
-
// // ------------------ Replace in Files ------------------
|
|
11
|
-
// async function replaceInFiles(base, replacements) {
|
|
12
|
-
// const exts = [".js", ".ts", ".json", ".md", ".env", ".yml"];
|
|
13
|
-
|
|
14
|
-
// async function walk(dir) {
|
|
15
|
-
// // Check if directory exists
|
|
16
|
-
// if (!await fs.pathExists(dir)) {
|
|
17
|
-
// console.warn(`Warning: Directory ${dir} does not exist, skipping...`);
|
|
18
|
-
// return;
|
|
19
|
-
// }
|
|
20
|
-
|
|
21
|
-
// let items;
|
|
22
|
-
// try {
|
|
23
|
-
// items = await fs.readdir(dir);
|
|
24
|
-
// } catch (err) {
|
|
25
|
-
// console.warn(`Warning: Could not read directory ${dir}: ${err.message}`);
|
|
26
|
-
// return;
|
|
27
|
-
// }
|
|
28
|
-
|
|
29
|
-
// for (const item of items) {
|
|
30
|
-
// const fullPath = path.join(dir, item);
|
|
31
|
-
// try {
|
|
32
|
-
// const stat = await fs.stat(fullPath);
|
|
33
|
-
// if (stat.isDirectory()) {
|
|
34
|
-
// await walk(fullPath);
|
|
35
|
-
// } else if (exts.includes(path.extname(fullPath))) {
|
|
36
|
-
// let data = await fs.readFile(fullPath, "utf8");
|
|
37
|
-
// for (const [k, v] of Object.entries(replacements)) {
|
|
38
|
-
// data = data.replaceAll(k, v);
|
|
39
|
-
// }
|
|
40
|
-
// await fs.writeFile(fullPath, data);
|
|
41
|
-
// }
|
|
42
|
-
// } catch (err) {
|
|
43
|
-
// console.warn(`Warning: Error processing ${fullPath}: ${err.message}`);
|
|
44
|
-
// }
|
|
45
|
-
// }
|
|
46
|
-
// }
|
|
47
|
-
|
|
48
|
-
// await walk(base);
|
|
49
|
-
// }
|
|
50
|
-
|
|
51
|
-
// // ------------------ Ensure Directory ------------------
|
|
52
|
-
// async function ensureDir(dir) {
|
|
53
|
-
// await fs.ensureDir(dir);
|
|
54
|
-
// }
|
|
55
|
-
|
|
56
|
-
// // ------------------ Assert Dependency ------------------
|
|
57
|
-
// function assertDependency(depName, cwd) {
|
|
58
|
-
// try {
|
|
59
|
-
// return require(path.join(cwd, "node_modules", depName));
|
|
60
|
-
// } catch (err) {
|
|
61
|
-
// throw new Error(
|
|
62
|
-
// `Dependency '${depName}' is not installed in ${cwd}.\n` +
|
|
63
|
-
// `Run: cd ${cwd} && npm install ${depName}`
|
|
64
|
-
// );
|
|
65
|
-
// }
|
|
66
|
-
// }
|
|
67
|
-
|
|
68
|
-
// // ------------------ Run npm install ------------------
|
|
69
|
-
// async function runInstall(cwd) {
|
|
70
|
-
// // Normalize path for Windows
|
|
71
|
-
// const normalizedCwd = path.normalize(cwd);
|
|
72
|
-
|
|
73
|
-
// // Verify directory exists
|
|
74
|
-
// if (!await fs.pathExists(normalizedCwd)) {
|
|
75
|
-
// throw new Error(`Directory does not exist: ${normalizedCwd}`);
|
|
76
|
-
// }
|
|
77
|
-
|
|
78
|
-
// try {
|
|
79
|
-
// await execa("npm", ["install"], {
|
|
80
|
-
// cwd: normalizedCwd,
|
|
81
|
-
// stdio: "inherit",
|
|
82
|
-
// shell: true // Use shell for Windows compatibility
|
|
83
|
-
// });
|
|
84
|
-
// } catch (err) {
|
|
85
|
-
// throw new Error(`npm install failed in ${normalizedCwd}: ${err.message}`);
|
|
86
|
-
// }
|
|
87
|
-
// }
|
|
88
|
-
|
|
89
|
-
// // ------------------ Installing Dynamic DB Drivers ----------------
|
|
90
|
-
|
|
91
|
-
// async function installDBDriver(targetDir, dialect) {
|
|
92
|
-
// let pkg;
|
|
93
|
-
// if (dialect === "mariadb") pkg = "mariadb";
|
|
94
|
-
// if (dialect === "mysql") pkg = "mysql2";
|
|
95
|
-
// if (dialect === "postgres") pkg = "pg";
|
|
96
|
-
// if (!pkg) return;
|
|
97
|
-
|
|
98
|
-
// // Normalize path for Windows
|
|
99
|
-
// const normalizedDir = path.normalize(targetDir);
|
|
100
|
-
|
|
101
|
-
// console.log(`➡️ Installing ${pkg}...`);
|
|
102
|
-
// try {
|
|
103
|
-
// await execa("npm", ["install", pkg], {
|
|
104
|
-
// cwd: normalizedDir,
|
|
105
|
-
// stdio: "inherit",
|
|
106
|
-
// shell: true // Use shell for Windows compatibility
|
|
107
|
-
// });
|
|
108
|
-
// } catch (err) {
|
|
109
|
-
// console.warn(`Warning: Failed to install ${pkg}: ${err.message}`);
|
|
110
|
-
// }
|
|
111
|
-
// }
|
|
112
|
-
|
|
113
|
-
// // Add this function to utils.js
|
|
114
|
-
// function normalizePath(p) {
|
|
115
|
-
// return path.normalize(p).replace(/\\/g, '/');
|
|
116
|
-
// }
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
// module.exports = {
|
|
120
|
-
// log,
|
|
121
|
-
// replaceInFiles,
|
|
122
|
-
// ensureDir,
|
|
123
|
-
// assertDependency,
|
|
124
|
-
// runInstall,
|
|
125
|
-
// installDBDriver,
|
|
126
|
-
// normalizePath
|
|
127
|
-
// };
|
|
128
|
-
|
|
129
|
-
|
|
130
1
|
const fs = require("fs-extra");
|
|
131
2
|
const path = require("path");
|
|
132
3
|
const execa = require("execa");
|
|
@@ -250,5 +121,5 @@ module.exports = {
|
|
|
250
121
|
assertDependency,
|
|
251
122
|
runInstall,
|
|
252
123
|
installDBDriver,
|
|
253
|
-
normalizePath
|
|
124
|
+
normalizePath
|
|
254
125
|
};
|
package/package.json
CHANGED
|
@@ -1,46 +1,86 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "create-fullstack-boilerplate",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "A
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
],
|
|
18
|
-
"scripts": {
|
|
19
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
20
|
-
},
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"fullstack",
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "create-fullstack-boilerplate",
|
|
3
|
+
"version": "2.2.0",
|
|
4
|
+
"description": "A powerful CLI tool to generate fully configured full-stack applications with React frontend and Express backend. Includes authentication middleware, database configuration, protected routes, route-based Axios instances, and encryption setup - all ready with a single command.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"create-fullstack-boilerplate": "index.js"
|
|
9
|
+
},
|
|
10
|
+
"preferGlobal": false,
|
|
11
|
+
"files": [
|
|
12
|
+
"index.js",
|
|
13
|
+
"lib/",
|
|
14
|
+
"template/",
|
|
15
|
+
"README.md",
|
|
16
|
+
"LICENSE"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"fullstack",
|
|
23
|
+
"boilerplate",
|
|
24
|
+
"react",
|
|
25
|
+
"express",
|
|
26
|
+
"nodejs",
|
|
27
|
+
"sequelize",
|
|
28
|
+
"authentication",
|
|
29
|
+
"cli-tool",
|
|
30
|
+
"project-generator",
|
|
31
|
+
"fullstack-template",
|
|
32
|
+
"react-boilerplate",
|
|
33
|
+
"express-boilerplate",
|
|
34
|
+
"auth-middleware",
|
|
35
|
+
"protected-routes",
|
|
36
|
+
"database-setup",
|
|
37
|
+
"axios-instance",
|
|
38
|
+
"encryption",
|
|
39
|
+
"backend-template",
|
|
40
|
+
"frontend-template",
|
|
41
|
+
"fullstack-app",
|
|
42
|
+
"react-express",
|
|
43
|
+
"node-boilerplate",
|
|
44
|
+
"jwt-auth",
|
|
45
|
+
"sequelize-setup",
|
|
46
|
+
"route-protection",
|
|
47
|
+
"muhammad-huzaifa",
|
|
48
|
+
"huzaifi0604",
|
|
49
|
+
"mhuzaifi0604",
|
|
50
|
+
"huzaifa",
|
|
51
|
+
"starter-template",
|
|
52
|
+
"project-scaffolding",
|
|
53
|
+
"developer-tools",
|
|
54
|
+
"fullstack-starter",
|
|
55
|
+
"create-fullstack-boilerplate",
|
|
56
|
+
"create-fullstack-app",
|
|
57
|
+
"create-fullstack-project"
|
|
58
|
+
],
|
|
59
|
+
"author": {
|
|
60
|
+
"name": "Muhammad Huzaifa",
|
|
61
|
+
"email": "huzzaifaasim@gmail.com",
|
|
62
|
+
"url": "https://github.com/mhuzaifi0604"
|
|
63
|
+
},
|
|
64
|
+
"license": "MIT",
|
|
65
|
+
"repository": {
|
|
66
|
+
"type": "git",
|
|
67
|
+
"url": "git+https://github.com/mhuzaifi0604/Full-Stack-Boilerplate.git"
|
|
68
|
+
},
|
|
69
|
+
"bugs": {
|
|
70
|
+
"url": "https://github.com/mhuzaifi0604/Full-Stack-Boilerplate/issues"
|
|
71
|
+
},
|
|
72
|
+
"homepage": "https://github.com/mhuzaifi0604/Full-Stack-Boilerplate#readme",
|
|
73
|
+
"dependencies": {
|
|
74
|
+
"cpy": "^12.1.0",
|
|
75
|
+
"execa": "^5.1.1",
|
|
76
|
+
"fs-extra": "^11.3.2",
|
|
77
|
+
"inquirer": "^8.2.7"
|
|
78
|
+
},
|
|
79
|
+
"engines": {
|
|
80
|
+
"node": ">=14.0.0"
|
|
81
|
+
},
|
|
82
|
+
"publishConfig": {
|
|
83
|
+
"access": "public",
|
|
84
|
+
"registry": "https://registry.npmjs.org/"
|
|
85
|
+
}
|
|
86
|
+
}
|