• Week 329

    28 April 2019

    A four-day week after the bank holiday.

    Two days at Highrigg. Last week, I was forcing myself into a deep dive on in React, building a prototype front-end that talked to a third-party API. This week, I decided it was worth introducing our own server-side API between us and the third-party.

    This decision - which my colleague Lachie helped me come to, in a highly useful brief rubberducking session - came about for a few reasons. Firstly, so we could separate some responsibility, and make the front-end code a bit less brittle. It also meant that if we wanted to start using other service - notably, some internal data-sources - rather than making growing number of calls on the front-end, we could keep front-end calls down and instead combine all the data from multiple server-side calls into a single payload. That also means we can take a little bit of responsibility for caching in the right place - the server-side.

    With that decision made, I wanted to write just enough code to confirm that I’d picked appropriate tools, as well as architecture. I began exploring building a small GraphQL service. GraphQL is very trendy right now, but it feels like an appropriate fit. I’m making something resembling a small mobile app, and being able to serve up all the data for a ‘page’ or ‘view’ in a single lump is ideal. My data model is also fairly hierarchical, and largely read-only, which made life simple.

    Unlike last week’s battles with React, this work went more smoothly, and it turns out that I don’t just like the idea of GraphQL, I also really like the implementation. By the end of the second day, I had the beginnings of a service shelled out. More to the point, I’d done enough to decide that this felt like a viable technology to use for the project going forward. I finished up my technical review documents with this knowledge, and updated some architecture diagrams.

    On Thursday and Friday, I finished bagging up a run of Foxfield kits for Thonk, and spent some time in the workshop - firstly, starting to brush up some woodwork skills, and secondly, building up an electronics prototype. This second electronics prototype was another SAMD21-based build, which I’ll probably write up, to share my approach for building these boards. It worked first time - and also confirmed that a new footprint was highly viable for what I wanted to do with it.