Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

I'm going to make an X clone. Here's a solid, architected route structure for a social media backend (X/Twitter clone). I'll organize by resource with typical REST conventions.

Auth Routes POST /api/auth/register - Register new user POST /api/auth/login - Login user POST /api/auth/logout - Logout user POST /api/auth/refresh-token - Refresh access token POST /api/auth/forgot-password - Request password reset POST /api/auth/reset-password - Reset password with token GET /api/auth/verify-email/:token - Verify email User Routes GET /api/users/me - Get current logged-in user PUT /api/users/me - Update own profile DELETE /api/users/me - Delete own account GET /api/users/:username - Get user profile by username GET /api/users/:id/followers - Get user's followers GET /api/users/:id/following - Get who user follows POST /api/users/:id/follow - Follow a user DELETE /api/users/:id/follow - Unfollow a user GET /api/users/search?q= - Search users POST /api/users/me/avatar - Upload profile picture POST /api/users/me/banner - Upload banner image GET /api/users/suggestions - Suggested users to follow Tweet/Post Routes POST /api/tweets - Create a tweet GET /api/tweets/:id - Get single tweet DELETE /api/tweets/:id - Delete own tweet GET /api/tweets/user/:userId - Get tweets by a user POST /api/tweets/:id/like - Like a tweet DELETE /api/tweets/:id/like - Unlike a tweet GET /api/tweets/:id/likes - Get users who liked POST /api/tweets/:id/retweet - Retweet DELETE /api/tweets/:id/retweet - Undo retweet POST /api/tweets/:id/reply - Reply to a tweet GET /api/tweets/:id/replies - Get replies to a tweet POST /api/tweets/:id/bookmark - Bookmark a tweet DELETE /api/tweets/:id/bookmark - Remove bookmark GET /api/tweets/bookmarks - Get own bookmarks Feed / Timeline Routes GET /api/timeline/home - Home feed (following + algo) GET /api/timeline/explore - Explore/trending feed GET /api/timeline/user/:username - User-specific timeline Search & Trends GET /api/search?q= - Search tweets/users/hashtags GET /api/trends - Get trending hashtags/topics GET /api/hashtags/:tag - Get tweets by hashtag Notifications GET /api/notifications - Get all notifications PUT /api/notifications/:id/read - Mark notification as read PUT /api/notifications/read-all - Mark all as read DELETE /api/notifications/:id - Delete notification Direct Messages GET /api/messages/conversations - Get all conversations GET /api/messages/conversations/:id - Get messages in a conversation POST /api/messages/conversations/:id - Send a message DELETE /api/messages/:id - Delete a message POST /api/messages/conversations - Start new conversation Media Upload POST /api/media/upload - Upload image/video for tweet DELETE /api/media/:id - Delete uploaded media Lists (optional advanced feature) POST /api/lists - Create a list GET /api/lists/:id - Get list details PUT /api/lists/:id - Update list DELETE /api/lists/:id - Delete list POST /api/lists/:id/members - Add user to list DELETE /api/lists/:id/members/:userId - Remove user from list Suggested tech stack structure

Auth: JWT (access + refresh tokens) DB: PostgreSQL (relational — good for followers/likes/relations) or MongoDB Real-time: Socket.io for DMs/notifications Media storage: S3 or Cloudinary Caching: Redis for feeds/trending

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages