hngprojects / hng_boilerplate_nestjs

Description
Apache License 2.0
180 stars 105 forks source link

[FEAT] HELP CENTER - SEARCH ARTICLE(s). #107

Closed CFCIfe closed 2 months ago

CFCIfe commented 3 months ago

Description

This page serves as the central hub for our help center, providing users with access to a wealth of informative articles. With its intuitive search functionality, users can easily find the articles they need to address their questions or concerns. Additionally, the help center page implements rate limiting on its search endpoints.

Acceptance Criteria

Purpose

Users can search for articles by titles / topics.

Requirements

Endpoints

[GET] /api/v1/help-center/topics/search?title={title}

Description

Successful Response

Status code: 200

{
  "success": true,
  "message": "string",
  "status_code": 200
  "topics": [
    {
      "id": "int",
      "title": "string",
      "content": "string",
      "author": "string"
    }
    ...
  ]
}

Error Response

Status code: 404

No article matches the title search param.

{
  "success": false,
  "message": "string",
  "status_code": 404
}

Status code: 429

Too many requests, Rate limit reached.

{
  "success": false,
  "message": "string",
  "status_code": 429
}

Status code: 500

Internal Server Error

{
  "success": false,
  "message": "string",
  "status_code": 500
}

Database Schema

Table name: help_center_topic

- id:
  - constraints: string(uuid), unique, primary-key, not null
- title:
  - constraints: unique, not null, text
- content:
  - constraints: not null, text
- author:
  - constraints: not null, text
- createdAt:
  - constraints: datetime
- updatedAt:
  - constraints: datetime
- user_id:
  - constraints: string(uuid), unique, foreign-key, not null

Database diagram

image

Testing

  1. Unit Tests
CFCIfe commented 3 months ago

As requested by Mark here, this article has been separated to this functionality.

CFCIfe commented 3 months ago

TEAM_002

@CFCIfe - Team Lead - Nest JS @Oseni03 - Python FAST API @salissadiq - Go (Gin) @laouali80 - c# @timiajayi - PHP

CFCIfe commented 3 months ago

To update my route per - https://github.com/hngprojects/hng_boilerplate_nestjs/issues/111#issuecomment-2235907567