blog.iankulin.com

Json

JSONata in Uptime Kuma

After a BOINC workload change pushed a homelab container’s memory usage past its monitoring threshold, I switched from keyword-based checks in Uptime Kuma to its JSON query feature, which applies JSONata expressions to fetched JSON metrics. I walk through the setup, and show a conditional query combining memory and CPU values...

Fly.io, Uptime Kuma & scraping a status page

Because my Uptime Kuma monitoring instance runs on a home network sharing the same flaky 4G connection as the VPS sites it watches, I consider Uptime Robot before deploying a second instance on Fly.io’s free tier. Setting it up as a Docker container proves simple, and to fold the remote status back into my local instance I discover Uptime Kuma already exposes an SVG status badge usable with keyword monitoring, avoiding a custom scraping endpoint...

Codable when the keys don't match

How to decode JSON in Swift when the key names don’t match your struct’s property names. I cover using a CodingKeys enum to map JSON keys to properties manually, and the simpler keyDecodingStrategy option for handling the common snake_case versus camelCase mismatch...

Updating stored JSON due to a struct change

A short walkthrough of migrating persisted app data in a Swift app after changing a Codable struct: I copy the old struct under a versioned name, and init() attempts to decode saved JSON with the new model first, falling back to the old one and converting items across. I note the migration code is deliberately messy and temporary, since the app only exists on my phone and a couple of simulators...

JSON encode/decode

Progress on my SwiftUI habit tracking app built for the 100 Days challenge, covering UI refinements like a fading checkmark and the shift from simulator testing to daily use on a real iPhone. Persistence uses Swift’s built-in JSON encoding with UserDefaults, which works well until the struct changes — I discuss the resulting decode failures and the lack of a simple way to decode missing properties using default values...