How romeoxii/hedraios works
Hedraios is an offline-first journal and faith-tracking PWA. A user signs in by email code, then uses Today, Notes, Prayers, or Readings to create and review records; reading details have a dedicated route, and records can be exported as JSON. Domain hooks write to local IndexedDB first and coordinate background Supabase synchronization, including reconnect handling. The README documents PWA installation and offline-shell behavior, but the service-worker implementation is not identifiable from the supplied tree and excerpts, so it is not mapped. Some view-to-hook wiring is inferred from documented feature ownership.
Main entry points: App.tsx App Shell · db.ts IndexedDB · sync.ts Sync Engine · supabaseClient.ts Supabase Client
Components 21
Application
- App Shell
src/App.tsx - Theme Preference
src/hooks/useTheme.ts - Theme Toggle
src/components/ThemeToggle.tsx
Identity
- Email Code Gate
src/components/AuthGate.tsx - Session Provider
src/lib/auth.tsx - Auth Hook
src/hooks/useAuth.ts
Faith Tracking
- Today Timeline
src/components/Timeline.tsx - Journal Notes
src/components/Notes.tsx - Prayer Tracker
src/components/Prayers.tsx - Reading Log
src/components/Readings.tsx - Reading Detail
src/components/ReaderRoute.tsx - Entry Data Hook
src/hooks/useEntries.ts - Prayer Data Hook
src/hooks/usePrayers.ts - Reading Data Hook
src/hooks/useReadings.ts - Overview Stats
src/hooks/useStats.ts
Data and Sync
- Supabase Client
src/lib/supabaseClient.ts - IndexedDB
src/lib/db.ts - Sync Engine
src/lib/sync.ts - Supabase Backend
supabase/schema.sql - JSON Export
src/lib/export.ts
Other components
- User
Connections 28
- User → App Shell: uses
- App Shell → Email Code Gate: opens sign-in
- App Shell → Session Provider: provides session
- App Shell → Auth Hook: checks identity
- Email Code Gate → Supabase Client: verifies code
- Session Provider → Supabase Client: loads session
- App Shell → Today Timeline: routes Today
- App Shell → Journal Notes: routes Notes
- App Shell → Prayer Tracker: routes Prayers
- App Shell → Reading Log: routes Readings
- App Shell → Reading Detail: routes detail
- Journal Notes → Entry Data Hook: manages entries
- Prayer Tracker → Prayer Data Hook: manages prayers
- Reading Log → Reading Data Hook: manages readings
- Today Timeline → Overview Stats: shows overview
- Entry Data Hook → IndexedDB: reads and writes
- Entry Data Hook → Sync Engine: requests sync
- Prayer Data Hook → IndexedDB: reads and writes
- Prayer Data Hook → Sync Engine: requests sync
- Reading Data Hook → IndexedDB: reads and writes
- Reading Data Hook → Sync Engine: requests sync
- Sync Engine → IndexedDB: merges records
- Sync Engine → Supabase Client: transfers records
- Supabase Client → Supabase Backend: accesses backend
- Overview Stats → IndexedDB: counts records
- App Shell → JSON Export: builds download
- JSON Export → IndexedDB: reads records
- Theme Toggle → Theme Preference: toggles preference