ULagos 360° connects to an external Socket.IO server to synchronize space states in real time across all connected tutors. The backend URL and every connection option are configured in one place:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Pewiz/ulagos360/llms.txt
Use this file to discover all available pages before exploring further.
src/hooks/useSocketConnection.js. Changing a single string in that file is all that is needed to redirect the frontend to a different server.
Default Backend URL
The production backend is hosted on Railway at:setupSocket function inside src/hooks/useSocketConnection.js.
Connection Configuration
The fullio(...) call used to establish the Socket.IO connection is shown below. All options are set explicitly to give predictable behavior under the unstable network conditions typical of open-day events.
src/hooks/useSocketConnection.js
transports: ["polling", "websocket"]— starts with long-polling and upgrades to WebSocket once the connection is stable. This avoids hard failures on networks that block raw WebSocket traffic.reconnectionAttempts: 5— the client will retry up to five times with a 2 s base delay, capped at 10 s, before giving up.withCredentials: false— no cookies or auth headers are sent, so simple CORS origins work without additional server configuration.timeout: 30000— allows up to 30 seconds for the initial handshake, accommodating cold-start latency on Railway’s free tier.
Changing the Backend URL
Find the io() call
Locate the
io(...) call inside the setupSocket function near the top of the callback body.Replace the URL string
Swap the URL string with your server’s full address, including protocol and port if non-standard. For example:
CORS Requirements
The Socket.IO server must explicitly allow the origin from which the frontend is served. Because the frontend useswithCredentials: false, a simple wildcard origin (*) or an explicit allowlist of your frontend domain is sufficient — no credential handling is required on the server side.
Running a Local Backend
For development and testing without the Railway server, you can spin up a local Socket.IO backend and point the frontend at it.-
The
server/directory in this repository contains empty placeholder files (server.js,package.json,render.yaml,README-DEPLOY.md) — all are 0 bytes and do not contain working code. They serve only as a reminder of the expected file layout. - The actual backend is a separate, external repository. Any Socket.IO server that implements the event protocol is compatible — see the WebSocket Events reference for the full list of required events.
-
After setting up your local server, point the frontend at it by replacing the URL in
useSocketConnection.js:
Expected Server Event Protocol
The backend must implement all events documented in the WebSocket Events reference. This includes responding to client-emitted events such asregister_user, get_all_spaces, update_space, sync_spaces, and user_logout, as well as broadcasting space_updated and state-response events to connected clients.