This is unfortunate that I wasn’t able to log all my work, didn’t know about Flavourtown before…
This release included the chat features, which I think are personally pretty cool!!! This has all the features that most chatting applications like discord have, where you can send messages, edit and delete, react, and make group chats. It’s themed to look like how Hangouts did back in 2015 (the entire website is themed to look like Material Design Lite anyway).
The easy bits I would say was getting the chats from the database. The hard part was probably actually getting them to update in real time. You see, I was using SvelteKit for this project, and unfortunately, SvelteKit doesn’t have a ton of features to help people out with real time data. Websockets and SSE are not native features.
Naturally, I would have tended towards the Websockets Strat for a chat. Discord and WhatsApp use it, so it must be good! Unfortunately, unlike SSE, Websockets also has no real helping support from the public either, and while I could have used the PR version of svelte that had WS added, that just got closed and dismissed by SK creators, so lucky I didn’t use that lmao.
SSE wasn’t all that bad though. Using SSE I would have messages to a user stream down to their client while they made REST requests through the API to interact with the chat. If a request was successful, it would be transmitted to everyone but the author (because the author knows the request was successful).