I'm developing something like a messenger. I write backend using Nest js. And the user will have a PWA on the phone and a website in the browser. I want to make a notification that a new message has arrived to the user, but I can't figure out how to implement it. I don't want to use any third-party services for this. Can someone tell me ?
In the database, I store the device and ip of each user from all his devices. Maybe using this you can send a notification?
If you want it "raw", you can just send a request to the server each x seconds whether there is anything new.
This is however not an optimal solution. Usually, in such cases, people use WebSocket. It is not a third-party tool and it is supported by all browsers.