WeatherVanes hack day

The theme for Caplin’s Winter Hackday 2022 was ‘Bringing it all together’, meaning to take any of our existing stack, products, and tools, and see what synergies we could produce. The WeatherVanes team (Mike and Marcus) were ready to take up this challenge and see what they could produce in the 24 hours.

Key goals

Our goals were as follows:

  • Have a fully working Weather Adapter that could respond to users inputting a location
  • Create a comprehensive how-to on creating the Adapter, that others could follow to create their own Adapters
  • Use the existing documentation site template to add that how-to ‘seamlessly’ to the existing documentation website
  • Stretch goals:
    • Repeat using the beta REST Adapter in Liberator and with JSON data
    • Add a GUI
    • Have it working through Discovery

The next 24 hours

Initially we had hoped to use a third-party streaming service that already had a weather service integration with OpenWeather. However, this did not go to plan, so we had to rethink. Instead we pointed our Adapter at Meteo and quickly had something working.

Naturally, that did not quite go to plan either, as we had not fully embraced the KISS (Keep It Simple Stupid) principle. So we then started on a much simpler Adapter, and sticking to the aforementioned principle (in the belief that ‘less is more’), we successfully created an Adapter setup that is easy to follow.  And not forgetting that we had to document all of this too. 

Setting up Caplin’s docs development chain was a breeze:

  1. Clone the developer website
  2. Run the development server inside a Docker container: ./serve.sh -i -d
  3. Create a branch, add a new page, and preview the changes locally in a web browser.

Getting the weather data in Liberator Explorer was also relatively easy, especially with the logs visible below to know what was going on.

What about those stretch goals?

Well…

We got it working with Caplin Liberator’s beta REST Adapter, and documented how (you don’t need much code).

We got it working with Caplin Discovery too:

And we did add a GUI in the end:

Conclusions

Overall, we achieved our main goals, and most of the stretch goals too. And fortunately the weather service we had chosen provided nice graphics that we could easily include in the GUI. There was one bug with the GUI, but in 24 hours I think we met the remit of ‘Bring it all together’ – we used our existing stack, new tools, and even a beta product.

As ever with hackdays, we found the following golden rules to be true:

  1. Struggling to find bugs in hackday code at midnight is never a good idea. Sleep on it, and you’ll find the bugs in the morning.
  2. A good presentation can make or break a hackday project. So, take the advice of the first section in our project’s documentation page and …

Leave a Reply

Your e-mail address will not be published. Required fields are marked *