How atharvaerror/ycce-repo- works
JalDrishti is a map-first community water and sanitation tracker. Residents submit reports through the web form or Telegram; the service triages and deduplicates them, stores issues, and derives hotspots and explainable repair priorities. Engineers act on the ranked queue with geofenced proof of repair, while citizens can confirm or reopen fixes. The product also gathers daily water-supply pulses and presents public maps, scorecards, and issue timelines. Relationships shown are limited to the README and source excerpts/index references; uninspected route and page wiring is not inferred.
Main entry points: service.ts Issue service · client.ts Web data client · engineer-console.tsx Fix-next console · store.ts Issue and pulse store
Components 28
Report intake
- Report form
src/app/report/report-form.tsx - Offline queue
src/lib/outbox.ts - Telegram bot
src/lib/telegram.ts - Issue API
src/app/api/issues/route.ts - Issue action API
src/app/api/issues/[id]/route.ts
Issue operations
- Issue service
src/lib/service.ts - Report triage
src/lib/triage.ts - Geospatial rules
src/lib/geo.ts - Place and asset data
src/lib/places.ts - Priority scoring
src/lib/priority.ts - Hotspot analysis
src/lib/hotspots.ts - Fix-next console
src/app/engineer/engineer-console.tsx - Issue timeline
src/app/issues/[id]/issue-detail.tsx
Maps and insights
- Supply pulse
src/components/pulse-card.tsx - Pulse API
src/app/api/pulse/route.ts - Interactive map
src/app/map/map-view.tsx - Zone dashboard
src/app/dashboard/dashboard.tsx - Stats API
src/app/api/stats/route.ts - Hotspots API
src/app/api/hotspots/route.ts
Web experience
- Web data client
src/lib/client.ts - Public home
src/app/home-view.tsx
Persistence and integrations
- Issue and pulse store
src/lib/store.ts - Demo issue seed
src/lib/seed.ts
Other components
- Resident
- Engineer
- Telegram API
- Supabase
- Local JSON store
Connections 40
- Resident → Report form: submits report
- Report form → Offline queue: queues offline
src/app/report/report-form.tsx - Report form → Issue API: posts report
src/app/report/report-form.tsx - Resident → Telegram bot: reports by bot
- Telegram bot → Telegram API: sends bot messages
src/lib/telegram.ts - Telegram bot → Issue service: creates and acts
src/lib/telegram.ts - Issue API → Issue service: routes requests
src/app/api/issues/route.ts - Issue service → Report triage: triages report
src/lib/service.ts - Issue service → Geospatial rules: checks distances
src/lib/service.ts - Issue service → Place and asset data: uses place data
src/lib/service.ts - Issue service → Priority scoring: scores issues
src/lib/service.ts - Issue service → Hotspot analysis: computes hotspots
src/lib/service.ts - Issue service → Issue and pulse store: reads and writes
src/lib/service.ts - Issue service → Telegram bot: notifies resolution
src/lib/service.ts - Engineer → Fix-next console: reviews queue
- Fix-next console → Web data client: loads issue data
src/app/engineer/engineer-console.tsx - Fix-next console → Issue action API: starts and resolves
- Issue action API → Issue service: dispatches actions
src/app/api/issues/[id]/route.ts - Resident → Issue timeline: tracks issue
- Issue timeline → Web data client: loads issue actions
src/app/issues/[id]/issue-detail.tsx - Web data client → Issue API: fetches issues
src/lib/client.ts - Web data client → Issue action API: sends actions
src/lib/client.ts - Resident → Supply pulse: taps supply status
- Supply pulse → Pulse API: posts pulse
src/components/pulse-card.tsx - Pulse API → Issue service: records pulse
src/app/api/pulse/route.ts - Fix-next console → Pulse API: views supply alerts
- Resident → Interactive map: explores reports
- Interactive map → Web data client: loads map data
src/app/map/map-view.tsx - Web data client → Hotspots API: fetches hotspots
src/lib/client.ts - Hotspots API → Issue service: requests hotspots
src/app/api/hotspots/route.ts - Resident → Zone dashboard: views scorecards
- Zone dashboard → Web data client: loads statistics
src/app/dashboard/dashboard.tsx - Web data client → Stats API: fetches stats
src/lib/client.ts - Stats API → Issue service: requests stats
src/app/api/stats/route.ts - Resident → Public home: views live overview
- Public home → Web data client: loads live data
src/app/home-view.tsx - Public home → Supply pulse: renders pulse
src/app/home-view.tsx - Issue and pulse store → Demo issue seed: initializes demo data
src/lib/store.ts - Issue and pulse store → Supabase: uses when configured
src/lib/store.ts - Issue and pulse store → Local JSON store: persists fallback
src/lib/store.ts