Inspiration
Last Tuesday, the power grid in Kasur failed for 14 hours. The 4G towers died. The internet went dark. My aunt, who raised me, has severe diabetes and needed her insulin. I walked six miles in the blistering heat trying to find a pharmacy with a working generator, because we couldn't call ahead to check. The problem is a total blackout of information. When infrastructure fails, the lack of data kills people. I know it's real because I lived it. I built SafeLink so no one else has to walk six miles blindly for medicine.
What it does
Kasur SafeLink is an offline-first emergency network. It turns a standard laptop into a local Wi-Fi node. When citizens connect to the Wi-Fi, their phones are forced to open a locally hosted web page—no internet required. People can post updates about local pharmacies, clinics, and water points. Because the internet is down, the data doesn't go to a cloud. Instead, it syncs physically. When two SafeLink laptops come within Bluetooth range, they automatically merge their databases. The data spreads across the city through human movement, like a digital town crier.
How we built it
Since I was working solo and there is no internet, I couldn't use modern cloud tools. Everything is 100% local. I had to be the frontend, backend, and network engineer:
- The Server: Built with Python and Flask. It hosts the HTML page locally on port 80.
- The Database: SQLite. It’s a single file on the hard drive, requiring no server setup.
- The Captive Portal: I used dnsmasq to hijack DNS requests. When a phone connects to the hotspot, it tries to ping Google. My laptop intercepts it and redirects the phone to my local IP address.
- The Hotspot: Used create_ap on Ubuntu Linux to broadcast the Wi-Fi network.
- The Mesh Sync: Wrote a Python script using pybluez and socket to transfer the SQLite file over Bluetooth to other nearby nodes.
- The UI: A lightweight HTML/CSS page styled like a retro terminal. I used pyttsx3 to make the laptop read out new alerts aloud for users who cannot read.
Challenges we ran into
Doing this alone meant every bug was my bug. The biggest challenge was the Captive Portal. Modern Android and iOS devices are incredibly strict. Because I didn't have an SSL certificate (which requires internet to verify), their phones kept blocking the local HTTP page. I spent 10 hours writing a custom Flask route to detect the OS's specific connectivity check URLs (like connectivitycheck.gstatic.com) and trick the phone into thinking it was a normal Wi-Fi login page. Another challenge was the Bluetooth sync. I had to write a deduplication algorithm in Python to compare timestamps and locations before merging the new data, otherwise the database would crash with duplicates.
Accomplishments that we're proud of
I'm proud that this works without a single external API. No AWS. No Google Maps. No Twilio. It works entirely on a 10-year-old laptop and an old Android phone. Working solo, I successfully built a functional Delay-Tolerant Network (DTN)—the same kind of protocol NASA uses for deep space—using basic Python.
What we learned
I learned how DNS resolution actually works. I learned how to manipulate network interfaces in Linux. I learned how to merge relational databases without a server. Most importantly, I learned that you don't need a team of engineers or millions of dollars in cloud infrastructure to solve a local problem. You just need to understand the basics, put your head down, and code.
What's next for Kasur SafeLink
Right now, SafeLink requires a laptop and a power source. But in a blackout, laptop batteries die. The next step is to port this entire system into a lightweight Android application using Wi-Fi Direct. This will eliminate the need for the laptop entirely. Any Android phone with the app installed will automatically act as a node, broadcasting the captive portal and syncing data via peer-to-peer Bluetooth handshakes in the background. I also want to implement AES-256 encryption so hospitals can securely broadcast sensitive patient needs without the data being intercepted.
Log in or sign up for Devpost to join the conversation.