playfulprogramming / playfulprogramming/hoof
Return "suggested articles" from post endpoint
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 9
- Forks
- 7
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 23
Description
When a post is queried on /content/post/{slug}, the frontend will need to display a list of three "related posts" - using the post slug, title, and authors.
{
"relatedPosts": [
{
"slug": "post-slug",
"title": "Post Title",
"authors": [
{
"slug": "author-slug",
"name": "Author Name"
}
]
}
],
}
The current frontend implementation of this exists here: https://github.com/playfulprogramming/playfulprogramming/blob/8b3908092fe61ea490afcf431cd471dde14b8865/src/utils/get-suggested-articles.ts#L72
This must be significantly optimized and ideally done in one query.
- This should exclude any posts in the same collection or groupId.
- Consider a vector similarity search on the post description.
- Consider the number of overlapping tags between the posts
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the /content/post/{slug} endpoint and read the current frontend reference in src/utils/get-suggested-articles.ts around line 72. Define how similarity and overlapping tags should select three posts while excluding the same collection or groupId, then verify the endpoint returns the specified slug, title, and author fields efficiently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend, search
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100