DEV Community 👩‍💻👨‍💻

Saeed
Saeed

Posted on

I need to add the notification feature in my Web App like that of Facebook using NODE JS and MONGO DB. How should I start?

Hi ...
first of all sorry about my english :).
I am building a management system web app using MERN stack , and for this project notification must be sent to the admin when for example a user sends a comment.
my question how can i make this notification system real time for example like facebook? so that the admin doesn't have to reload the page to get the notification.

Top comments (3)

Collapse
 
arjenpostma profile image
Arjen Postma

There are probably a whole different bunch of solutions for this. The easiest is probably a piece of javascript that calls your backend every X seconds to see if there is anything new.

Collapse
 
said96dev profile image
Saeed Author

you mean like setInterval Method ?

Collapse
 
jzombie profile image
jzombie

I'd personally use a library like socket.io.

🌚 Browsing with dark mode makes you a better developer by a factor of exactly 40.

It's a scientific fact.