Inspiration

Every woman we've met has, atleast once, has taken the long way home. Not because she was lost, but because she was calculating. "Is this street safe? Is it too late to walk alone? Should I text someone my location?"
That mental load is exhausting. And the tools that exist to help, like government crime dashboards or safety apps , require accounts, making them either feel inaccessible or immediately compromise the privacy of the very people they're meant to protect. We wanted to build something that felt like a friend quietly passing you information. "Hey, avoid that parking lot after 8."
Anonymous. Simple. Community-powered.

What it does

SafeMap lets anyone — no account, no name, no trace — report a safety incident in plain language, in any language. Our AI parses what happened, where, and when. The community builds a living map of risk. Everyone stays safer.

"Theft near the station exit, late Tuesday night." → Parsed, anonymized, mapped. Done.

Core Features

  • Fully Anonymous Reporting — No login. No cookies. No identity. Your report is stored as structured metadata only — the original text is never saved.
  • Intelligent Location Search — Type an address or drop a pin. We fuzz your coordinates by 50–100m before storing them. Your exact location is never recorded.
  • AI-Powered Incident Parsing — Google Gemini reads your free-text report and extracts incident type, severity, and timing automatically. Works in any language.
  • Interactive Hotspot Map — Color-coded severity markers (🔴 High · 🟡 Moderate · 🟢 Low) show the community's collective knowledge of risky areas.
  • AI Safety Insights — Click any hotspot to get Gemini-generated, actionable safety recommendations specific to that area.
  • Real-Time Dashboard — Total reports, active hotspots, most common incident types, and peak danger hours — at a glance.

How we built it

We split into frontend and backend tracks from the start and kept the API contract tight between them so both sides could move independently.

Backend is a FastAPI service in Python. When a report comes in, it hits the Gemini API first: we prompt it to extract incident type, severity level, and an hour estimate from whatever free-text the user wrote, in whatever language they wrote it in. The structured output lands in SQLite via SQLAlchemy. The original text is discarded immediately — it never touches the database. Before coordinates are written, a privacy utility applies a random 50–100m offset so no exact location is ever stored.

Hotspot generation runs DBSCAN over all stored coordinate pairs. We chose DBSCAN specifically because it doesn't require you to pre-define the number of clusters — hotspots emerge from where reports actually concentrate, rather than being forced into arbitrary grid cells. Each resulting cluster becomes a hotspot object with a dominant incident type, an average severity score, and a report count. A second Gemini call then generates safety insights per hotspot: given the cluster's incident profile, it produces a plain-language summary and actionable recommendations for that specific area.

Frontend is React 18 with TypeScript, built with Vite, styled with TailwindCSS. The map is Leaflet.js with React Leaflet, with markers color-coded by severity score. Clicking one fires the insights endpoint and renders the AI response inline. Location search runs through Nominatim (OpenStreetMap), keeping the stack entirely free of paid API dependencies on the frontend side.

The two sides talk through a clean REST API — five endpoints, typed with Pydantic on the backend and Axios on the frontend. We also built a demo mode with 92 pre-seeded realistic incidents so the map looks alive immediately without needing to submit test reports first.

Challenges we ran into

  • Privacy without losing utility. Fuzzing coordinates protects users but risks making hotspots geographically inaccurate. We tuned the offset range (50–100m) to balance both — enough to anonymize, not enough to mislead.
  • Parsing ambiguous language. People don't report incidents in structured forms. "Sketchy vibe near the underpass last night" needs to become a severity level and an hour estimate. Gemini handled this better than we expected, but prompt engineering to get consistent structured output took real iteration.
  • Building something emotionally true in a time crunch. The hardest part wasn't the code. It was making sure that every decision; what we collect, what we don't, how the UI feels, reflected the actual experience of the people we were building for.

Accomplishments that we're proud of

  • Gemini parsing free-text incident reports in multiple languages, consistently, with no structured input from the user
  • Privacy-by-design working end-to-end — the original report text genuinely never touches the database
  • DBSCAN hotspots that feel geographically honest, with clusters emerge that from real density.

What's next for SafeMap

  • Time-decay on hotspots — old reports should fade, so the map reflects now, not six months ago
  • Mobile app — safety reporting should work one-handed, walking, in under 30 seconds
  • Verified incident types — cross-referencing reports with public crime data to surface patterns faster

Built With

Share this project:

Updates