How surajrana-git/himrakshak works
Himrakshak is a Himalayan road-disaster safety web app, also installable as a PWA and Android app. The main journey is to view live road risk, plan a route that weighs landslide risk and closures, then navigate with hazard alerts; travellers can also report conditions and consult local services. The graph includes documented offline maps, community events, SOS, and saved routes. Evidence is limited to the README and the sampled/indexed files; links for unsampled capabilities are dashed where their wiring is not shown.
Main entry points: routes.ts Risk-scored routes · app/page.tsx Live risk view · events/page.tsx Community events · trip.ts Trip navigation
Components 22
Traveller experience
- Live risk view
app/page.tsx - Risk map UI
components/RiskView.tsx - Trip navigation
lib/trip.ts
Risk and routing
- Routes API
app/api/routes/route.ts - Risk-scored routes
lib/routes.ts - Road routing
lib/valhalla.ts - Terrain risk
lib/terrain.ts - Risk scoring
lib/risk.ts - Rain data
lib/weather.ts
Community reports
- Driver reports
lib/reports.ts - Community contributions
lib/contributions.ts - Report and place form
components/ContributionForm.tsx - Community events
app/events/page.tsx
Local services
- SOS support
lib/sos.ts - Hotel search
app/hotels/page.tsx - Hotel lookup API
app/api/hotels/route.ts
Persistence and offline
- Authentication
lib/auth.ts - Saved routes
lib/saved-routes.ts - Supabase
lib/supabase.ts - Offline maps
lib/offline-maps.ts - Offline caching
public/sw.js
Other components
- Traveller
Connections 24
- Traveller → Live risk view: opens app
- Live risk view → Rain data: loads rain
app/page.tsx - Live risk view → Terrain risk: measures terrain
app/page.tsx - Live risk view → Risk map UI: renders risk
app/page.tsx - Routes API → Risk-scored routes: requests options
app/api/routes/route.ts - Risk-scored routes → Road routing: requests roads
lib/routes.ts - Risk-scored routes → Rain data: gets rain
lib/routes.ts - Risk-scored routes → Terrain risk: scores terrain
lib/routes.ts - Risk-scored routes → Risk scoring: scores stretches
lib/routes.ts - Trip navigation → Risk-scored routes: uses route types
lib/trip.ts - Trip navigation → Road routing: uses route types
lib/trip.ts - Report and place form → Community contributions: submits entries
components/ContributionForm.tsx - Community events → Community contributions: lists entries
app/events/page.tsx - Community events → Driver reports: lists reports
app/events/page.tsx - Hotel search → Hotel lookup API: searches hotels
app/hotels/page.tsx - Hotel search → SOS support: gets GPS
app/hotels/page.tsx - Authentication → Supabase: uses client
lib/auth.ts - Saved routes → Supabase: reads and writes
lib/saved-routes.ts - Live risk view → Offline maps: offers offline maps
- Offline caching → Offline maps: caches map data
- Traveller → Community events: browses events
- Traveller → Report and place form: submits reports
- Traveller → SOS support: requests SOS
- Traveller → Saved routes: saves routes