Inspiration
A tourist gets into a car accident in Dhaka. They're bleeding, disoriented, and have no idea what number to call — because 911 doesn't work here. A foreign student in Seoul witnesses a violent crime but freezes because they don't speak Korean and don't know if they should call 112 or 119. A traveler in Istanbul realizes they're being followed, and by the time they've Googled "Turkey emergency number," it's too late. A 58-year-old mother in Chittagong who has never downloaded an app, receives an SOS email from her daughter abroad. She clicks a link in an email and sees exactly where her daughter is. A traveler in Nairobi runs out of prescription medication with no idea where the nearest pharmacy is. SafeNow finds it in seconds.That's it. That's the feature — and it only works if there's zero friction between the alert and the information.
These aren't edge cases. They happen every day to people in unfamiliar places who had no preparation and no tool built for that exact moment of panic. We built SafeNow because in a real emergency, a few seconds is the difference between life and death — and most people lose those seconds to confusion, language barriers, and apps that weren't designed for panic.
What It Does
SafeNow is a mobile-first emergency web app built specifically for people in unfamiliar places — travelers, expats, foreign students, and anyone who finds themselves in danger without local knowledge.
Instant Local Emergency Numbers
The moment you open SafeNow, it detects your country via GPS and shows you the correct local emergency numbers — police, ambulance, fire — with one-tap calling. No searching. No reading. If you're in Bangladesh, you see 999 and 199. If you're in Japan, you see 110 and 119. Every number is a single tap from danger to help, for 190+ countries.
AI Triage — Know What Kind of Help You Need
This is one of our most distinct features. Before you even send a message, SafeNow's triage engine runs in two layers: an instant synchronous pattern scanner that fires on every keystroke for obvious emergencies, and a semantic AI layer that understands natural language phrasing — so 'someone is following me home' triggers police routing just as reliably as 'being followed.' The severity badge appears before the user finishes typing. A "want to die" message triggers the mental health crisis protocol. Each triage result shows a severity badge — Critical, Urgent, or Normal — and surfaces the relevant emergency number and nearest facility type immediately. You don't have to know what kind of help you need. SafeNow figures it out. To test it try these prompts: "I am having a heart attack", " My building is on fire", "My brother is not breathing".
SOS Alert with Live Location
One tap sends your live Google Maps coordinates to every emergency contact simultaneously — via email and WhatsApp. No login required. No confirmation screen. The alert includes your name, a clickable map link, and your battery level. This works even for users who aren't registered, because an SOS button that requires authentication in an emergency is a button that gets people killed.
Live Location Tracking
Once an SOS is triggered, SafeNow begins continuous location tracking, pushing coordinate updates to your emergency contacts every 30 seconds so they can track your movement — if you're being moved against your will, your contacts see it happening. If you're being moved — taken somewhere against your will — your contacts see it happening. The tracking token is embedded in the alert email via Resend so contacts can monitor without needing an account.Also WhatsApp deep links via Resend to send messages through WhatsApp. The tracking link works without any account — contacts click the link in the email and see the map immediately. No app download, no login, no friction. Because in a real emergency, your contact might be your 60-year-old parent who has never installed an app in their life.
AI Chat with Emergency Pause
SafeNow includes two AI-powered chat modes: Emergency Guide and Mental Health Support. The Emergency Guide gives clear numbered steps for physical emergencies — cardiac arrest, fire, assault, choking — with the correct local emergency numbers embedded in every response. The Mental Health Support mode is a compassionate AI companion powered by Gemini 2.0 Flash with a system prompt engineered for crisis conversations: it reads the full conversation history every turn, adapts response length to emotional state, never repeats a question, and follows a strict escalation protocol when suicidal ideation is detected. Critically — when a physical emergency is detected mid-conversation, the AI chat pauses automatically and surfaces the emergency calling interface. Because if someone is having a heart attack, the last thing they need is a chatbot.
Mental Health Support — The Emergency Nobody Talks About
Mental health crises are emergencies too, and they're almost entirely ignored by emergency apps. SafeNow treats them as first-class. The mental health AI doesn't use templates or keyword matching — it responds to what the person actually said, in the emotional register they're in. Short fragmented messages get short steady responses. Detailed sharing gets deeper engagement. Crisis signals trigger an immediate escalation to crisis line information. In Bangladesh: Kaan Pete Roi at 01779-554391.
Nearby Emergency Services
SafeNow finds the nearest hospitals, police stations, fire stations and pharmacies using OpenStreetMap with Foursquare as fallback, sorted by distance. Phone numbers are enriched in parallel from Overpass, Geoapify, Foursquare, and Wikidata. Every result has a one-tap call button and one-tap Google Maps routing with driving, walking, and transit options.
Text-to-Speech pause/resume
Every AI response in both chat modes is read aloud via Text-to-Speech so users don't have to read while managing an emergency situation. The audio can be paused and resumed at any point — and when a physical emergency is detected mid-conversation, the audio and chat both pause automatically and the emergency calling interface surfaces immediately. Because if someone is having a heart attack, the last thing they need is a chatbot finishing its sentence.
Offline Resilience
Emergency numbers are cached locally on first load. If you lose signal — which happens in exactly the moments you need help most — the core calling function still works from cache. A clear offline indicator appears and non-essential features disable gracefully.
Voice Input and Translation
Users can speak their situation instead of typing via Speech-to-Text. Google Cloud Translation handles language barriers so the app and AI responses work for non-English speakers.
How We Built It
MeDo Plugins used:
SafeNow is built on MeDo's plugin ecosystem with unlimited daily calls across four plugins — Large Language Model (Gemini 2.5 Flash) for AI triage, emergency guidance, and mental health chat;Text-to-Speech for converting AI responses to spoken audio; Speech-to-Text for voice input so users can speak their situation instead of typing; and Google Text Translation for real-time language detection and translation so the app works for non-English speakers in crisis.
External APIs and Services:
Via MeDo Built-in Plugins (unlimited daily calls):
Large Language Model (Gemini 2.5 Flash) — AI triage, emergency guidance, and mental health chat Text-to-Speech — spoken audio for AI responses with pause/resume support Speech-to-Text — voice input so users can speak instead of type Google Text Translation — automatic language detection and real-time translation
Direct API Integrations:
Resend — transactional email for SOS alerts and WhatsApp deep links via Resend Google Maps — deep-linked routing and location embedding in alerts Overpass API (OpenStreetMap) — primary nearby services search across three mirror endpoints with automatic failover Foursquare Places API — secondary nearby services and phone number enrichment Nominatim (OpenStreetMap) — primary reverse geocoding BigDataCloud — secondary reverse geocoding fallback ipapi.co — IP-based location fallback when GPS fails entirely Geoapify Places API — phone number enrichment via proximity matching Wikidata — phone number enrichment for major institutions Supabase — database, Edge Functions, and real-time location tracking Gemini 2.0 Flash — direct API integration as fallback AI path alongside MeDo LLM plugin
Frontend:
React, TypeScript, Vite, Tailwind CSS. Designed mobile-first with 44px minimum tap targets, high-contrast emergency-red palette, and skeleton loading states that render within one second — because a blank screen in an emergency is unacceptable.
Location stack:
Browser Geolocation API → Nominatim reverse geocoding with retry logic → BigDataCloud fallback → ipapi.co IP-based last resort. Three independent layers so location detection survives rate limits and network failures.
Nearby services:
Overpass API queried across three mirror endpoints with automatic failover. Foursquare as secondary provider. Phone enrichment runs Overpass, Geoapify, Foursquare, and Wikidata in parallel and takes the first non-null result, cached for 7 days on success and 24 hours on failure.
AI layer:
Gemini 2.0 Flash via direct API for mental health chat and emergency guidance, with full conversation history passed on every call. MeDo's native LLM plugin via Supabase Edge Function as the secondary AI path. MeDo's Speech-to-Text and Text-to-Speech plugins for voice. Google Cloud Translation API for multilingual support.
Backend:
Supabase for database, authentication, and Edge Functions. Emergency numbers stored in Supabase and cached client-side for 24 hours. SOS alerts via Resend for email and WhatsApp deep links. Live location tracking via Supabase real-time updates with tracking tokens embedded in alert emails. Triage engine: Client-side weighted pattern scoring across 60+ regex patterns covering critical medical, urgent medical, police/crime, and mental health crisis categories. Zero latency — runs synchronously before the API call.
The Most Impressive Feature MeDo Helped You Create
The AI triage system combined with the mental health support AI is the feature we're most proud of, and MeDo was central to both. The triage engine — which classifies emergency type and severity in real time with zero latency before the user even finishes typing — was designed entirely through MeDo conversations. We described the problem: people in panic don't know if they need police, an ambulance, or a mental health crisis line. They just know something is wrong. MeDo helped us think through a weighted scoring architecture across 60+ regex patterns covering critical medical, urgent medical, police/crime, and mental health crisis signals, with confidence scoring and facility-type routing baked in. It runs client-side synchronously so there's no API round-trip between the user typing and the severity badge appearing. But the feature that MeDo made possible in a way nothing else could is the mental health support AI. Through iterative prompting conversations with MeDo, we built a system prompt that makes Gemini 2.5 Flash behave like a trained crisis support companion — reading the full conversation history every turn, matching the emotional register of the person it's talking to, never repeating a question, slowing down when someone is in pain, and escalating to crisis line information the moment suicidal ideation appears. The key insight MeDo gave us was that the right system prompt eliminates the need for post-processing entirely — the LLM handles tone, memory, pacing, and crisis detection naturally when instructed correctly, which is why we were able to delete 900 lines of rule-based code and replace it with a single well-structured prompt. The result is a mental health AI that responds to what the person actually said — not a category of it — which is rare in emergency apps and may genuinely matter to someone reaching out at 2am with nowhere else to turn
Challenges We Ran Into
Making the AI actually listen. The first version of our mental health AI was a ~900-line rule-based engine with keyword matching, response templates, and a rewriting layer that fought its own output. It gave generic responses, ignored context, and asked irrelevant questions. We scrapped it entirely and replaced it with a single LLM call with a carefully engineered system prompt that passes full conversation history. The quality difference was immediate and dramatic. Location in hostile conditions. GPS fails. Nominatim rate-limits. BigDataCloud returns wrong countries near borders. We had to build a three-layer geocoding fallback chain and test it across edge cases — users on borders, users with denied permissions, users with no internet at all — before the location detection became reliable enough for an emergency context. Phone number enrichment at scale. Most OSM data for hospitals and police stations in developing countries has no phone numbers. We built a parallel enrichment pipeline hitting four different data sources simultaneously and caching results aggressively, which brought phone number coverage from under 30% to over 70% in our target markets. Offline without a service worker. Getting meaningful offline functionality using only localStorage caching — no service worker, no PWA shell — required careful prioritization of what gets cached on first load versus what degrades gracefully. Gemini safety filters blocking crisis content. Gemini's default safety settings blocked messages containing words like "suicide" and "self-harm" — exactly the conversations the mental health feature needed to handle. We had to configure safety thresholds carefully to allow the app to respond to crisis messages without triggering false positives on violent emergency guidance content.
Accomplishments That We're Proud Of
The mental health AI that replaced a 900-line rule-based engine with a single system prompt — and produces dramatically better responses. The rule engine pattern-matched emotions and retrieved templates. The LLM reads the full conversation history every turn, notices if distress is escalating, matches the person's register, and never repeats a question. The difference isn't subtle. One feels like a script. The other feels like someone is actually listening. The AI triage system classifying emergency type and severity before the user finishes their first sentence — with no API call, no round-trip, no waiting. A person typing "he's not breathing" sees "Critical Medical Emergency" and the ambulance number surface instantly. We built this as a weighted scoring engine across 60+ patterns covering medical, police, crime, and mental health crisis signals because in a real emergency, the user shouldn't have to know what kind of help they need. The SOS alert firing in under two seconds — email to every contact and WhatsApp opened simultaneously — with zero authentication required. We made a deliberate decision to remove the login gate from SOS entirely because an emergency button that asks you to sign in first is a button that gets people killed. Tap once. Help is notified. That's it. Phone number enrichment achieving 70%+ coverage in developing countries. Most OSM data for hospitals and police stations in Bangladesh, Nigeria, and Pakistan has no phone numbers at all. We built a parallel enrichment pipeline hitting Overpass, Geoapify, Foursquare, and Wikidata simultaneously and caching results for 7 days — bringing coverage from under 30% to over 70% in our target markets. Because a nearby hospital card with no call button is useless in an emergency. Location detection that works even when everything goes wrong. Nominatim rate-limits in high-traffic areas. BigDataCloud returns wrong countries near borders. GPS fails indoors. We built a three-layer fallback — GPS geocoding, IP-based detection, manual country selection — so that a traveler in a basement or a rural area with poor signal still sees the right emergency number within seconds of opening the app. No dead ends. No blank screens. Pharmacy coverage matters especially in medical emergencies where a hospital isn't needed but medication is — a user having an allergic reaction or running out of insulin needs the nearest open pharmacy, not a hospital admission.
What We Learned
The hardest part of building for emergencies is that the person using your app is the least capable version of themselves. Every extra tap, every second of loading, every confusing label is a failure. Designing for panic means ruthlessly removing everything that isn't essential and making everything that is essential impossible to miss. We also learned that LLMs are dramatically better than rule-based systems for emotionally sensitive conversations — not because they're more sophisticated, but because they actually read what the person said. The entire 900-line rule engine was solving a problem that a good system prompt handles naturally. And we learned that mental health emergencies need to be treated with exactly the same urgency as physical ones. The features that handle them need to be just as fast, just as reliable, and just as carefully designed. We learned that the hardest design decision in emergency UX is what to remove. Every feature we're proud of required us to delete something — 900 lines of rule-based AI code, the Twilio SMS integration that only worked with verified numbers, the login gate on SOS that would have gotten someone killed. The app got better every time we made it simpler.
What's Next for SafeNow
Panic button widget — a home screen shortcut that triggers SOS with a single tap without opening the app, for situations where there's no time to navigate. Offline AI — a lightweight on-device model for emergency guidance that works with zero connectivity, for the situations where someone has no signal and needs step-by-step first aid instructions. Real-time tracking dashboard — a web page emergency contacts can open from the alert email that shows live location updates on a map without needing an account, updating every 30 seconds. Multi-language AI — mental health and emergency guidance in Bengali, Arabic, Spanish, and French, matching the languages of our highest-risk user groups. Verified emergency numbers — a community-verified database of emergency numbers with last-confirmed timestamps and source citations, replacing the current static database with crowdsourced accuracy. Wearable integration — fall detection and heart rate anomaly triggers that automatically initiate SOS without requiring the user to act, for medical emergencies where the person can't reach their phone.
Overpass API reliability — routing map data queries through a dedicated server-side proxy to eliminate the CORS and timeout failures that affect direct browser requests in regions with restricted network access.
Building SafeNow with MeDo was an iterative conversation-driven process rather than a traditional build-from-spec approach. We started by describing the core problem to MeDo: a foreigner in danger who doesn't know the local emergency number, can't type fast enough, and may not speak the language. From that scenario, MeDo helped us identify that the app needed four distinct layers — instant calling, AI triage, human-like emotional support, and a voice interface — and helped us structure the plugin architecture to serve all four without redundancy. The mental health AI was the most conversation-intensive part. We described the failure modes of the original rule-based system — generic responses, repeated questions, ignoring what the user actually said — and worked with MeDo to understand why LLMs handle emotionally sensitive conversations fundamentally better than pattern matching. MeDo helped us move from a 900-line rule engine to a single, precisely engineered system prompt that passes full conversation history and adapts response length to emotional state. We iterated on that prompt across multiple MeDo conversations, testing it against real crisis conversation patterns until the tone, pacing, and crisis escalation behaviour were right. For the plugin integration, we used MeDo to understand how to chain the four plugins coherently — routing the LLM plugin's output to Text-to-Speech, feeding Speech-to-Text output back into the LLM, and using Translation as a preprocessing layer before both. MeDo also helped us debug the Gemini safety filter problem, where crisis-related messages were being blocked before reaching our system prompt, and guided us to the right safety threshold configuration. Throughout the build, MeDo served as both a coding partner and an architectural sounding board — helping us make decisions like removing the entire validation/rewriting layer from the AI service, restructuring the geocoding fallback chain, and prioritising offline resilience for the emergency numbers cache.
Built With
- bigdatacloud
- medo
- nominatim
- openstreetmap
- overpass
- resend
- twilio
- wikidata
Log in or sign up for Devpost to join the conversation.