task_backend

Social Media appšŸ’«

A simple social media list app's backend with following features-
  • User authentication using JWT
  • Contains endpoints which can add, delete posts and list all posts for a spfc. user ,follow als unfollow other user,like and comment on post

Tech-stack

  • Nodejs , Expressjs , MongoDB

Endpoints

Endpoints Description
POST /api/authenticate To perform user authentication and return a JWT token.
POST /api/follow/{id} To make authenticated user would follow user with {id}
POST /api/unfollow/{id} To make authenticated user would unfollow a user with {id}
GET /api/user should authenticate the request and return the respective user profile.
POST /api/posts/ would add a new post created by the authenticated user.
DELETE /api/posts/ would delete post with {id} created by the authenticated user.
POST /api/like/{id} would like the post with {id} by the authenticated user.
POST /api/unlike/{id} would unlike the post with {id} by the authenticated user.
POST /api/comment/{id} add comment for post with {id} by the authenticated user.
GET api/posts/{id} would return a single post with {id} populated with its number of likes and comments.
GET /api/all_posts would return all posts created by authenticated user sorted by post time.