Skip to content
Caleb edited this page Apr 25, 2020 · 4 revisions

Welcome to the LetsCube wiki!

It may get confusing how this webapp works, so I have some documentation here.

Data flow

This may get reworked for the future but for now:

The server stores all rooms in MongoDB. All semi-permanent data gets stored in the database. The list of users do not get stored. This is because the list of users is volatile and can change when the server restarts. The server must be online to keep track of users. Instead, users are currently stored in system memory and get exposed through a virtual on the mongoose model (server/models/room.js).

Users get authenticated through the WCA website using Oauth.

When a client loads, it connects to the socket server and asks for the user (/api/me). A 403 response from api/me will make the client assume it's not logged in. When a client connects to the socket server, the server immediately sends the updated list of rooms. From there, the client displays them.

When a room loads

Clone this wiki locally