This plan outlines the steps to add social sharing, session-based likes/dislikes, personal social links, and thumbnail support to the Coding Panda Blog.
- Add
thumbnail_image,likes_count, anddislikes_counttopoststable. - Create
post_interactionstable for session-based tracking. - Set up RLS policies for public likes/dislikes.
- Update
BlogPost,CreatePostInput, andUpdatePostInputintypes/blog.ts. - Add
PostInteractiontype.
- Create
services/interactionService.tsto handle:- Checking if a session has already interacted.
- Adding/Removing likes/dislikes.
- Fetching counts.
-
ShareButtons.tsx: Social sharing buttons (Twitter, LinkedIn, Copy Link). -
LikeDislike.tsx: Interaction buttons with optimistic UI updates. -
PostActions.tsx: Wrapper for Share and Like/Dislike components.
-
SocialLinks.tsx: Reusable component for brand social links. - Update
Footer.tsxto includeSocialLinks.
- Update
PostForm.tsxto include Thumbnail image selection/upload.
- Add
PostActionstoapp/[slug]/page.tsx. - Update
BlogCardto display thumbnails. - Update
adminBlogService.tsto handle the new fields.
- Unit tests for
interactionService. - Component tests for
ShareButtonsandLikeDislike. - Integration test for the voting flow.