Inspiration
In many towns and cities, the walk home from university is the most stressful part of a female student's day. Streets are dark, shortcuts are empty, and buses are late or don't come at all. Some girls skip evening classes because of it, and some leave school entirely. Every map app answers one question: "What is the fastest way?" Nobody was asking "What is the safest way?" We built SafeRoute to answer it.
What it does
SafeRoute is a mobile-first safety and smart-commute web app built only for verified female students. It has three core shields:
- AI Safe-Path Routing: Pick any start and destination. SafeRoute finds real walking routes and gives each one a safety score from 0 to 100. The score uses street lighting, crowd presence (open shops, bus stops) and anonymous community danger reports. At night, lighting counts more. Dark, quiet stretches are circled on the map, and Google Gemini explains each route's risk in plain words.
- Verified Commute Buddies: Students scan their student ID card. Gemini Vision reads it, with on-device OCR as a backup. Verified students are matched with others from the same university and neighbourhood who leave at the same time, and they meet at a well-lit public point.
- Voice-Activated Silent SOS: The user sets a secret phrase, like "It's really cold today." When the phone hears it, SafeRoute silently starts live GPS tracking and records audio, then alerts emergency contacts with a map link. There is no sound and no screen flash.
Extra protection: a hold-to-SOS button, a disguise screen that looks like a weather app, a fake incoming call, and a trip timer that raises an SOS automatically if the student doesn't check in on time.
How we built it
- Frontend: React 19 with TanStack Start and TanStack Router, TypeScript and Tailwind CSS v4. The landing page is bold and dark, and the app itself is designed for phones first.
- Maps and routing: Leaflet with OpenStreetMap tiles. OSRM gives us real walking routes. The Overpass API gives us street lamps, lit roads, shops, bus stops, police stations and hospitals near each route.
- Safety engine: Our own scoring engine samples each route every 40 m. For every point it checks for nearby light and nearby activity. Danger reports are weighted by type and lose half their weight every 7 days. The three scores are blended with weights that change between day, evening and night.
- AI: Google Gemini (gemini-3.8-flash) runs on the server. It writes the route risk summaries and reads ID cards. The API key never reaches the browser, and if Gemini fails the app falls back to a safe default.
- SOS: The Web Speech API listens for the secret phrase, MediaRecorder records real audio, and the Geolocation API tracks live position. Twilio sends silent SMS when it is set up. Otherwise the app gives one-tap SMS and WhatsApp messages.
- Privacy: Profiles, contacts and recordings are stored only on the student's phone. ID photos are never saved.
- Testing: 25 automated tests cover the safety engine, phrase matching, buddy matching and ID parsing.
Challenges we ran into
- False SOS alarms: A safety app that fires by accident is useless. We made the phrase match only as whole words and in full, required at least 3 words, and blocked common words like "help" or "stop."
- Scoring safety from open data: Map data has no "safety" field. We had to turn lamps, shops and reports into a score that is fair and easy to explain.
- Unreliable networks: A demo can't break on stage. Every live feature has an offline fallback, including built-in demo routes, demo GPS and on-device OCR.
- A blocked build tool: Our development PC's security policy blocked the normal build tool. We wrote a small local server that compiles the app in plain JavaScript so we could keep building and testing.
- Making SOS truly silent: A web page can't send an SMS by itself. We added a server-side Twilio path, with one-tap sending as the fallback.
Accomplishments that we're proud of
- A full working prototype covering all three features, plus onboarding, trip tracking and alert history
- Safety scores built from real OpenStreetMap data, not made-up numbers
- Real GPS and real audio recording in Silent SOS
- Interactive demos on the landing page that run the same code as the app
- A privacy-first design where personal data never leaves the phone
What we learned
- Safety design means designing against false alarms just as much as against danger.
- Open map data is rich enough to estimate street safety if you combine several signals.
- Browser APIs (speech, audio, GPS) can power a serious safety tool with no app store needed.
- Good fallbacks matter as much as good features.
What's next for SafeRoute
- Real-time buddy chat and push notifications
- Partnerships with universities to add campus security as a built-in contact
- A shared city-wide database of danger reports
- Native Android and iOS apps with background voice listening
- Report heatmaps so city officials can see where new street lights are needed
Built With
- gemini-api
- geolocation-api
- google-gemini
- leaflet.js
- mediarecorder-api
- node.js
- openstreetmap
- osrm
- overpass-api
- react
- tailwindcss
- tanstack-router
- tanstack-start
- tesseract.js
- twilio
- typescript
- vitest
- web-speech-api
- zod