2023
Upon arrival at the website, the user is immediately placed in a virtual room where someone is sitting or will have to wait a while for another user. These are thus automatically connected. The user is asked if the application will access their camera and microphone. In case it does, the user's webcam is turned on and they can now communicate with another user. The two users can also communicate with each other via messages loaded in real time. In preparation, I read up on a number of concepts such as Web Real-Time Communication and its associated concepts such as peer connections, media streams, STUN servers and Interactive Connectivity Establishment. Then I also read up on Svelte and SvelteKit, as I had never used this front end framework before, and this seemed like a perfect opportunity to get started with it. For storing all room and real-time connection related data, I decided to work with Firebase Firestore since this technology gives the ability to store or retrieve data in real-time. I wanted to be able to automatically connect users to each other, without them having to access some kind of ID or manual link. This is why I worked with WebSockets; the application checks if the last connected user is the first of a pair (i.e., an odd number) and thus creates a new 'room' with the Socket.IO library. The ID of this created room is stored, and the next connected user (even number) then automatically connects to the last created room whose ID is stored in the server-side Socket. This made me think it would be interesting to add a live chat functionality as well, as this is often done with WebSockets.