Issue
in the last few months i’ve done some MERN projects, and i found something that really bothered me, not because i didn’t know what was that thing, but because it’s something i’ve never heard about.
What i’m trying to say, is that, every project i did, i can not see the changes in real time, for example, i did a facebook clone, where you register and post stuff, and you can see how things change in your pc, changes in real tme in your pc, but, if i try to see those changes from another pc, i can’t i have to update the page with f5 to see those results
what do i have to learn to make my big apps, like the facebook clone, to make everything in real time, like facebook, whatsapp, instagram, twitter do ?
Solution
I am not sure what Facebook, Whatsapp, Instagram, etc. use but as far as real time updates is concerned, you need to learn Websockets or Socket.io. You can also opt for services like Firebase that offer services that provide real time updates. Twilio is also another one that offers such services. But if you want to build it on your own, then you need Websockets.
I am not sure about Facebook but Whatsapp and any other messenger or chat services probably use sockets under the hood.
Look at this list of open source clones and some of the projects use the MERN stack along with socket.io just in case it helps: https://gourav.io/clone-wars . I looked through that list and found this one that may be helpful: https://github.com/Sandermoen/instaclone
I am personally taking a course on Udemy by Robert Bunch that is completely on socket.io.