Inspiration

During emergencies, it can be hard to keep track of where people are, where they should go, and whether everyone has actually been picked up. We wanted to make a system that helps organize this process and makes it easier for dispatchers to know what still needs to be done and for civilians to know where they can get help from.

What it does

SafeRoute helps connect people who need help with dispatchers.

A user reports their location, and SafeRoute sends them to the nearest safe hotspot. Dispatchers can see all the hotspots, how many people are waiting at each one, and claim a hotspot to handle.

Each person gets a unique QR code. When a dispatcher picks someone up, they scan the QR code to mark them as picked up. The app keeps track of how many people are still waiting so dispatchers know when everyone at a hotspot has been accounted for.

How we built it

We built SafeRoute as a full-stack web app.

The frontend is used by both victims and dispatchers. The backend uses Express and TypeScript, and we use PostgreSQL with PostGIS to store locations and find the closest hotspot.

We used Drizzle ORM for our database queries and QR codes to verify pickups. We also made the site work on phones so dispatchers can scan QR codes directly using their camera.

Challenges we ran into

One of the biggest challenges was working with location data. At first, it seemed like finding the closest hotspot would be simple, but we had to learn how PostGIS, geographic coordinates, spatial indexes, and distance queries actually work.

We also had a lot of issues getting the app to work across different devices. Since the frontend and backend were running locally, we had to deal with HTTPS, CORS, Cloudflare tunnels, and getting phone cameras to work correctly.

Accomplishments that we're proud of

We’re proud that we got the entire flow working instead of just building a demo page.

SafeRoute can:

  • find the closest hotspot to a user
  • track how many people are at each hotspot
  • let dispatchers claim hotspots
  • generate a unique QR code for each person
  • scan QR codes to confirm pickups
  • show when everyone at a hotspot has been picked up

We’re also proud that we were able to use real geospatial queries instead of hardcoding distances or using fake data.

What we learned

We learned a lot about geospatial databases and how location-based apps work.

We also learned that building something that works across multiple devices is a lot harder than getting it to work on localhost. A lot of our time went into debugging networking, HTTPS, and camera access.

We also learned more about database transactions and why they matter when multiple things need to update correctly at the same time.

What's next for SafeRoute

If we had more time, we would add live dispatcher locations and automatically assign dispatchers to hotspots based on distance and how many people are waiting. Additionally, we would also add direct communication between dispatchers and civilians for those who need help and for dispatchers to know more about the situation on the ground.

We would also add navigation, better real-time updates, and an overall dashboard showing which hotspots still need help.

Another important feature would be offline or low-connectivity support, since internet access might not be reliable during an actual emergency. One way we could do that is by caching all the hotspot locations beforehand and displaying the closest hotspot to each user. While this wouldn't allow the dispatcher to see which hotspot each user is assigned to, ideally, there would be some cell service along the way or at the hotspot which would allow the user to update when they have arrived.

Built With

Share this project:

Updates

Submission history