Posts

Week 12 — Makers Mirror / SMRT mk II

Remember this old thing? As a final group project, we rebuilt my botched attempt at a smart mirror, with actual test-driven development this time round.

The idea is that the mirror is a self-contained product, capable of running a server on itself and displaying an interface with widgets. A user would connect the mirror to their wifi network and configure the widgets externally from a phone or computer on the same network, similar to the configuration of a router.

Left mirror interface — Right personalisation dashboard

The personalisation dashboard has a grid that represents the available positions of a widget on the interface. In the example below, the clock widget would appear in the top left corner of the mirror interface. The widget blocks can be toggled on/off and moved around by dragging and dropping into position on the grid.

One of the challenges was to somehow get the mirror interface to update itself when a user changed the dashboard settings, as there aren’t any touch-screen capabilities (but think of the smudges if there were, shudder). As the settings were saved to disk in a json file, I used BrowserSync to listen to changes on that particular file, then force a refresh of the mirror interface without user intervention. Voilá, a self-updating smart mirror.

We also experimented with using a LeapMotion sensor to put the mirror to sleep and wake it up with a swipe gesture, as well as some more advanced widgets like radio alarms that could be snoozed with a different gesture.

Watch the video of the project in progress. Just a warning, there’s a cringeworthy amount of my face in it. I did not make the video

Week 9 — Sockets galore

I have no idea what happened to the time after week 6, but it has flown by! In that time, I’ve built a web framework (move aside Express), a convincing clone of Instagram with photo filters, and even a multiplayer game.

One of my favourite group projects has definitely been the multiplayer game. The coaches set a theme of ‘useful tools for developers’, and out of that, Battletoads BattleCodes was born. It’s a happy mix between CodeWars (improve coding skills by completing challenges) and typeracer (race to type the fastest), where players race in real-time to complete code challenges before their opponents.

The reason I enjoyed this so much was because its a game (yay fun), and because there was the challenge of getting real-time, low-latency responses. HTTP relies on a client sending a request, and then the server responding. In a game where speed is crucial, that just won’t cut the mustard. With websockets, there’s a persistent connection between the client and the server which allows data to be sent and received immediately.

Find the project on Github.

Older Posts