Inspiration

Living in a fast-paced world, the commute is often the only time we have to rest. However, that rest is usually plagued by "Arrival Anxiety"—the constant fear of oversleeping and waking up at the end of the line. Existing map apps are great for navigation but terrible for sleeping; they don't account for signal loss in tunnels or the social embarrassment of a loud alarm in a quiet train car.

"Endiri" was born to solve this. I wanted to create a "set it and forget it" companion that protects your sleep and your social reputation.

What it does

Endiri is a high-precision "Smart Commute Companion" designed to eliminate the anxiety of oversleeping on public transport. Unlike standard time-based alarms, Endiri uses geofencing and state-machine logic to trigger alerts based on your real-time location.

It is specifically engineered to be:

Battery Efficient: It doesn't drain your phone on long journeys. Signal-Proof: It uses "Dead Reckoning" to work even in underground tunnels. Socially Polite: It uses a "Vibrate-First" escalation to wake you up without disturbing other passengers.

How we built it

The app is a Progressive Web App (PWA) built using React, TypeScript, and Tailwind CSS. We focused on a "Native-First" web experience to ensure it could be easily shared and installed without an app store. The Technical Core:

Tiered Tracking: We implemented a dynamic polling algorithm where the GPS refresh rate "f" is a function of the distance "d": $$f(d) = \begin{cases} 120s & \text{if } d > 5\text{ km} \ 30s & \text{if } 1\text{ km} < d \leq 5\text{ km} \ 5s & \text{if } d \leq 1\text{ km} \end{cases}$$ API Stack: We used the Geolocator API for positioning, the Web Audio API for the progressive volume ramp, and Leaflet/OpenStreetMap for zero-cost, high-reliability mapping.

Challenges we ran into

The biggest hurdles were the inherent limitations of mobile browsers:

Background Throttling: Mobile OSs often kill background GPS. We bypassed this using the Screen Wake Lock API and a persistent Service Worker. GPS Dead Zones: In subway tunnels, GPS often "freezes." We solved this by implementing a Dead Reckoning algorithm that estimates arrival time "T" using the last known velocity "v": $$T = \frac{d_{remaining}}{v_{last}}$$ Audio Autoplay Policies: Browsers block sounds unless triggered by a user. We designed a "Start Journey" gesture that initializes the audio context to ensure the alarm sounds every time.

Accomplishments that we're proud of

The Zero-Embarrassment Alert: We successfully built an escalation system that starts with haptic pulses and only uses audio as a fail-safe, protecting the user's social reputation in quiet spaces.

Hardware Integration: Getting a web app to behave like a native tool—controlling the vibration motor, preventing sleep mode, and managing high-accuracy location—was a major technical win.

What we learned

We learned that building for the "real world" means building for failure. It isn’t enough to track a blue dot on a map; you have to plan for the battery dying, the signal dropping, and the user being in a crowded, silent environment. This project deepened our understanding of asynchronous JavaScript and the PWA lifecycle.

What's next for Endiri

The future of Endiri involves making it even more context-aware:

GTFS Integration: Syncing with live train/bus schedules to adjust the alarm if there are transit delays.

Wearable Support: Direct integration with Apple Watch and Wear OS for haptic-only wrist alerts.

Smart Volume: Using the microphone to detect ambient noise levels and adjusting the alarm volume so it’s just loud enough to wake the user.

Built With

Share this project:

Updates