ankitbisen28 / Atelier

Letest web app for custom clothing, Using React vite and Nodejs
https://atelier-client.vercel.app/
0 stars 1 forks source link

Feature Request: Project Search Functionality #9

Open ankitbisen28 opened 2 weeks ago

ankitbisen28 commented 2 weeks ago

Description

Create a feature that allows users to search for projects using a search bar with filtering capabilities based on the provided Mongoose schema. The search functionality should be robust, allowing users to find projects that match their interests and criteria.

Requirements

  1. Search Bar:

    • Implement a search bar that allows users to search for projects by title, description, or category.
    • The search should support partial matches and provide suggestions as the user types.
  2. Filtering Features:

    • Add filters to narrow down the search results. Filters should include:
      • Category
      • Budget range
      • Deadline
      • Status (open, closed, in progress, completed)
    • Allow multiple filters to be applied simultaneously.
    • Ensure the filters are user-friendly and easily accessible.
  3. Search Results:

    • Display search results dynamically as the user types and applies filters.
    • Show relevant details for each project such as title, description, budget, deadline, category, and status.
    • Provide sorting options (e.g., by budget, deadline, recently added).

Acceptance Criteria

Additional Information

Mockups / Examples

Provide any mockups or examples of the desired component if available.

Technical Requirements

Mongoose Schema for Reference

const mongoose = require('mongoose');

const projectSchema = mongoose.Schema({
    "title": String,
    "description": String,
    "requirements": String,
    "budget": Number,
    "deadline": Date,
    "consumerId": String, // Reference to the user who posted the project
    "category": String,
    "images": [
        {
            "url": String, // URL of the image stored in an external service
            "description": String, // Optional description of the image
            "uploadedAt": Date // Timestamp when the image was uploaded
        }
    ],
    "bids": [
        {
            "bidderId": String, // Reference to the user who placed the bid
            "amount": Number,
            "message": String,
            "createdAt": Date
        }
    ],
    "selectedBidder": String, // Reference to the selected bidder (if any)
    "status": String, // "open", "closed", "in progress", "completed"
    "createdAt": Date,
    "updatedAt": Date
});

projectSchema.virtual('id').get(function () {
    return this._id.toHexString();
});

projectSchema.set('toJSON', {
    virtuals: true,
});

module.exports = mongoose.model('project', projectSchema);

Tasks