<aside> ⚠️
Note that any attached code snippets are only as recent as the page itself, these pages are not meant to be documentation, and any changes to the project will not be reflected here — rather, they would be written about in newer pages.
The only real reason someone would want to read these is to understand the process of how I built WoofSlides. If you want to understand how it works at the moment you’re reading this, you should check documentation (if it has been released) or the most recent page.
</aside>
I’m writing this about the updates made in the last few days, the last commit being https://github.com/woofslides/server/commit/463b92a41672de8f59c807b280d875968f25a079 on the https://github.com/woofslides/server. Since this is the first update, I have to cover all of the progress made so far and describe how the project has been structured since the beginning.
There are three apps, and three repositories respectively:
https://github.com/woofslides/viewer
https://github.com/woofslides/controller
https://github.com/woofslides/server
The viewer shows the presentation in full screen, the server sends messages to the viewer, and the controller tells the server what kind of messages to send.
The communication method for streaming data to the viewer and the embed viewer in the controller from the server, I originally thought would be WS (you might assume that if you see the excalidraw diagrams in the profile repository), but I’ve eventually decided, would be SSE (see the attached video).
https://www.youtube.com/watch?v=6QnTNKOJk5A
So far, the UI has been completed for the viewer, as it’s just an iframe that’s updated with a state; half of the controller is done (the connection part is complete, and the controller itself isn’t); and the significance is on the server.
To understand how the server has been designed so far, we must first understand the flow of the connection to the server.
A simulated example has been written in the source code of the server for testing, and I will be using that to explain the connection flow:
https://github.com/woofslides/server/blob/ff9655c8409b9d6db234e0c77a9a28fc034b0f60/example.go
Two connections are involved in this example for purposes of testing, but we will only take the first one — the connection involving vieweradress0000
and controlleradress0000
.
<aside> 💡
These addresses, in practise, would be IP addresses and their ports — which the getIp
endpoint would provide to the frontend. We use the placeholders here for the example and for testing, as any string is considered for the function.
</aside>
As the first statement, we call the function that would be called when the controller requests to connect to a viewer that has not connected yet.
result_for_controller := controllerRequestViewer("controlleraddress0000", "vieweraddress0000")