SP25 BSCS Final Lab Exam
Lab Final Exam Question
Your task is to extend your existing E-Commerce term project by implementing a complete CRUD module for “Vehicles”.
Requirements:
- Create a Mongoose model for
Vehiclewith at least the following fields:name(String)brand(String)price(Number)type(String, e.g., sedan, SUV, truck)image(String – image file upload)
- Add admin-only routes for:
- Creating a new vehicle
- Editing an existing vehicle
- Deleting a vehicle
- Viewing all vehicles
- Create EJS views for the above CRUD operations using Bootstrap for styling.
- Implement image upload using
multer, and store images in a public directory. - Ensure proper validation and authorization (only logged-in admins can manage vehicles).
- Display the list of vehicles to all users on a separate
/vehiclespage (read-only).