Building a Real-time Comment System in MERN using WebSockets

Building a Real-time Comment System in MERN using WebSockets

Β·

2 min read

Greetings, Hashnode Community! Excited to write my first Hashnode Post about how I built a Real-time Comment System! So, I was asked to code a simple commenting system in MERN as part of a take-home assignment for a start-up's hiring process. The major requirment was to have support for πŸ‘ & πŸ‘Ž.

I had actively started using Twitter and was amazed by its feature of real-time updation of retweet & β™₯️ count. How does twitter do that? After reading this amazing answer on SO, I thought Why not try implementing real-time comments & πŸ‘πŸ‘Ž using WebSockets? I would completely agree with implementing Long Polling would have made more sense, and that's what Socket.IO library will prefer doing, but then decided to learn more about WebSockets and implement the same.

So, did it turn out to be good? You decide! Watch the Video Demo I made after completing the assignment.

Interested in having a look at the code? Cool! Head over to my Github Repo and check it out!

Do tap on the πŸ‘ & β™₯️ to encourage & comment on any improvements, preferably in real-timeπŸ˜‰!