Skip to content

Repository files navigation

Ashtanga Moon

A tiny PWA that shows the current moon phase and the next new and full moon. New and full moon days are used in Ashtanga Vinyasa Yoga for taking rest and fasting.

The phase is the same everywhere on Earth at a given moment, so the app needs no location and no internet - everything is computed on your device. Phase times use the standard astronomical algorithm (Meeus, Astronomical Algorithms, ch. 49).

Check it out

Also available as Chrome extensions: MoonBar & MoonTab.

This project supersedes its previous Solid.js + Firebase version and the original vanilla JS version.

Stack

  • Vite + TypeScript
  • vite-plugin-pwa + Workbox (installable, offline, auto-updating service worker)
  • Static hosting on Firebase Hosting, deployed from GitHub Actions

No frontend framework, no runtime dependencies in the bundle.

Install

pnpm i

Develop

pnpm dev

Service worker is disabled in dev (PWA_DISABLE=true) so it doesn't interfere with HMR.

Build

pnpm build

Outputs to dist/: index.html, hashed assets/*.js, sw.js, manifest.webmanifest, and the icons under img/.

Preview the production build

pnpm preview

Open the URL it prints, then DevTools -> Application -> Service Workers to confirm sw.js is registered.

Deploy

Pushes to main deploy automatically to Firebase Hosting via .github/workflows/firebase-deploy.yml (requires the FIREBASE_SERVICE_ACCOUNT repo secret).

Manual deploy:

pnpm deploy