Android app (Expo / React Native) for experiencing solar eclipses: exact contact times at your location, a map with the path of totality, local alerts, and a full-screen eclipse mode that tells you when to put your glasses on and take them off.
First target: the total solar eclipse of August 12, 2026 (northern and central Spain). Status: stable, distributed as a direct APK (no Play Store).
- 100% local computation with astronomy-engine: C1–C4 contacts, maximum, obscuration, totality duration and sunset for any coordinate. No backend.
- Real map (embedded Leaflet + Carto tiles) framed on the stretch of the path around your spot, with a button to recenter on your GPS position. Tapping a point shows its circumstances and lets you set it as your observation spot.
- Nearest totality: if your spot is outside the path — distance, bearing and duration at the destination (bisection over 8 bearings, capped at 700 km).
- Local alerts (
expo-notifications, no network): exact notification per contact, optional early warning, 24 h/1 h reminders, and an "after sunset" mark on contacts with no sun. Custom or system sound. - Eclipse mode: automatic event screen during the eclipse window (countdown, phase, GLASSES ON/OFF banner, screen always on). Includes a one-tap drill (~2 min, no settings) to rehearse with real notifications.
- Cloud cover at maximum time via Open-Meteo (ECMWF model, the same one Windy paints — the chip links there), with offline cache per day and coordinate.
- Multi-eclipse browser (its own tab): upcoming eclipses ~8 years ahead and a paginated archive ~25 years back, all engine-generated on device; the catalog (bundled + Remote Config) curates labels and paths on top. Each eclipse keeps its own spot and alerts. Picking a past one opens it in archive mode: that day's map, path, local times and actual cloud cover (Open-Meteo ERA5 archive), with alerts off.
- Eclipses from here: from the map sheet, every eclipse visible from your spot (past and future) with its local obscuration — tap one to jump to it keeping the spot.
- Bilingual es/en: language follows the system (Spanish → es, everything else → en) or can be forced in Settings. Notification texts are baked in the active language when scheduled.
| Feature | Offline |
|---|---|
| Times, phases, alerts, drill | ✅ fully local |
| Path on the real map (data) | ✅ bundled or previously activated RC |
| Real map tiles | ❌ (gray background; path and markers still render) |
| Clouds | ✅ last download cached (· Xh mark) |
| Place search / geocoder | ❌ (falls back to coordinates) |
| Remote Config | ✅ last activated values persist |
App.tsx Root state: active eclipse, permissions, RC, drill, tabs
lib/
eclipse.ts Local circumstances (memoized) — NO react-native imports
eclipseCatalog.ts Catalog (bundled + RC + auto-generated), active eclipse
totality.ts Nearest totality, haversine, bearings
bandGeo.ts Bundled path pack, whole browsable window (scripts/genBandPack.ts)
spotEclipses.ts Eclipses visible from one spot (local engine sweep)
notifications.ts Local alerts (serialized queue, Android channels)
weather.ts Open-Meteo ECMWF + AsyncStorage cache
prefs.ts Persisted preferences, per-eclipse context
firebase.ts Remote Config + Analytics + Crashlytics (best-effort)
drill.ts Synthetic eclipse for the drill (fixed minimum legs)
i18n.ts t(), LANGS/LANG_META; dictionaries in locales/*.json
spots.ts Spot/SpotOption types
maps.ts / anim.ts / soundPreview.ts / eclipseSound.ts / leafletVendor.ts
locales/
es.json / en.json Translations (flat JSON; see "Adding a language")
hooks/
useGeo.ts One-shot GPS + reverse geocoder
usePrefs.ts Loads/saves prefs, resolves language
useSheet.ts Draggable bottom sheet
useSpotData.ts Clouds + nearest totality + GPS point for the spot
useApkUpdate.ts In-app update flow (permission → download → install)
modules/
eclipsum-updater/ Local Expo module (Kotlin): downloads the APK, checks its sha256, installs it with PackageInstaller
plugins/
withoutBarcodeModels.js Leaves expo-camera's unused ML Kit barcode models out of the APK
components/
screens/ MapScreen, EclipsesScreen, AlertsScreen, SettingsScreen, EclipseModeScreen
map/ Visual map pieces (CompassChip, HorizonDiagram, …)
RealMap.tsx Leaflet WebView (vendored in lib/leafletVendor.ts, no CDN)
SpotSelector.tsx Spot modal: search, frequent spots, RC suggestions, batched clouds
SpotEclipses.tsx "Eclipses from here" modal (past + upcoming from the spot)
Countdown.tsx / TabBar.tsx / theme.ts
scripts/
selfcheck.ts Engine and catalog asserts in Node (CI gate)
genEclipse.ts Generates catalog entries (--write merges into RC template)
genBandPack.ts Bundles paths for the whole browsable window → lib/bandGeo.ts
genBand.ts One bundled path by id (manual/regional ranges)
syncBands.ts Generates missing paths in the RC template
bandWalk.ts Shared path walker (used by genBandPack and syncBands)
dev.sh / mensaje.sh Emulator with simulated GPS / quick RC banner
Constraint: lib/{eclipse,totality,spots,prefs,weather,eclipseCatalog}.ts must stay free of react-native imports — npm run selfcheck runs them in Node (AsyncStorage is allowed: its CJS entry loads in Node and the native module is deferred).
Module and flow details: docs/ARCHITECTURE.md
npm install
npm run dev # expo start (scripts/dev.sh)
npm run typecheck # tsc --noEmit
npm run selfcheck # engine/catalog/prefs asserts in NodeBuild requirements: google-services.json from the Firebase project in the repo root (the one in the repo points to the original project; for a fork, use your own Firebase project's) and Android Studio (its embedded JDK is used; no system JDK needed).
Deployment lives in GitHub Actions (.github/workflows/release-apk.yml): when a new expo.android.versionCode lands on main, it builds the APK (gated by selfcheck + typecheck), creates the GitHub Release b<versionCode> and publishes latest_version_code + latest_apk_url + latest_apk_sha256 to Remote Config so the app announces the update. Then it calls Jenkins (Jenkinsfile.cdn, generic webhook, secret JENKINS_CDN_TOKEN), which downloads that release's APK, checks its sha256 and copies it to the CDN with publicarCdn (shared library jenkins-lib): https://cdn.jlh.app/eclipsum/latest.json (stable) or beta.json, {"android": {version, versionCode, url, sha256}}.
- Deploying =
npm run release(ornpm run release -- <vc>for an explicit versionCode): bumpsexpo.android.versionCode, commitschore(release): build Nand pushes to main. Pushing code without a bump publishes nothing (the guard sees the release already exists). - Build identity =
android.versionCode(monotonic, never decreases). There is no separate semver:expo.versionis derived from it byrelease.sh(b<vc>stable,b<vc>-betabeta) and never edited by hand. - Beta before stable:
npm run beta— same pipeline, but the release is marked pre-release (the-betasuffix is what the workflow detects) and regular users are not notified. Download it from the release page, test, thennpm run releasepromotes a stable. - Local test APK (nothing published):
npm run apk, ornpm run devfor the emulator + Metro loop. - Stable download URL:
https://github.com/jlopez994/eclipsum/releases/latest/download/eclipsum.apk— the asset always has the same name, the URL never changes. - Store-less, in-app updates: when the app starts and from Settings → Check for updates it reads the CDN manifests (
lib/cdnUpdate.ts) and RC with no cache (5 min when it comes back to the foreground), takes the newest versionCode above its own (on a tie the CDN wins; if the CDN is down or lags, the GitHub copy announced by RC) and shows an update banner, ahead of the RC message. "Install" downloads that APK inside the app (if the CDN download fails, the same build from GitHub), checks its sha256 and hands it to Android'sPackageInstaller(local modulemodules/eclipsum-updater). The first time Android asks to allow installs from Eclipsum (the banner opens that screen) and to confirm; after that, updates install with no browser or file manager. Android only installs over the app if the APK carries the same signature (the RN template's debug keystore, identical on CI and locally); which APK gets offered is decided by the CDN manifests (written only byJenkinsfile.cdn) and Remote Config (URL + sha256, written only byrelease-apk.yml). Without a sha256 in RC there is no banner: builds published before this mechanism keep the old browser banner until they update once. - Testing the update locally (nothing published): see "Testing the in-app update" below.
- Local build (no publishing):
npm run apk→android/app/build/outputs/apk/release/app-release.apk. - Workflow secrets:
GOOGLE_SERVICES_JSON(file contents) andFIREBASE_SERVICE_ACCOUNT(shared with sync-remote-config).
Locally, without touching Remote Config (a debug build allows http):
- Build the "new" APK: set
expo.android.versionCodeto N+1 inapp.json(don't commit it),npm run apk, copyandroid/app/build/outputs/apk/release/app-release.apkto a folder, note itsshasum -a 256and putapp.jsonback. - Serve it:
python3 -m http.server 8765 --bind 127.0.0.1in that folder (the emulator reaches it as10.0.2.2). - In
hooks/useRemoteExtras.ts, temporarily replaceupdate: updateFor(…)withupdate: { url: 'http://10.0.2.2:8765/app-release.apk', sha256: '<hash>' }, thennpm run dev. - In the app: banner → Install → Open settings (allow installs from Eclipsum) → back → Install → Android's "Update this app?" → the app closes and
adb shell dumpsys package com.jlopez.eclipsum | grep versionCodeshows N+1. A wrong hash must end in "Couldn't download the update"; cancelling the Android dialog, in "Android cancelled the installation".
For real: publish a beta with this code (npm run beta), install it on the phone with betas too in Settings, publish the next beta and the banner installs it in-app.
| Parameter | Purpose |
|---|---|
eclipse_message |
Top banner; empty = hidden |
active_eclipse_id |
Forces the active eclipse; empty = the nearest |
eclipse_catalog |
JSON of extra eclipses (with optional band path) without a release. Safety net: serves paths to old builds and to installs whose bundled window has rolled past |
glasses_url |
ISO 12312-2 glasses affiliate; empty = button hidden |
sponsor |
{"name","url","tagline"?} sponsor of the active eclipse |
latest_version_code / latest_apk_url / latest_apk_sha256 |
In-app update, stable channel. The URL points at the asset of that release's own tag (releases/download/b<vc>/eclipsum.apk), so a later release can't change the file under a published sha256 |
latest_beta_version_code / latest_beta_apk_url / latest_beta_apk_sha256 |
Same for the beta channel. Only read by users who picked "betas too" in Settings |
suggested_spots |
[{"name","lat","lon"}] spots (max 6) for the picker; only those inside the active eclipse's band are shown, [] hides the section. Regenerated monthly by genSpots.ts — hand edits are overwritten |
Parameter descriptions: max 256 characters (RC limit).
.github/workflows/sync-remote-config.yml (monthly + manual): genEclipse --write → syncBands → genSpots --write → selfcheck as gate → publishes RC with the service account (FIREBASE_SERVICE_ACCOUNT, Firebase Remote Config Admin role = roles/cloudconfig.admin) → auto-commits the template. New eclipses reach the app without touching code or publishing an APK. genSpots.ts also refreshes suggested_spots for whatever eclipse is active: cities inside its path (GeoNames cities15000, downloaded per run), engine-verified one by one, Spanish-speaking countries first, then by population, spread ≥100 km apart. No date to watch — the active eclipse rolls forward on its own, so the picker is never left with the previous eclipse's spots.
Manual curation (optional, the workflow does the same on its own): npx tsx scripts/genEclipse.ts --kind total --write merges entries into the template (dedupe by civil day), npx tsx scripts/syncBands.ts fills in missing RC paths, and npx firebase-tools deploy --only remoteconfig publishes.
Bundled path pack (offline on first run, zero maintenance): npx tsx scripts/genBandPack.ts regenerates lib/bandGeo.ts with every total/annular path in the browsable window (~25 years back + ~8 ahead, ~50 paths ≈ 240 KB). Incremental — already-bundled paths are kept, only missing ones are computed (history never changes). Partials have no central path by nature. genBand.ts --id <id> remains for one-off regional ranges. This route ships with the APK, so it requires a release; RC covers the gap for builds that never update.
Translations are flat JSON in locales/ (one key per text, {var} interpolation) and contributions are welcome — translating requires no programming:
- Copy
locales/en.jsontolocales/<code>.json(e.g.fr.json) and translate the values (keys and{var}placeholders stay untouched). Abbreviated months are themonth.0–month.11keys. - In
lib/i18n.ts: add the code toLANGS, its entry inLANG_META(endonym, BCP-47 tag, decimal separator) and import/register the JSON inDICTS. The compiler enforces all three. npm run selfcheckverifies key parity againstes— a missing key fails with its name.
The Settings selector is generated from LANGS; no UI changes needed. Useful context for translating: ALL-CAPS texts are compact UI labels; notif.* are notifications read without the app open; C1–C4/MAX are the eclipse contacts (standard jargon). The format is directly compatible with translation platforms (Crowdin, Weblate, Tolgee) if ever needed.
The app announces the exact moments, but the rule is one: never look at the sun without ISO 12312-2 certified glasses, except during totality. IGN safety guide linked in Settings.