Michael Bailey .Net

About

Hello world

Hi there, I'm Michael. I'm a software engineer with a deep interest in user-focused, technology and engineering. I enjoy building tools to assist myself, and others, with my other hobbies and interests.

This site is a place for me to share projects I'm working on, write about technologies I 'm learning, and put into practice my learnings .

Projects

Bramble Pi

This is my personal kubernetes cluster. It is a setup of 5 Raspberry Pi 5's, using K3s to create a 'simple' kubernetes cluster. This has been a big learning driver for me, as I've not had much experience with setting up deployment environments, managing compute resources, or setting up scalable software.

The core use cases for this is hosting my own projects, with cross-platform ones taking priority. In fact, this very website is hosted on it at this moment! the gym log book backend and frontend are hosted on here as well, as its current evolution requires a central server, although it is not set up to be the most scalable service in the world.

There are other project being hosted on this. One is a kind of service provisioner, It sets up environments for deploying docker based services. This runs on the control plane Pi, as it currently hosts a Minecraft server for myself.

Gym Log Book

Gym Log Book is a full native Android app I built to help log my strength training progress. It features structured navigation, local data persistence, with plans to display graphs and support more exercise types.

When I started at the gym, I wanted a way of logging my progress. Whilst I found lots of apps that could help with this, I found most of them to have complex functionality or had lacking UX. So I decided to create my own app.

After starting with some Apple shortcuts, I got the basic idea of what I wanted to include. Settings for free weights, or machines; Auto complete for sets; a list and possibly graphs for progress. All of which expanded my knowledge of Android app development.

Portfolio site

My portfolio site is a place for my thoughts, side projects, and a sandbox for testing new things. Whilst this is a testing ground, i have a few rules that i try to follow.

Firstly, this website will not be using javascript frameworks. This is due to wanting a pure Kotlin codebase. Some sections might feature Wasm loaded with javascript, allowing other projects to be hosted within a page. But overall, static pages will be generated, following standardised html fragments.

Now the HTML is generated within the server using Kotlin, Ktor, and Ktor-html, a library for generating HTMl as a DSL from Ktor. This means i can get the best of reusable components, without using a specialised templating engine.

Secondly, design is not my strong suit. Especially with using CSS to style HTML. for this reason, I've imposed some guides for writing pages. HTML features semantic tags. Things like section, article, main, and nav. These all serve specific purposes in a web page. So I've designed my pages to utilise these for content structure. sections hold articles, articles contain paragraphs, and so on.

With the page defined using these tags, defining styles fits around the semantic meaning of the tags, rather than arbitrary classes. for now, there is only paragraph containing articles, but there could be a class of article than has an image. this links a tag, with a "class" of said tag, preserving semantic meaning.

Finally, This site shall have its deployments be fully automated. This is so i can properly learn how to make and host full kubernetes applications. Whilst also being an example for other projects. It won't be perfect, but it will be a good start to making my life easier.

Technologies

Kotlin

kotlin is my primary programming language. This is due to its flexibility between working on backend, frontend, and native applications. Whilst i have experience using industry standard frameworks, such as spring boot, i prefer to use Ktor and kotlin multiplatform.

Ktor

Ktor is a client and server http toolset for kotlin. it is written in kotlin almost entirely, with native parts to match platform specifics. This means i can have a kotlin backend, with a compose and Ktor website, desktop, and native frontends.

I am a fairly big proponent of the mono-repo. One repo with code, config, tooling and CI/CD. Ktor allows me to achieve this. In fact this website is written using Ktor. It has a familiar functional api like express, allowing easy extensibility, and readability

Kotlin Multi-Platform

Kotlin multiplatform is the base for end-to-end kotlin applications. I use it for almost all my applications, when i need a native application. When combined with Ktor and Kotlin compose, it provides the most complete toolset for building full stack applications. An example of this is my gym log book app, where the frontend is a desktop and a web application combined into one.

Rust

Rust is my current go to for projects that have well defined states. This is because of a number of it's features that focus on provable correctness.

As a systems language, it is fast. Rust compiles to machine code directly. So when compiled with optimisations, it is faster than the JVM, Python or other virtual machine languages. This also means that a lot of memory management is 'manual', but can be automatic when explicitly chosen. Overall it doesnt try to hide the inner workings of operations, whilst having an easy to understand std and core library.

As Rust has a focus on correctness it has an algebraic type system. This allows application states to be defined in such a way where invalid states can be entirely removed. For example, in Kotlin you have sealed classes. These allow a defined fixed known subset of types at compile time. Rust takes this concept further with its enum implementation. Overall these changes allow me to eliminate invalid states for my work, whilst forcing states from other frameworks to be transformed into valid states for my use.

Finally, The compiler (in general) is able to pinpoint where an error is, and often provides fixes where possible. This along with tools like clippy, allows correct and clean code (not the OOP clean).

Elixir

I don't use this language as much as I would like. However, I did want to mention it for some of the principles it follows.

First, let it crash. Most programming is done defensively, try statements, if guard blocks, etc. Elixir discards this mentality. The principle is, fail early, log the issue, reset the state to a fresh slate. This allows errors to be flagged quicker, and program state to be saved. This combined with the supervision model below allows errors to be rectified easier.

The second principle follows from the usage of "processes". These are green threads, and Erlang / Elixir uses them everywhere. The second principle is supervise and recover. A supervisor is a process that monitors child processes. When a child process dies, the supervisor is notified and decides what to do next. This gives 'let it crash' the ability to recover quickly, without taking the entire program down.

Because of these principles, and the Elixir language itself, I think it's worth mentioning. As its philosophy, whilst not mapping perfectly onto kotlin or rust, can be used to make decisions around architecture.

Hobbies

3D Printing

I've been using 3d printing to learn how to use cad software, taking measurements, and properly setup a 3d printer to make clean prints.

I've designed some of my own prints to help out with family and friends. these have been designed and printed to fix broken parts for tools. For instance, a new clip for some secateurs, new ends for tent poles, and stops for assistance wheels for my dog. I have a couple projects i'm looking into designing.

First is a 'small' pipe organ. I have created a tuned percussion instrument before and have understanding how wind instruments work. Using this i should be able to design the pipes and internal tubing to make a small working pipe organ. If this were to succeed, then mi could make multiple units with different voices, to create a slightly larger one, maybe even with stops.

Second project is an enclosure for my Bramble Pi project. The raspberry pis i'm currently using, standing on edge, with no support. Plus they do have a screen connected to the master control plane pi. So having an enclosure that can contain all of them in one place, alongside the screen would be nice and more reassuring.

Scouting

I've been a part of the scouts since being a beaver. During This i have had loads of different experiences through our weekly meetings, camps, and meeting others.

A lot of the skills revolve around team work, as well as more practical skills such as fire lighting, shelter making, pioneering, archery, and rifling.

I am now a leader of my group, planning sessions, and being tech support. Along with this i am the chairman of the group, ensuring everything is run smoothly behind the scenes.

Sports

I'm an avid swimmer, boulderer, cyclist, and gym goer. I find each of these serve a different purpose. Swimming is a mix of speed and stamina training, gym I do both cardio and weight training. And bouldering is body weight exercises, and dexterity.