"Database initialization",
"Set up cors congif these methods POST, GET and origin is '*' ",
"Create server port number as 4000",
"use express and express bodyparser",
"User helemt and rate limitter for security",
"import the router from this folder ./src/router/authRoutes.js with endpoint of /auth ",
"import Database module form ./config/db.js file as DB, ",
"Create error handelling middleware for routers",
"Measure all security features are implemented",
"Create a Api to manage recurring bookings. Export: exports.createRecurringBooking = async () => {...}",
"Validate required fields: Ensure startDate, endDate, frequency, and roomId are provided.",
"Use a scheduling library (e.g., node-cron) to generate recurring booking dates based on the frequency.",
"Check availability for each recurring date using the checkAvailability function.",
"Create bookings for each recurring date and link them to the same user or service.",
"Respond to user with a success message containing the booking details for each occurrence.",
"Handle errors like conflicting bookings, invalid parameters, or database issues.",
"Create a Api to manage recurring bookings. Export: exports.createRecurringBooking = async () => {...}",
"Validate required fields: Ensure startDate, endDate, frequency, and roomId are provided.",
"Use a scheduling library (e.g., node-cron) to generate recurring booking dates based on the frequency.",
"Check availability for each recurring date using the checkAvailability function.",
"Create bookings for each recurring date and link them to the same user or service.",
"Respond to user with a success message containing the booking details for each occurrence.",
"Handle errors like conflicting bookings, invalid parameters, or database issues.",
"Create a Api to add a user to the waitlist for a fully booked date. Export: exports.addToWaitlist = async () => {...}",
"Accept data from user body: userId, checkInDate, checkOutDate, hotelIds.",
"Validate required fields: Ensure userId, checkInDate, checkOutDate, and hotelIds are provided.",
"If the requested date is fully booked, add the user to the waitlist for that date.",
"Store waitlist data with date, hotelIds, userId, and priority level.",
"When a booking is canceled, notify users on the waitlist and offer the available slot.",
"Respond to user with a success message confirming the user has been added to the waitlist.",
],
User:
You have to create dependencies to instructions for gpt model to create application components by given dicriptions. ,Create instructions for a Node.js server. Specs : express, express-rate-limitter, helmet, connect db from this ../config/db.js file. handel all router error.,port will be 4000, make sure all security,import the router ./src/router/authRoutes.js with endpoint of /auth ,import the router ./src/router/todoRoutes.js with endpoint of /todo
task: 'edit-content'
fileName : 'server.js'
folderName :' '
baseName: 'testModels/hotelmgt'
{
"task": "edit-content",
"folderName": "",
"fileName": "server.js",
"baseName": "testModels/hotelmgt",
"prompt": {
"task_id": "task_id",
"task_name": "Create Node.js Server with Express and Middleware",
"description": "Generate a Node.js server setup using Express, express-rate-limiter, and helmet. Connect to database from ../config/db.js, ensure all routes handle errors, set server port to 4000, and implement necessary security measures.",
"input": {
"db": "connect via ../config/db.js",
"authentication": "use middleware for security"
},
"output": "Return the server setup code including middleware and routing setup.",
"dependencies": [
"Import necessary modules: express, express-rate-limiter, helmet",
"Set up Express server",
"Use express.json() for body parsing",
"Connect to the database using the configuration from ../config/db.js",
"Implement express-rate-limiter to limit repeated requests to public APIs",
"Use helmet to enhance your app's security",
"Import router from ./src/router/authRoutes.js and use it with the /auth endpoint",
"Import router from ./src/router/todoRoutes.js and use it with the /todo endpoint",
"Set server port to 4000",
"Create error-handling middleware for routers",
"Ensure all implemented security features are in place"
],
"status": "pending",
"isImport": false,
"readSupportFile": {
"read": false,
"folder": "",
"file": "",
"fileData": ""
}
}
}