How I shipped a Nadi (BNN) astrology calculator as one 200 KB HTML file
Description and use
An offline, single‑file Nadi astrology calculator that runs from disk on a phone, using an inlined Astronomy Engine and a fixed UTC offset.
Problem
Deliver a Vedic astrology tool that runs offline from a single HTML file on a phone, without any build step, npm, server, or network calls.
Outcome
A fully offline, single‑file Nadi astrology calculator that runs on a phone without internet, with a final size of 206 KB.
Workflow
- 1. Inline the Astronomy Engine UMD bundle into the HTML, ensuring the Closure runtime shim ($jscomp) is included by starting the slice at byte 0.
- 2. Replace the external ephemeris and timezone APIs with local data and a fixed UTC offset selectable by the user.
- 3. Implement Nadi bond calculation by grouping planets by sign and determining leading planets based on degree order.
- 4. Compute slow‑planet progression by assigning years per sign for each planet and handling retrograde motion with fractional transitions.
- 5. Concatenate the engine and UI code into one file, test the inlined bundle in isolation, and host the final file on GitHub Pages.
- 6. Publish the source on GitHub under an MIT license for reuse.
Evidence
The tool had to run from a single file, opened straight from disk, on a phone, with no internet.
Astronomy Engine ships as a UMD bundle. Dropping it into a <script> tag works — it detects the absence of module and define and assigns itself to window.Astronomy.
ReferenceError: $jscomp is not defined
The timezone database. A real tz database is large, and historical offsets for India alone are messy. I replaced it with a fixed UTC offset the user selects.
The whole thing is 206 KB and works on a plane.
- Record date: 2026-10-20T14:42:48.124Z