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.
- package/bin/create-project.js +57 -0
- package/package.json +23 -0
- package/templates/stock-chain/backend/.env +9 -0
- package/templates/stock-chain/backend/.eslintrc.js +6 -0
- package/templates/stock-chain/backend/.prettierrc +14 -0
- package/templates/stock-chain/backend/README.md +1 -0
- package/templates/stock-chain/backend/package-lock.json +1666 -0
- package/templates/stock-chain/backend/package.json +21 -0
- package/templates/stock-chain/backend/src/app.js +59 -0
- package/templates/stock-chain/backend/src/config/db.js +29 -0
- package/templates/stock-chain/backend/src/controllers/auth.js +31 -0
- package/templates/stock-chain/backend/src/controllers/bookingcontroller.js +65 -0
- package/templates/stock-chain/backend/src/controllers/buscontroller.js +59 -0
- package/templates/stock-chain/backend/src/controllers/deliverycontroller.js +35 -0
- package/templates/stock-chain/backend/src/controllers/schedulecontroller.js +85 -0
- package/templates/stock-chain/backend/src/controllers/shipmentcontroller.js +35 -0
- package/templates/stock-chain/backend/src/controllers/suppliercontroller.js +35 -0
- package/templates/stock-chain/backend/src/controllers/usercontroller.js +59 -0
- package/templates/stock-chain/backend/src/middleware/auth.js +11 -0
- package/templates/stock-chain/backend/src/middleware/errorHandler.js +7 -0
- package/templates/stock-chain/backend/src/models/delivery.js +20 -0
- package/templates/stock-chain/backend/src/models/index.js +6 -0
- package/templates/stock-chain/backend/src/models/shipment.js +20 -0
- package/templates/stock-chain/backend/src/models/supplier.js +17 -0
- package/templates/stock-chain/backend/src/models/user.js +15 -0
- package/templates/stock-chain/backend/src/routes/authroute.js +11 -0
- package/templates/stock-chain/backend/src/routes/bookingroute.js +18 -0
- package/templates/stock-chain/backend/src/routes/busroute.js +18 -0
- package/templates/stock-chain/backend/src/routes/deliveriesroute.js +18 -0
- package/templates/stock-chain/backend/src/routes/scheduleroute.js +18 -0
- package/templates/stock-chain/backend/src/routes/shipmentsroute.js +18 -0
- package/templates/stock-chain/backend/src/routes/suppliersroute.js +18 -0
- package/templates/stock-chain/backend/src/routes/userroute.js +18 -0
- package/templates/stock-chain/frontend/.env +1 -0
- package/templates/stock-chain/frontend/README.md +16 -0
- package/templates/stock-chain/frontend/eslint.config.js +21 -0
- package/templates/stock-chain/frontend/index.html +13 -0
- package/templates/stock-chain/frontend/package-lock.json +3131 -0
- package/templates/stock-chain/frontend/package.json +33 -0
- package/templates/stock-chain/frontend/public/favicon.svg +1 -0
- package/templates/stock-chain/frontend/public/icons.svg +24 -0
- package/templates/stock-chain/frontend/src/App.jsx +55 -0
- package/templates/stock-chain/frontend/src/assets/hero.png +0 -0
- package/templates/stock-chain/frontend/src/assets/react.svg +1 -0
- package/templates/stock-chain/frontend/src/assets/vite.svg +1 -0
- package/templates/stock-chain/frontend/src/components/Button.jsx +15 -0
- package/templates/stock-chain/frontend/src/components/Input.jsx +25 -0
- package/templates/stock-chain/frontend/src/context/AuthContext.jsx +59 -0
- package/templates/stock-chain/frontend/src/index.css +7 -0
- package/templates/stock-chain/frontend/src/main.jsx +18 -0
- package/templates/stock-chain/frontend/src/pages/AppLayout.jsx +125 -0
- package/templates/stock-chain/frontend/src/pages/Login.jsx +78 -0
- package/templates/stock-chain/frontend/src/pages/ManagerDeliveries.jsx +113 -0
- package/templates/stock-chain/frontend/src/pages/ManagerShipments.jsx +113 -0
- package/templates/stock-chain/frontend/src/pages/ManagerSuppliers.jsx +122 -0
- package/templates/stock-chain/frontend/src/pages/Register.jsx +60 -0
- package/templates/stock-chain/frontend/src/services/api.js +8 -0
- package/templates/stock-chain/frontend/src/services/authService.js +11 -0
- package/templates/stock-chain/frontend/vite.config.js +8 -0
- package/templates/y-bus/backend/.env +9 -0
- package/templates/y-bus/backend/.eslintrc.js +6 -0
- package/templates/y-bus/backend/.prettierrc +14 -0
- package/templates/y-bus/backend/README.md +1 -0
- package/templates/y-bus/backend/package-lock.json +1666 -0
- package/templates/y-bus/backend/package.json +21 -0
- package/templates/y-bus/backend/src/app.js +44 -0
- package/templates/y-bus/backend/src/config/db.js +29 -0
- package/templates/y-bus/backend/src/controllers/auth.js +23 -0
- package/templates/y-bus/backend/src/controllers/bookingcontroller.js +65 -0
- package/templates/y-bus/backend/src/controllers/buscontroller.js +59 -0
- package/templates/y-bus/backend/src/controllers/schedulecontroller.js +85 -0
- package/templates/y-bus/backend/src/controllers/usercontroller.js +59 -0
- package/templates/y-bus/backend/src/middleware/auth.js +11 -0
- package/templates/y-bus/backend/src/middleware/errorHandler.js +7 -0
- package/templates/y-bus/backend/src/models/booking.js +27 -0
- package/templates/y-bus/backend/src/models/bus.js +16 -0
- package/templates/y-bus/backend/src/models/index.js +15 -0
- package/templates/y-bus/backend/src/models/schedule.js +25 -0
- package/templates/y-bus/backend/src/models/user.js +20 -0
- package/templates/y-bus/backend/src/routes/bookingroute.js +18 -0
- package/templates/y-bus/backend/src/routes/busroute.js +18 -0
- package/templates/y-bus/backend/src/routes/scheduleroute.js +18 -0
- package/templates/y-bus/backend/src/routes/userroute.js +18 -0
- package/templates/y-bus/frontend/.env +1 -0
- package/templates/y-bus/frontend/README.md +16 -0
- package/templates/y-bus/frontend/eslint.config.js +21 -0
- package/templates/y-bus/frontend/index.html +13 -0
- package/templates/y-bus/frontend/package-lock.json +3131 -0
- package/templates/y-bus/frontend/package.json +33 -0
- package/templates/y-bus/frontend/public/favicon.svg +1 -0
- package/templates/y-bus/frontend/public/icons.svg +24 -0
- package/templates/y-bus/frontend/src/App.jsx +108 -0
- package/templates/y-bus/frontend/src/assets/hero.png +0 -0
- package/templates/y-bus/frontend/src/assets/react.svg +1 -0
- package/templates/y-bus/frontend/src/assets/vite.svg +1 -0
- package/templates/y-bus/frontend/src/components/Button.jsx +15 -0
- package/templates/y-bus/frontend/src/components/Input.jsx +25 -0
- package/templates/y-bus/frontend/src/context/AuthContext.jsx +59 -0
- package/templates/y-bus/frontend/src/index.css +7 -0
- package/templates/y-bus/frontend/src/main.jsx +18 -0
- package/templates/y-bus/frontend/src/pages/AppLayout.jsx +135 -0
- package/templates/y-bus/frontend/src/pages/CustomerTrips.jsx +101 -0
- package/templates/y-bus/frontend/src/pages/Login.jsx +81 -0
- package/templates/y-bus/frontend/src/pages/ManagerBuses.jsx +140 -0
- package/templates/y-bus/frontend/src/pages/ManagerDashboard.jsx +108 -0
- package/templates/y-bus/frontend/src/pages/ManagerReport.jsx +89 -0
- package/templates/y-bus/frontend/src/pages/ManagerSchedules.jsx +233 -0
- package/templates/y-bus/frontend/src/pages/MyBookings.jsx +78 -0
- package/templates/y-bus/frontend/src/pages/Register.jsx +67 -0
- package/templates/y-bus/frontend/src/services/api.js +8 -0
- package/templates/y-bus/frontend/src/services/authService.js +33 -0
- 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,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
|