Ride Radar

Tagline: Check your ride in one tap: location and route ratings based on reported transit incidents in Hyderabad.


Inspiration

Women traveling alone at night in autos or cabs usually have to rely on gut feeling. News reports about harassment and unsafe spots exist, but nobody can look up articles while standing on the road waiting for a ride. We wanted to build a simple tool where someone can tap one button and check an area or route in ten seconds before getting in.


What it does

Ride Radar checks your location and the time of day, returning a Green, Amber, or Red rating:

  • One-tap check (/): Scores your current spot within 1 km for the current hour and links directly to the news sources behind the score. Green means "No reported incidents nearby", never "safe".
  • Time and area alternatives: Shows a 24-hour strip of the area, tells you when the score drops, and points to the nearest lower-risk spot within 5 km.
  • Route check (/route): Pulls road paths from OSRM, evaluates every 500 meters, and colors route segments green, amber, or red.
  • SMS backup (/sms, /sim-sms): Send RADAR <Area> <Time> to get a reply under 160 characters when you have no mobile data.
  • Trip sharing (/trip/{token}): Generates a 3-hour live location link that updates every 10 seconds.
  • SOS button (/sos): Hold to stream video and GPS. Has a cancel PIN and a secret duress PIN. If the phone shuts down or disconnects for 30 seconds, the server sends the alert anyway.
  • Authority dashboard (/dashboard): Maps clusters, highlights peak 3-hour windows, and lets local authorities log actions (patrols, lighting, CCTV) to mark areas addressed until a new incident occurs.

How the risk score works

Every incident within 1 km is weighted using source, recency, and time of day:

$$w = \text{source} \times \text{recency} \times \text{hour match}$$

  • Source: News counts $1.0$, direct reports count $0.6$.
  • Recency: Weight halves every 180 days: $$\text{recency} = (0.5)^{\frac{\text{days}}{180}}$$
  • Hour match: If the incident happened within $\pm 2$ hours of now (wrapping around midnight), it counts $1.0$. Otherwise, it counts $0.4$.

The total score sums all incident weights within 1 km:

$$\text{Risk Score} = \sum_{i \in \text{nearby}} w_i$$

  • Green: $< 2.0$
  • Amber: $2.0 \text{ to } 5.0$
  • Red: $> 5.0$

If no covered area is within 5 km, it returns "Not covered yet" and gives no score.


How we built it

  • Backend: Python with FastAPI and SQLite. The scoring logic in risk.py is written in pure Python with no external dependencies so it runs instantly.
  • Frontend: Plain HTML, CSS, and vanilla JavaScript with Leaflet maps. A Service Worker (sw.js) caches the app and the last score for offline use.
  • Routing: OSRM for road geometry and Photon for address search. If OSRM fails, it falls back to a straight-line route at 20 km/h.
  • Incident extractor: A Python script (scripts/extract_incident.py) using Groq's free tier (openai/gpt-oss-120b) to convert raw news articles into clean JSON, with a local regex and gazetteer fallback.
  • Deployment: Packaged using Docker to keep setup simple.

Challenges we ran into

  • Getting data without high API costs: News sites do not have structured APIs. Scraping and calling paid LLM APIs repeatedly was too expensive, so we used Groq's free tier with a strict JSON schema.
  • Real data is thin: We collected 30 real news reports for Hyderabad. Because of the 180-day half-life decay, older cases carry almost zero weight, making every spot green. We created 46 synthetic sample incidents so we could test amber and red states, and put a clear SAMPLE DATA badge on any result they touch so nobody is misled.
  • Vague locations: News articles often say "near Madhapur" or "late night" instead of exact coordinates or times. We mapped them to area center points and defaulted unstated hours to 21:00.
  • Browser limits on 112 calls: Web apps cannot automatically place phone calls. We put clear one-tap call buttons instead.

Accomplishments that we're proud of

  • The app never lies to the user: it never says "safe" and clearly marks sample data with visible badges.
  • The SMS fallback works on basic phones without an active data plan.
  • The SOS alert still sends if the phone is taken or switched off mid-stream.
  • 15 automated tests covering the risk engine and SMS parser.

What we learned

  • How to containerize a Python and SQLite app with Docker.
  • How JavaScript handles offline service workers and geolocation fallbacks.
  • Why vector SVGs are better than PNGs for crisp map markers on mobile screens without pixelation.
  • How to write clear, honest documentation without exaggerating what an app can actually do.

What's next for Ride Radar

  • Letting women submit direct incident reports so we do not rely only on news articles.
  • Self-hosting OSRM so rider coordinates stay private.
  • Adding more cities like Bengaluru and Delhi.
  • Working toward direct adoption of the authority dashboard by local patrol units.

Built With

Share this project:

Updates

Submission history