Chapter 6. Adding Friendship Capabilities

In Chapter 5, Managing Users, we implemented the user registration and login system. We now have user information in our database and we can continue with one of the most important characteristics of social networks—friendship. In this chapter, we will add a logic for the following:

  • Finding friends
  • Marking users as friends
  • Displaying the linked users on the Profile page

Finding friends

The process of finding friends involves a series of changes in our current codebase. The following sections will guide us through the searching and displaying of friend profiles. We will make a couple of improvements in our REST API and define a new controller and model.

Adding the search page

So far, we have pages for registration, ...

Get Node.js By Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.