ostroner 1.0.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.
Files changed (112) hide show
  1. package/bin/create-project.js +57 -0
  2. package/package.json +23 -0
  3. package/templates/stock-chain/backend/.env +9 -0
  4. package/templates/stock-chain/backend/.eslintrc.js +6 -0
  5. package/templates/stock-chain/backend/.prettierrc +14 -0
  6. package/templates/stock-chain/backend/README.md +1 -0
  7. package/templates/stock-chain/backend/package-lock.json +1666 -0
  8. package/templates/stock-chain/backend/package.json +21 -0
  9. package/templates/stock-chain/backend/src/app.js +59 -0
  10. package/templates/stock-chain/backend/src/config/db.js +29 -0
  11. package/templates/stock-chain/backend/src/controllers/auth.js +31 -0
  12. package/templates/stock-chain/backend/src/controllers/bookingcontroller.js +65 -0
  13. package/templates/stock-chain/backend/src/controllers/buscontroller.js +59 -0
  14. package/templates/stock-chain/backend/src/controllers/deliverycontroller.js +35 -0
  15. package/templates/stock-chain/backend/src/controllers/schedulecontroller.js +85 -0
  16. package/templates/stock-chain/backend/src/controllers/shipmentcontroller.js +35 -0
  17. package/templates/stock-chain/backend/src/controllers/suppliercontroller.js +35 -0
  18. package/templates/stock-chain/backend/src/controllers/usercontroller.js +59 -0
  19. package/templates/stock-chain/backend/src/middleware/auth.js +11 -0
  20. package/templates/stock-chain/backend/src/middleware/errorHandler.js +7 -0
  21. package/templates/stock-chain/backend/src/models/delivery.js +20 -0
  22. package/templates/stock-chain/backend/src/models/index.js +6 -0
  23. package/templates/stock-chain/backend/src/models/shipment.js +20 -0
  24. package/templates/stock-chain/backend/src/models/supplier.js +17 -0
  25. package/templates/stock-chain/backend/src/models/user.js +15 -0
  26. package/templates/stock-chain/backend/src/routes/authroute.js +11 -0
  27. package/templates/stock-chain/backend/src/routes/bookingroute.js +18 -0
  28. package/templates/stock-chain/backend/src/routes/busroute.js +18 -0
  29. package/templates/stock-chain/backend/src/routes/deliveriesroute.js +18 -0
  30. package/templates/stock-chain/backend/src/routes/scheduleroute.js +18 -0
  31. package/templates/stock-chain/backend/src/routes/shipmentsroute.js +18 -0
  32. package/templates/stock-chain/backend/src/routes/suppliersroute.js +18 -0
  33. package/templates/stock-chain/backend/src/routes/userroute.js +18 -0
  34. package/templates/stock-chain/frontend/.env +1 -0
  35. package/templates/stock-chain/frontend/README.md +16 -0
  36. package/templates/stock-chain/frontend/eslint.config.js +21 -0
  37. package/templates/stock-chain/frontend/index.html +13 -0
  38. package/templates/stock-chain/frontend/package-lock.json +3131 -0
  39. package/templates/stock-chain/frontend/package.json +33 -0
  40. package/templates/stock-chain/frontend/public/favicon.svg +1 -0
  41. package/templates/stock-chain/frontend/public/icons.svg +24 -0
  42. package/templates/stock-chain/frontend/src/App.jsx +55 -0
  43. package/templates/stock-chain/frontend/src/assets/hero.png +0 -0
  44. package/templates/stock-chain/frontend/src/assets/react.svg +1 -0
  45. package/templates/stock-chain/frontend/src/assets/vite.svg +1 -0
  46. package/templates/stock-chain/frontend/src/components/Button.jsx +15 -0
  47. package/templates/stock-chain/frontend/src/components/Input.jsx +25 -0
  48. package/templates/stock-chain/frontend/src/context/AuthContext.jsx +59 -0
  49. package/templates/stock-chain/frontend/src/index.css +7 -0
  50. package/templates/stock-chain/frontend/src/main.jsx +18 -0
  51. package/templates/stock-chain/frontend/src/pages/AppLayout.jsx +125 -0
  52. package/templates/stock-chain/frontend/src/pages/Login.jsx +78 -0
  53. package/templates/stock-chain/frontend/src/pages/ManagerDeliveries.jsx +113 -0
  54. package/templates/stock-chain/frontend/src/pages/ManagerShipments.jsx +113 -0
  55. package/templates/stock-chain/frontend/src/pages/ManagerSuppliers.jsx +122 -0
  56. package/templates/stock-chain/frontend/src/pages/Register.jsx +60 -0
  57. package/templates/stock-chain/frontend/src/services/api.js +8 -0
  58. package/templates/stock-chain/frontend/src/services/authService.js +11 -0
  59. package/templates/stock-chain/frontend/vite.config.js +8 -0
  60. package/templates/y-bus/backend/.env +9 -0
  61. package/templates/y-bus/backend/.eslintrc.js +6 -0
  62. package/templates/y-bus/backend/.prettierrc +14 -0
  63. package/templates/y-bus/backend/README.md +1 -0
  64. package/templates/y-bus/backend/package-lock.json +1666 -0
  65. package/templates/y-bus/backend/package.json +21 -0
  66. package/templates/y-bus/backend/src/app.js +44 -0
  67. package/templates/y-bus/backend/src/config/db.js +29 -0
  68. package/templates/y-bus/backend/src/controllers/auth.js +23 -0
  69. package/templates/y-bus/backend/src/controllers/bookingcontroller.js +65 -0
  70. package/templates/y-bus/backend/src/controllers/buscontroller.js +59 -0
  71. package/templates/y-bus/backend/src/controllers/schedulecontroller.js +85 -0
  72. package/templates/y-bus/backend/src/controllers/usercontroller.js +59 -0
  73. package/templates/y-bus/backend/src/middleware/auth.js +11 -0
  74. package/templates/y-bus/backend/src/middleware/errorHandler.js +7 -0
  75. package/templates/y-bus/backend/src/models/booking.js +27 -0
  76. package/templates/y-bus/backend/src/models/bus.js +16 -0
  77. package/templates/y-bus/backend/src/models/index.js +15 -0
  78. package/templates/y-bus/backend/src/models/schedule.js +25 -0
  79. package/templates/y-bus/backend/src/models/user.js +20 -0
  80. package/templates/y-bus/backend/src/routes/bookingroute.js +18 -0
  81. package/templates/y-bus/backend/src/routes/busroute.js +18 -0
  82. package/templates/y-bus/backend/src/routes/scheduleroute.js +18 -0
  83. package/templates/y-bus/backend/src/routes/userroute.js +18 -0
  84. package/templates/y-bus/frontend/.env +1 -0
  85. package/templates/y-bus/frontend/README.md +16 -0
  86. package/templates/y-bus/frontend/eslint.config.js +21 -0
  87. package/templates/y-bus/frontend/index.html +13 -0
  88. package/templates/y-bus/frontend/package-lock.json +3131 -0
  89. package/templates/y-bus/frontend/package.json +33 -0
  90. package/templates/y-bus/frontend/public/favicon.svg +1 -0
  91. package/templates/y-bus/frontend/public/icons.svg +24 -0
  92. package/templates/y-bus/frontend/src/App.jsx +108 -0
  93. package/templates/y-bus/frontend/src/assets/hero.png +0 -0
  94. package/templates/y-bus/frontend/src/assets/react.svg +1 -0
  95. package/templates/y-bus/frontend/src/assets/vite.svg +1 -0
  96. package/templates/y-bus/frontend/src/components/Button.jsx +15 -0
  97. package/templates/y-bus/frontend/src/components/Input.jsx +25 -0
  98. package/templates/y-bus/frontend/src/context/AuthContext.jsx +59 -0
  99. package/templates/y-bus/frontend/src/index.css +7 -0
  100. package/templates/y-bus/frontend/src/main.jsx +18 -0
  101. package/templates/y-bus/frontend/src/pages/AppLayout.jsx +135 -0
  102. package/templates/y-bus/frontend/src/pages/CustomerTrips.jsx +101 -0
  103. package/templates/y-bus/frontend/src/pages/Login.jsx +81 -0
  104. package/templates/y-bus/frontend/src/pages/ManagerBuses.jsx +140 -0
  105. package/templates/y-bus/frontend/src/pages/ManagerDashboard.jsx +108 -0
  106. package/templates/y-bus/frontend/src/pages/ManagerReport.jsx +89 -0
  107. package/templates/y-bus/frontend/src/pages/ManagerSchedules.jsx +233 -0
  108. package/templates/y-bus/frontend/src/pages/MyBookings.jsx +78 -0
  109. package/templates/y-bus/frontend/src/pages/Register.jsx +67 -0
  110. package/templates/y-bus/frontend/src/services/api.js +8 -0
  111. package/templates/y-bus/frontend/src/services/authService.js +33 -0
  112. package/templates/y-bus/frontend/vite.config.js +8 -0
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env node
2
+
3
+ const inquirer = require("inquirer");
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+
7
+ const projects = {
8
+ "Stock Chain System": "stock-chain",
9
+ "Y Bus Booking System": "y-bus"
10
+ };
11
+
12
+ (async () => {
13
+ try {
14
+ const { project } = await inquirer.prompt([
15
+ {
16
+ type: "list",
17
+ name: "project",
18
+ message: "Select a project:",
19
+ choices: Object.keys(projects)
20
+ }
21
+ ]);
22
+
23
+ const { projectName } = await inquirer.prompt([
24
+ {
25
+ type: "input",
26
+ name: "projectName",
27
+ message: "Project name:"
28
+ }
29
+ ]);
30
+
31
+ const templateFolder = projects[project];
32
+
33
+ const source = path.join(
34
+ __dirname,
35
+ "..",
36
+ "templates",
37
+ templateFolder
38
+ );
39
+
40
+ const destination = path.join(
41
+ process.cwd(),
42
+ projectName
43
+ );
44
+
45
+ console.log("\nCreating project...\n");
46
+
47
+ fs.cpSync(source, destination, {
48
+ recursive: true
49
+ });
50
+
51
+ console.log("Project created successfully.");
52
+ console.log("\nNext steps:");
53
+ console.log(`cd ${projectName}`);
54
+ } catch (err) {
55
+ console.error("Error creating project:", err);
56
+ }
57
+ })();
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "ostroner",
3
+ "version": "1.0.0",
4
+ "description": "Cloud project generator",
5
+ "bin": {
6
+ "cloud": "./bin/create-project.js"
7
+ },
8
+ "files": [
9
+ "bin",
10
+ "templates"
11
+ ],
12
+ "keywords": [
13
+ "ostroner",
14
+ "generator",
15
+ "nodejs"
16
+ ],
17
+ "author": "aslan iriho",
18
+ "license": "ISC",
19
+ "type": "commonjs",
20
+ "dependencies": {
21
+ "inquirer": "^12.9.6"
22
+ }
23
+ }
@@ -0,0 +1,9 @@
1
+ PORT=5000
2
+ NODE_ENV=development
3
+ DB_HOST=localhost
4
+ DB_PORT=3306
5
+ DB_USER=root
6
+ DB_PASSWORD=
7
+ DB_NAME=bus02
8
+ SESSION_SECRET=change_this_to_a_long_random_secret
9
+ CLIENT_URL=http://localhost:5173
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ env: { node: true, es6: true },
3
+ extends: 'eslint:recommended',
4
+ parserOptions: { ecmaVersion: 12, sourceType: 'module' },
5
+ rules: { semi: ['error', 'always'], quotes: ['error', 'single'] },
6
+ };
@@ -0,0 +1,14 @@
1
+ {
2
+ "semi": true,
3
+ "singleQuote": true,
4
+ "trailingComma": "es5",
5
+ "printWidth": 100,
6
+ "tabWidth": 2,
7
+ "useTabs": false,
8
+ "arrowParens": "always",
9
+ "bracketSpacing": true,
10
+ "endOfLine": "lf",
11
+ "jsxSingleQuote": false,
12
+ "quoteProps": "as-needed",
13
+ "proseWrap": "preserve"
14
+ }
@@ -0,0 +1 @@
1
+ # Backend Project