Keeping track of Salat Times - on your mac!
Muslims are expected to pray 5 times a day. The times for the start of each prayer depend on the angle of the sun relative to where you life. So these are constantly changing depending on the the location and time of the day1.
Before smart phones, people would have calendars on their fridges with prayer times. You'd have a general idea of what those timings were and you'd regularly scan these if you remembered to update your estimates.
Once smart phones became ubiquitous, everyone had apps that would help them keep tabs on what these timings were. There are literally hundreds of apps out there that do this2. Personally, I use an app called Pillars which, unlike the other apps, is completely ad-free, and is focused on absolutely no data-tracking whatsoever.
But, I spend most of my day in front of my laptop. And I've worked fairly hard to break my dependency on my smartphone (see Addiction to my phone). I needed a solution for me to help me keep track of these times on my mac, so I built a simple little solution for myself.
It took me about a week to build on-and-off. But over 2 years to release it.
When I was on my paternity leave, I got some time to build this out as a way to not only solve this problem, but also learn Swift UI. I was inspired by the simplicity of the ItsyCal menubar app, which I use every day to track my calendar. It's such a simple elegant solution and I wanted to build just that.
The features are simple:
- for a given location, fetch the salat times (I used AlAthan, but honestly, I could have just built a calculation library based on 1)
- display it in a simple way
Given that, the actual app logic was really easy to build. The hard parts were:
- Publishing: Apple does not make this easy. I can build apps for my computer, but I can't distribute them. I really wanted to build this solution for my personal macbook and my work one. And as a bonus, I wanted to give away this solution to all. The outcome of this was to register a developer account ($99/year, really, Apple?), and submit it for notarization before distribution so that all macs know that it's been verified by Apple.
- Figuring out how to get automatic updates working - Once distributed, I needed to make sure that further bug-fixes or features could be automatically installed for all users. I wanted to distribute this app via Github (honestly, I think I might be okay just going via the app store now), and if there were any severe errors, I wanted users to not have to re-download updates. There's a popular open source solution to do this (https://sparkle-project.org/) but it wasn't trivial to set up. Essentially, it relies on an RSS feed to compare semver versions, and download and replace the existing installation on a user's machine. The library handles lots of logic like how to check, how often to check, how to update etc.
But now that it's all set up, I announced it in a few places and it's been really fun seeing the appreciation and love for it :).
Also, now that I have an apple developer account for the year, I should think about building some iOS or other mac apps :)
1 - More details on how these are calculated here. 2 - Muslim Pro, Athan, Pillars are some of the popular apps out there.