Closed Ibukun-AL closed 1 month ago
Remove the rate limiting feature, as its overkill. There is no need to specify something that is a given like "https protocol". I do not see how search is encrypted in the db.
Search in general should be done via a single typesense service.
I've updated the issue description based on recent feedback and project requirements. Key changes include:
Removed the rate limiting requirement as it was deemed unnecessary for this implementation.
Eliminated the explicit mention of HTTPS protocol, as it's considered a standard practice.
Removed references to encrypting search data in the database. This isn't typically done for search functionality as it would hinder performance and isn't necessary for public blog content.
Added a requirement to integrate with Typesense service for efficient search functionality. This replaces the previous generic search implementation.
@darionnuel this endpoint should be paginated
I have updated the endpoint to include pagination as requested. The endpoint now accepts page and pageSize parameters to give out a paginated response. I also edited the successful response, requirements and acceptance criteria, and tasks and testing sections to account for the new pagination logic.
Here.
Team Members
@Ibukun-AL Spring Boot @Dricy FastAPI @Ace2489 .NET @darionnuel Nestjs
here
@darionnuel the response should contain the following pagination meta data.
{
...
meta: {
has_next: boolean,
total: number,
next_page: number | null,
prev_page: number | null
}
}
I cannot edit the issue any longer. It seems that I have been removed as a maintainer from the repo even though I am the team lead for my team.
Updated the GitHub issue to reflect the new response structure
@darionnuel the response ought to be an object of objects, not an array of object. Remove the [] around the object you are returning
Updated the response structure
Implement Blog Search and Filtering API
Description
Creating an API that allows visitors to search and filter through blog content on the site without authentication, providing quick access to relevant articles and information.
Acceptance Criteria
Purpose
To enable users to search and filter blog posts based on various criteria such as author, title, content, tags, and creation date, while implementing robust security measures to protect data and prevent abuse.
Requirements
GET /api/v1/blogs/search
) to handle requests for searching and filtering blog posts.Expected Outcome
The backend should provide a reliable API endpoint that allows users to search and filter blog content securely and efficiently. It should handle requests based on specified criteria, including content, creation date (
createdDate
), and tags, while adhering to high-security standards. Additionally, the API should support pagination to ensure manageable response sizes.Endpoints
Fetch Blogs:
GET /api/v1/blogs/search
Request Parameters:
author
: String (optional) - Author name to filter by.title
: String (optional) - Title or part of a title to filter by.content
: String (optional) - Content or part of the content to filter by.tags
: String (optional) - Tags associated with the blog post to filter by.createdDate
: String (optional) - Date for filtering blog posts created on or after this date (format: YYYY-MM-DD).page
: Int (optional) - Page number for pagination.pageSize
: Int (optional) - Number of results per page.Successful Response:
Error Response
Tasks
[ ] Develop a secure GET endpoint** (
/api/blogs/search
) to fetch blog posts based on search and filter criteria.[ ] Ensure server-side validation and sanitization** of user input to prevent security vulnerabilities.
[ ] Configure logging to capture API activities and errors for monitoring and troubleshooting.
[ ] Integrate with Typesense service for efficient search functionality.
[ ] Implement pagination logic to handle page and pageSize parameters and return paginated results.
Testing
Write comprehensive unit tests to validate backend logic, including input validation, filtering, pagination, and response formatting.
Conduct integration tests to verify endpoint functionality and interaction with database queries.
Perform security testing to identify and address potential vulnerabilities, ensuring robust data protection measures.