Giter VIP home page Giter VIP logo

social-network's Introduction

Social Network

[[TOC]]


๐Ÿ“œ START

Introduction

Social networks have transformed the way we communicate, advertise and lead our lives during the past 2 decades. Many of us have one or multiple profiles on one or several networks, and we use them on a daily basis to communicate and share information.


Task description

We are tasked with developing a small social network, where users can create their profiles, make friends or follow each other. They are able to create posts, which could be public (visible to their friends and followers), or private (only visible to their friends).

The users that can see a post, have also the option to like (or unlike if they've liked it before). A single user can only like a single post once (they can like as many posts as they like, but each individual only once).

Finally, all users can request to see their wall, which is a list of all the posts created by themselves, their friends, and the public posts of the people they follow.

The user has:

  • fullName: the user's full name

The posts have:

  • text: A string value, representing the contents of the post
  • visibility: can be either public or private

Develop a set of REST service APIs based on the swagger file provided - swagger file, that allows users to:

  • Users can create their profiles (POST /users)
  • They can make friends or follow other users (POST /users/{user1Id}/{friends|followers}/{user2Id})
  • For the follower relationship, the second passed userId becomes a follower of the first passed userId (user1Id <-isFollowedBy- user2Id)
  • They can create posts, that are public or private (POST /posts)
  • Request to see their wall, which contains all posts that are visible to them, sorted by latest to earliest (from the creation time descending) (GET /walls/{userId})

You can open the swagger file using a tool like Swagger Editor, which provides a good visual representation of the methods needed, their format, sample requests and responses.

Requirements

While implementing your solution please take care of the following requirements:

Functional requirements

  • The REST API methods should be implemented based on the specification provided in the linked swagger file;
  • Add 2 new API methods (they're not defined in the swagger file) that enable a user to like a post, and unlike a post they've already liked. When returning the list of posts in the /walls method, add a new attribute to each post returned, containing the number of likes it has;
  • There is no need for UI.

Non-functional requirements

  • The project must be buildable and runnable;
  • The project must have Unit tests;
  • The project must have a README file with build/run/test instructions (use a DB that can be run locally, e.g. in-memory, via container);
  • Any data required by the application to run (e.g. reference tables, dummy data) must be preloaded in the database;
  • Input/output data must be in JSON format;
  • Use a framework of your choice, but popular, up-to-date, and long-term support versions are recommended.

๐Ÿ“œ END

social-network's People

Contributors

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