GithubHelp home page GithubHelp logo

social_media-backend's Introduction

Social_media-backend

Back End Assignment - REUNION

Problem Statement

  • Build APIs for a social media platform in either NodeJS or Python
  • The API should support features like getting a user profile, follow a user, upload a post, delete a post, like a post, unlike a liked post, and comment on a post
  • Design the database schema and implement in PostgreSQL or MongoDB

API Endpoints

  • POST /api/authenticate should perform user authentication and return a JWT token.

    • INPUT: Email, Password
    • RETURN: JWT token

    NOTE: Use dummy email & password for authentication. No need to create endpoint for registering new user.

    • POST /api/follow/{id} authenticated user would follow user with {id}
  • POST /api/unfollow/{id} authenticated user would unfollow a user with {id}

  • GET /api/user should authenticate the request and return the respective user profile.

    • RETURN: User Name, number of followers & followings.
  • POST api/posts/ would add a new post created by the authenticated user.

    • Input: Title, Description
    • RETURN: Post-ID, Title, Description, Created Time(UTC).
  • DELETE api/posts/{id} 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.

    • Input: Comment

    • Return: Comment-ID

    • 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.

    • RETURN: For each post return the following values
      • id: ID of the post
      • title: Title of the post
      • desc: Description of the post
      • created_at: Date and time when the post was created
      • comments: Array of comments, for the particular post
      • likes: Number of likes for the particular post

-Screenshot 1 image

-Screenshot 2 image

social_media-backend's People

Contributors

manish831 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.