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:

  1. Create a Mongoose model for Vehicle with at least the following fields:
    • name (String)
    • brand (String)
    • price (Number)
    • type (String, e.g., sedan, SUV, truck)
    • image (String – image file upload)
  2. Add admin-only routes for:
    • Creating a new vehicle
    • Editing an existing vehicle
    • Deleting a vehicle
    • Viewing all vehicles
  3. Create EJS views for the above CRUD operations using Bootstrap for styling.
  4. Implement image upload using multer, and store images in a public directory.
  5. Ensure proper validation and authorization (only logged-in admins can manage vehicles).
  6. Display the list of vehicles to all users on a separate /vehicles page (read-only).