DEV Community

Clavin June
Clavin June

Posted on

What is the tools to make a realtime notification?

I want to make an app/web app that has a realtime notification the backend will be golang, and the front end will be react/next/react native. But I have no idea to make the realtime notification. I've tried using realtime database firebase, but I think there is another way. Or should I use GraphQL subscription? I need your advice!

Thank you.

Top comments (8)

Collapse
 
devdrake0 profile image
Si

Have you looked into websockets?

Collapse
 
clavinjune profile image
Clavin June

If I use websocket, do I need to open another port? If I use firebase, there's no need to open another port for realtime notification

Collapse
 
devdrake0 profile image
Si

You will, yes. Is there a reason why you don't want to do that?

Thread Thread
 
clavinjune profile image
Clavin June

Isn't it better if I open less port? Just for security reason

Thread Thread
 
devdrake0 profile image
Si

Yes, of course.

The most secure system would be one that doesn't, and never has, connected to the internet, but that's not practical.

You're right to be cautious, but it's best to find the right solution and open what ports you need.

You can, of course, just have your website served on port 80, have it routed correctly using a reverse proxy like NGINX and have your frontend speak to your server via websockets on the same host and not have to open up any more ports

Thread Thread
 
clavinjune profile image
Clavin June

Thanks Si!

I would try that and do some research about it.

Appreciate it!

Collapse
 
pareshjoshi profile image
Paresh

checkout this npm package for react: npmjs.com/package/react-realtime

Collapse
 
clavinjune profile image
Clavin June

Thanks paresh! Will check it soon