As we will be allowing users to filter the posts with tags, we need to store tags somewhere and show them with the post to allow filtering in frontend.
Task
Make a list of tags (can be a local list in a constants.js file)
Music
Game
Nature
Calm
Funny
Startup
Life
Travel
Food
Entrepreneurship
Education
Health
Love
Design
Writing
Technology
Self-Improvement
Business
Sports
Art
Open-Source
Programming
In /model/post.model.js Post model add tags list (list of strings, from above tags).
In /service/post.service.js add tags from request body.
Add a new endpoint /api/post/tags to list all the tags.
Context
As we will be allowing users to filter the posts with tags, we need to store tags somewhere and show them with the post to allow filtering in frontend.
Task
/model/post.model.js
Post model addtags
list (list of strings, from above tags)./service/post.service.js
addtags
from request body./api/post/tags
to list all the tags.