Add a websocket gateway
Add a websocket gateway. This would allow a lots of new things:
- Real time notifications for specific events in the SPA
- Sending discord invite links to people
- Real time stock display
- Much more
This has the benefit over webhooks of being reusable by every application wanting to connect and interact with seb without much configuration needed. This is also less heavy to implement than webhooks.
One idea would be to do it with laravel-websockets, as it would be really simple to do. Further research has to be done before choosing the way we do it.
The simplest thing to do would be to just send JSON over the websocket connection, with a defined structure (like Discord does). This however would be really heavy to do especially for simple packets. Something like what guilded is doing with their gateway could be done (packet id + json payload).
Intents are a must have, especially if we want to manage privileges on the gateway like we do on the regular REST API.
Authentication could be done like with the regular API (Bearer token sent in the first GET that does the 101). Not possible, we will have to use an authentication packet then, or pass the token as a get parameter.