Summary

The MERN Social application we developed in this chapter demonstrated how the MERN stack technologies can be used together to build out a fully-featured and functioning web application with social media features. 

We began by updating the user feature in the skeleton application to allow anyone with an account on MERN Social to add a description about themselves, as well as upload a profile picture from their local files. In the implementation of uploading a profile picture, we explored how to upload multipart form data from the client, then receive it on the server to store the file data directly in the MongoDB database, and then be able to retrieve it back for viewing.

Next, we updated the user feature further to allow users to follow each other on the MERN Social platform. In the user model, we added the capability to maintain arrays of user references to represent lists of followers and followings for each user. Extending this capability, we incorporated follow and unfollow options in the view and displayed lists of followers, followings, and even lists of users not followed yet.

Then, we added the ability to allow users to post content and interact over the content by liking or commenting on the post. On the backend, we set up the Post model and corresponding APIs, which are capable of storing the post content that may or may not include an image, as well as maintaining records of likes and comments that are incurred on a post by any user.

Finally, while implementing the views for the posting, liking, and commenting features, we explored how to use component composition and share changing state values across the components to create complex and interactive views.   

By completing this MERN Social application implementation, we learned how to extend and modify the base application code to grow it into a full-fledged web application according to our desired features. You can apply similar strategies to grow the skeleton application into any real-world application of your choosing.

In the next chapter, we will expand further on these abilities in the MERN stack and unlock new possibilities as we develop an online classroom application by extending the skeleton application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset