4 ms·
You're overcomplicating everything. Websocket endpoints. Simple.
by helloworld42024 2y ago
You're overcomplicating everything. Websocket endpoints. Simple.
- codingdave 2y ago...and that oversimplifies everything. Yes, websockets to the browser are likely to be a piece of the answer. But a server needs to maintain the session for the websocket and send messages. And that server needs to subscribe to data updates in the database... while also respecting auth of the current user. It is certainly a problem with an achievable solution, but it is not simple.
- bruchim 2y agoAgree.
- helloworld42024 2y agoIn his initial message, the original poster provided a link to Supabase, which integrates PostgreSQL with PostgREST out of the box. This setup automatically offers websocket server functionality: 1. The websocket server, database data subscriptions, and all session management are consolidated in this layer. 2. Updates to data are efficiently managed using a built-in PostgreSQL function. 3. User authentication is managed via React, employing either JWT or OAuth. As I mentioned earlier, it's quite simple.