Machathon 2021 – A realtime team mood board

The MACH Alliance are running a ‘Machathon‘ at the start of 2021 – the theme is ‘how to help people get virtually un-stuck’.

It sounded like a great opportunity to get hands on with a variety of MACH technologies! I hope you enjoy the idea and demo.

Some key urls:

The elevator pitch

Everyone is spending a lot more time isolated from their friends, family and colleagues – so why not make it as easy as possible for people to see how you are with a shared ‘mood board’.

Each team member can be authored in a CMS and then have their status and desired outcome updated in realtime based on their mood.

The realtime board is a web UI. There is also an Alexa skill to provide a summary of the team mood.

What makes a good outcome?

It’s really down to the user on how much they want to share – but could be something as simple as ‘please call me for a chat’, through to ‘it’s a head down kinda day’, or ‘today is a good day, can I help you?’.

I’d recommend some form of socially acceptable ego/gloat filter is applied to messages from the team, no-one likes a smarty pants or gloat monster in their face!

And now the fun bit, the tech!

The demo video shows all of this in action, complete with alexa fails and a guided tour of how it glues together under the hood!

As a quick summary:

  • Content
  • Cloud
    • AWS
      • S3 and Cloudfront for WebUI
      • Lambda for API, Orchestration and Alexa skill
      • SNS for fan-out
      • Secrets Manager
      • CloudWatch
      • ECR for container images
    • Azure
      • Azure functions for SignalR trigger
      • SignalR service for realtime updates
  • CI / CD
  • Home Assistant running on Raspberry PI

The underlying code makes use of a mixture of technologies:

  • Data access
    • Contentful Management API
    • GraphQL
  • UI
    • Nuxt and SSG generated version of site
  • API
    • Node JS and containers running in Lambda
  • Orchestrator functions
    • A mixture of dotnetcore and .net5

Triggering behaviour

If you’ve not seen Home Assistant, I’d highly recommend it for anyone interested in tinkering with smart home / iot appliances! It allows you to setup scripts, automations and a raft more all linked to IOT devices.

In our setup the trigger is:

TRÅDFRI, Remote control - IKEA

The different buttons are mapped to different actions:

  • Top button = send ‘happy’
  • Middle = send ‘ok’
  • Bottom = send ‘sad’
  • Left button = change user
  • Right button = change user

Behind the scenes, a custom lovelace UI is updated based on button presses and finally it notifies a Lambda function to initiate the process.

What are we actually orchestrating?

When you press a button this does a few things:

  • Sets the user mood dropdown in the UI
  • Pings a message to the orchestration lambda which:
    • Updates contentful with mood and outcome
    • Raises an SNS event – the subscribers then:
      • Ping SignalR to update the UI in realtime
      • Ping github actions to trigger a SSG build

What content to model

Contentful is used for several types of data in this setup, including basic data on the user, their mood, any custom outcomes they want and finally all the content for the Alexa skill.

Summary

I really hope you’ve found this a good use case of MACH technologies. What is refreshing about the approaches above are how quickly you can adapt and change. Making use of OTB cloud functionality provides a very rich toolset for multi channel, multi device applications. Oh, and it’s a lot of fun to play with 🙂

The downsides? Well, it’s a pretty complicated way to let people know you are having a bad day!

Leave a Reply

Your email address will not be published. Required fields are marked *