Inspiration

Over 40% of fatal cycling, hiking, and solo-commuter accidents happen when no one else is around to call for help. Standard emergency apps rely on a conscious victim unlocking their phone, dialing a number, and speaking clearly. If you are knocked unconscious or incapacitated during a medical emergency, your phone stays silent in your pocket. I wanted to build an autonomous safety net that acts on your behalf when you cannot—turning a standard web browser into a zero-hardware lifeline.

What it does

DeadSwitch is an autonomous lone-worker and solo-commuter safety protocol that detects silent incapacitation and automatically dispatches an emergency incident packet to responders[cite: 2]:

  • Multi-Trigger Detection: Monitors real-time accelerometer telemetry (DeviceMotionEvent) for high-G impacts ($> 2.5G$) followed by immobility, alongside a configurable "Dead Man's Check-In" countdown timer.
  • 15-Second Grace Window: Triggers a full-screen pulsing crimson alert with a synthesized Web Audio alarm and a 2-second hold "I'M OK — CANCEL" button to prevent accidental pocket dismissals or false alarms.
  • Privacy-First Rolling Audio Buffer: Continuously records a 10-second ambient audio loop strictly inside local RAM—automatically wiping every 10 seconds unless an emergency dispatch actually occurs.
  • Live Responder Console (/responder): Instantly receives the dispatched incident packet with real-time GPS tracking on a dark-mode tactical map, battery/G-force telemetry, an embedded audio player for the captured pre-incident clip, and simulated SMS/webhook alert logs.

How I built it

  • Frontend & Architecture: Built with Next.js (App Router), TypeScript, and Tailwind CSS in a high-contrast "Mission Control / Tactical Dark" aesthetic.
  • Native Sensor & Hardware APIs: Leveraged browser-native DeviceMotionEvent for G-force calculations, navigator.geolocation for live coordinate tracking, navigator.getBattery() for device health telemetry, and the Web Audio API / MediaRecorder for the rolling local audio buffer and synthesized alert tones.
  • Mapping & Real-Time Sync: Integrated Leaflet (react-leaflet) with keyless CartoDB Dark Matter tiles for live responder mapping, and engineered a zero-latency tab-to-tab state synchronization engine using BroadcastChannel and localStorage so evaluators can test the Beacon and Responder Console simultaneously without external backend setup.

Challenges I ran into

  • Browser SSR & Hardware Constraints: Running Leaflet maps and hardware sensor listeners inside Next.js App Router caused initial window is not defined hydration errors, which I solved by isolating client-only dynamic imports (ssr: false) and building graceful desktop fallbacks (like the manual G-force simulator slider and 1-click Crash Demo trigger) so judges on laptops can test every sensor smoothly.
  • Rolling Audio Memory Management: Ensuring the MediaRecorder buffer continuously overwrote old audio chunks every 10 seconds without leaking memory or stalling the main UI thread required careful Blob lifecycle cleanup and Base64 serialization only at the exact moment of dispatch.

Accomplishments that I'm proud of

  • Designing a zero-API-key, 100% browser-native safety protocol that runs immediately on any mobile device or desktop browser with zero app store friction.
  • Building a privacy-by-design local RAM audio buffer that gives responders critical context from the 10 seconds leading up to an incident while guaranteeing zero cloud surveillance during normal operation.
  • Achieving sub-second real-time synchronization between the Beacon Terminal and the Responder Console.

What I learned

  • How to orchestrate multiple asynchronous browser hardware APIs (DeviceMotion, Geolocation, MediaRecorder, and BroadcastChannel) into a deterministic state machine (DISARMED $\rightarrow$ ARMED $\rightarrow$ GRACE $\rightarrow$ DISPATCHED).
  • How critical UX friction design is in safety software—specifically balancing rapid, zero-click emergency escalation with intentional cancellation mechanics (like a 2-second hold button) to eliminate false positives.

What's next for DeadSwitch

  • Native Offline SMS & Mesh Fallback: Packaging the PWA with native Capacitor/React Native bridges to send compressed GPS packets over raw cellular SMS or Bluetooth mesh networks when mobile data drops out in remote areas.
  • Wearable Biometric Integration: Connecting Apple Watch and Garmin heart-rate APIs to detect sudden cardiac anomalies or rapid pulse drops alongside accelerometer impacts[cite: 2].

Built With

Share this project:

Updates

Submission history