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
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.
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.
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
Users can search for projects using the search bar.
Users can apply multiple filters to narrow down the search results.
The search bar and filters work seamlessly together to display relevant results.
The interface is responsive and works well on various devices.
Search results include comprehensive details and sorting options.
Additional Information
Ensure the component is responsive and accessible.
Provide clear error messages for any issues in the search functionality or filters.
Consider implementing autocomplete suggestions in the search bar.
Mockups / Examples
Provide any mockups or examples of the desired component if available.
Technical Requirements
Ensure compatibility with the existing tech stack of the project.
Utilize efficient algorithms to handle search and filter operations without significant performance degradation.
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
[ ] Implement the functional search bar.
[ ] Add filtering features for category, budget range, deadline, and status.
[ ] Ensure multiple filters can be applied simultaneously.
[ ] Display search results with relevant details.
[ ] Implement sorting options for search results.
[ ] Test the search functionality and filters thoroughly.
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
Search Bar:
Filtering Features:
Search Results:
Acceptance Criteria
Additional Information
Mockups / Examples
Provide any mockups or examples of the desired component if available.
Technical Requirements
Mongoose Schema for Reference
Tasks