Allow users to **like/vote** posts to show appreciation and support. This feature contributes to the **Leaderboard rankings** for both authors and posts. --- ### β Tasks * [ ] **Database Integration** * [ ] Implement `Vote` model linking `User` and `Post`. * [ ] Ensure one user can only like a post once (unique constraint). * [ ] Store timestamps for potential future analytics. * [ ] **UI/UX** * [ ] Add like button (toggle state: liked / not liked). * [ ] Show total number of likes on each post. * [ ] Provide real-time feedback (optimistic update or re-fetch). * [ ] **Backend / Fullstack Logic** * [ ] Implement server-side action for toggling like/unlike. * [ ] Ensure only authenticated users can vote. * [ ] Integrate vote count into leaderboard logic. * [ ] **Testing & QA** * [ ] Add unit tests for vote creation & deletion. * [ ] Add integration tests for like toggle flow. * [ ] Test UI interactions (like, unlike, state updates). --- ### π Acceptance Criteria * Authenticated users can like/unlike posts. * Total like count is displayed and updated correctly. * Each user can only like a post once at a time. * Like data contributes to leaderboard rankings. * Feedback is clear on interaction.
Activity