How sharuuuuuhh/thirakk works
Thirakku is a bilingual commuter prototype for viewing recent crowd reports on train routes and submitting reports of their own. The main workflow is route and train selection, retrieval of recent reports, and display of crowd levels; signed-in users can submit reports with a station proximity check. Other branches cover authentication, station/train lookup, contribution history, petitions, and local-only camera interaction. Source excerpts show key API and service relationships; README statements support the broader product flows. Unsampled page wiring is not inferred.
Main entry points: route.ts Crowd API · supabase-admin.ts Admin client · page.tsx Route explorer · auth-context.tsx Auth provider
Components 26
Commuter experience
- Route explorer
app/app/explore/page.tsx - Route picker
app/components/RoutePicker.tsx - Station search
app/components/StationSearch.tsx - Station lookup
app/app/api/stations/route.ts - Train lookup
app/app/api/trains/route.ts - Crowd map
app/components/LiveCrowdMap.tsx - Stretch details
app/components/StretchDetailsCard.tsx - Local camera
app/app/camera-lookahead/page.tsx
Identity
- Sign-in pages
app/app/auth/login/page.tsx - Auth provider
app/lib/auth-context.tsx - Safe redirect
app/lib/auth-redirect.ts - Browser client
app/lib/supabase.ts - Reporter auth
app/lib/server-auth.ts
Crowd reporting
- Report form
app/app/report/page.tsx - Crowd API
app/app/api/crowd/route.ts - Crowd calculations
app/lib/crowd-service.ts - Railway data
app/lib/data/india-railways-data.ts - Admin client
app/lib/supabase-admin.ts - Supabase database
- Rail data seeding
app/app/api/seed-india/route.ts
Community features
- Contribution history
app/app/contributions/page.tsx - Contribution API
app/app/api/contributions/route.ts - Petitions
app/app/petitions/page.tsx - Petition impact API
app/app/api/impact/route.ts
Other components
- Commuter
- OpenStreetMap tiles
Connections 31
- Commuter → Route explorer: explores routes
- Route explorer → Crowd API: loads crowd levels
- Commuter → Report form: submits report
- Report form → Crowd API: posts report
- Commuter → Sign-in pages: signs in
- Sign-in pages → Auth provider: uses auth
app/lib/auth-context.tsx - Auth provider → Browser client: uses client
app/lib/auth-context.tsx - Auth provider → Safe redirect: validates destination
app/lib/auth-context.tsx - Route explorer → Route picker: selects route
- Route picker → Station search: selects stations
- Station search → Station lookup: queries stations
- Station lookup → Railway data: filters stations
app/app/api/stations/route.ts - Train lookup → Railway data: filters trains
app/app/api/trains/route.ts - Train lookup → Crowd calculations: computes stretches
app/app/api/trains/route.ts - Crowd API → Crowd calculations: computes stretches
app/app/api/crowd/route.ts - Crowd API → Admin client: queries and writes
app/app/api/crowd/route.ts - Crowd API → Reporter auth: authenticates reporter
app/app/api/crowd/route.ts - Admin client → Supabase database: accesses data
- Crowd map → OpenStreetMap tiles: renders map tiles
- Crowd map → Stretch details: shows stretch detail
- Commuter → Local camera: opens camera
- Commuter → Contribution history: views history
- Contribution history → Contribution API: loads history
- Contribution API → Reporter auth: authenticates reporter
app/app/api/contributions/route.ts - Contribution API → Admin client: reads reports
app/app/api/contributions/route.ts - Commuter → Petitions: views petition
- Petitions → Petition impact API: loads petition status
- Petition impact API → Reporter auth: authenticates signer
app/app/api/impact/route.ts - Petition impact API → Admin client: reads and writes signatures
app/app/api/impact/route.ts - Rail data seeding → Railway data: loads seed records
app/app/api/seed-india/route.ts - Rail data seeding → Admin client: upserts rail records
app/app/api/seed-india/route.ts