One calculation, two languages
How Athar keeps its Java calculation core and the TypeScript port in the browser from ever drifting apart.
Calculating prayer times locally only helps if the result is right. And as soon as the same calculation exists twice, it will eventually disagree with itself. One fix lands in one place and not in the other, and nobody notices until someone's Fajr is four minutes off.
One source of truth
Athar's calculations live in one library: athan-core, written in Java and published on Maven Central (org.openathar:athan-core). It covers prayer times as a port of the PrayTimes.org method, the Qibla bearing and Hijri conversion following the Umm al-Qura calendar.
The public API uses exactly this library, pulled from Maven Central like any other dependency. It does not contain a second copy of the mathematics.
A port that has to prove itself
The browser cannot run Java, so the website uses a TypeScript port of the same core. A port is a promise, and promises drift. So the port is held to the Java results: the reference values from the Java test suite are checked against the TypeScript implementation on every build.
If the two ever disagree, the build fails before anything reaches the website. The rule in the project is short: never implement a calculation a second time without a reference test that ties it to the core.
Why this matters beyond Athar
Both libraries are open source. If you build a mosque display, a school timetable or your own app, you do not have to start from a blog post and a formula. You can take the core, run the same tests, and know that your numbers match ours.