wmj 2549e9de0c feat: add Khairat, emergency-contact auto-notify, and 5 lifestyle-companion tabs
Big round covering two different asks: Khairat/emergency infrastructure
(tightly coupled to what's already built) and a Muslim-lifestyle
companion surface (a genuinely different product, added at the user's
explicit request after being offered a smaller scope).

Khairat & emergency contacts:
- nf_khairat_memberships (per-member scheme membership) + nf_emergency_fund
  (per-family shared reserve tracker) — records intent/contacts only,
  never holds or moves real money.
- nf_trusted_contacts gains category (mosque/police/ambulance/hospital/
  khairat/family/other) and email columns.
- New notify-emergency-contacts Edge Function, auto-invoked the moment a
  mutawalli fires a member's death trigger (the one place in this app
  where auto-send-on-trigger is actually correct), alongside — not
  instead of — the existing heir notification. Verified with a live fire
  end-to-end (e2e-emergency-notify.cjs, 5/5).

Lifestyle-companion tabs — all computed/searched live, nothing fabricated:
- Qibla: pure great-circle bearing math to the Kaaba from geolocation,
  no API/key. Verified against Kuala Lumpur (293°, matches expected ~292°).
- Prayer Times: client-side astronomical calculation (single-pass solar
  position, MWL angles), sanity-checked against known KL/London times
  before shipping.
- Locate: mosque/halal/cemetery search via the free, keyless OpenStreetMap
  Overpass API — real community-sourced results only, honest empty state
  when nothing's mapped nearby.
- Quran: Surah list + Arabic/translation via the free alquran.cloud API,
  fetched fresh each time, nothing stored in this app's own database.
- Neighbourhood: a join-by-code community announcement board — a
  genuinely separate multi-tenant concept from the estate-planning family
  structure, scoped to the user account. Found and fixed a real UX gap
  during testing: the create/join form was only reachable with zero
  existing neighbourhoods, with no way to join a second one.

Also found and fixed a real bug: the heir-notify and emergency-notify
status messages shared the same CSS class, breaking any script (including
the pre-existing e2e-per-member.cjs) that targeted '.notify-status'
without further filtering — gave each its own distinguishing class.

Covered by e2e-khairat-lifestyle.cjs (13/13) and e2e-emergency-notify.cjs
(5/5). Full regression: 316/316 across all suites (several transient
flakes under heavy mail-relay load during the sweep, all confirmed clean
on rerun — one led to the real class-collision fix above).
2026-08-14 14:25:26 +08:00

Nur Falah — Estate & Waqf Suite

Horizon 1 (Prevention Suite) + Horizon 2 (Unlock Programme, pre-pilot demo) from the Nur Falah PRDs, built as a standalone Svelte 5 + Vite PWA, styled to match the visual system of the live moslem03.falahos.my (Nur Falah Muslim Companion) app.

Modules

Module Horizon Status
Faraid Calculator 1 Shared calc core, 14 classical cases passing (src/lib/calc/faraid.test.js)
Asset Registry 1 Local-first, feeds every other module's estate total
Wassiyah Generator 1 1/3 meter, heir-exclusion block, jurisdiction-aware export
Hibah Tracker 1 Shared marad al-mawt guardrail
Family Waqf Designator 1 Built ahead of scholarly sign-off — see below
Digital Beneficial Claims 2 Pre-pilot demo only — see below

Important: two governance gates were overridden for this build

Per explicit product direction, this build proceeded past two gates stated in the project's own PRDs and review log:

  1. Family Waqf Designator (Horizon 1 PRD §8.5) is gated on scholarly sign-off. scholarly-review-log.md (in the digital-waqif docs repo) tracks OPEN-01 — whether a healthy-state waqf is subject to the one-third cap — as unresolved. This module ships anyway; the in-app copy states the open question rather than presenting invented certainty.
  2. Horizon 2 (Digital Beneficial Claims) PRD states: "No engineering work begins until Phase 0 (legal opinion + signed institutional partner agreement) is complete." No confirmation of Phase 0 completion was available. The Claims module ships as a local, non-custodial demonstration of the data model and transfer restriction only — no real legal wrapper, no institutional integration, no real claims issued. It carries a persistent in-app banner saying so.

Both are flagged here, in deploy/DEPLOY.md, and in the relevant module's source comments so this isn't silently presented as production-ready.

Development

npm install
npm run dev       # http://localhost:5173
npm run test      # classical faraid test suite
npm run build

Deploy

See deploy/DEPLOY.md. Target: moslem04.falahos.my.

S
Description
Nur Falah Horizon 1 Prevention Suite + Horizon 2 Unlock demo. Deploy target moslem04.falahos.my
Readme 1.1 MiB
Languages
Svelte 51.9%
JavaScript 47.9%
HTML 0.1%