Skip to content

feat(follow): implement complete follow/unfollow functionality#216

Open
Samm-05 wants to merge 2 commits into
nensii21:mainfrom
Samm-05:feature/follow-unfollow
Open

feat(follow): implement complete follow/unfollow functionality#216
Samm-05 wants to merge 2 commits into
nensii21:mainfrom
Samm-05:feature/follow-unfollow

Conversation

@Samm-05

@Samm-05 Samm-05 commented Jul 8, 2026

Copy link
Copy Markdown

📌 Overview

This pull request implements the complete Follow / Unfollow functionality for DevLink, enabling users to follow other builders, manage follower relationships, and view follow statistics.

Closes <#120>


✨ Features Implemented

Backend

  • Added Follow API endpoints

    • POST /users/{user_id}/follow
    • DELETE /users/{user_id}/follow
    • GET /users/{user_id}/followers
    • GET /users/{user_id}/following
    • GET /users/{user_id}/follow-status
  • Prevented duplicate follow requests.

  • Prevented users from following themselves.

  • Automatically updates follower and following counts.

  • Preserved backward compatibility with existing /followers/* routes.


Frontend

  • Added reusable FollowButton component.

  • Integrated Follow/Unfollow functionality into builder/profile pages.

  • Added optimistic UI updates using TanStack React Query.

  • Added loading and disabled states during API requests.

  • Synced follower counts automatically after follow/unfollow actions.

  • Connected frontend services to the new backend endpoints.


🧩 Additional Improvements

  • Fixed TypeScript build issues discovered during implementation.

  • Fixed import inconsistencies.

  • Cleaned JSX nesting issues causing frontend compilation failures.

  • Improved overall API consistency.


✅ Validation

Successfully verified:

  • ✅ Backend compilation
  • ✅ Frontend production build
  • ✅ TypeScript type checking
  • ✅ API integration
  • ✅ Follow/Unfollow workflow
  • ✅ Optimistic updates
  • ✅ No database migration required

🧪 Testing Performed

  • Follow another user
  • Unfollow a user
  • Duplicate follow prevention
  • Self-follow prevention
  • Follow status endpoint
  • Followers list
  • Following list
  • Optimistic UI updates
  • Loading states
  • Error handling

📂 Files Changed

Backend

  • Follow router
  • Follow schemas
  • Follow service
  • API endpoint updates

Frontend

  • FollowButton component
  • React Query hooks
  • API service
  • Profile integration
  • Builder pages

🚀 Notes

  • No breaking changes.
  • No database migration required.
  • Existing functionality remains unaffected.
  • Implementation follows the existing project architecture and coding standards.

@nensii21

nensii21 commented Jul 9, 2026

Copy link
Copy Markdown
Owner

attach screenshots and videos showing what changes have been made. Also CI jobs are failing so please update it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants