Open Kenny477 opened 1 year ago
Since we only really need server-to-client notifications (e.g. notify client when database change occurs), we can use SSE (Server Sent Events) in the future. No need for websockets because we don't need realtime constantly between client-server.
See: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
We previously attempted to setup order messaging with socket.io but it's a bit complicated. When we have the time we should look into this more so we can potentially not have to use Pusher (this is a long term issue though).
Loopback does have some experimental support for sockets, or we can write our own simple socket server (we aren't doing anything fancy, just some simple communication between server and client to notify if an event occurred). https://www.npmjs.com/package/@loopback/socketio