2 development.web
qwerinope edited this page 2026-03-04 16:51:17 +01:00

Web

The web directory is where the websocket connections and 2 fullstack webapps are defined.

Websocket connections work on subsciptions. Clients can subscribe by sending a subscibe event.

The fullstack webapps are built by bun at runtime. When running with bun start-dev, HMR will be on.

Websockets, the chatwidget's getBadges and getEmotes routes and alerts/assets/* all require a certain authentication step to function. They need auth to be encoded in the search parameters. This auth is set in the .env file as WS_TOKEN.

We cannot lock the /chat and /alerts behind this, as there is no way to serve bundled HTML/CSS/JS with bun building without some disgusting code while not directly mapping it to a route (which would be nessecary to check for authentication). The next best option is to lock the websocket and related paths behind a simple check.