Inspiration

Someone once said there are more than just 2,000 languages in the world — but really there are 7 billion languages, because every single person speaks their own language. We each say things our own way. That's a beautiful thing, until the moment you really need to be understood and you can't find the words.

That's the scariest part of being lost. Every year, kids get lost at fairs, on trails, and during emergencies at home. The one thing that decides how fast help arrives is whether they can say exactly where they are — and panic makes that the hardest thing in the world. A child can't read off GPS coordinates, and "I'm near some trees" tells a rescuer almost nothing.

I was inspired by one idea from information theory: a message gets through faster when it carries the most meaning in the fewest symbols. Claude Shannon wrote this down in 1948 as the entropy of a source,

$$ H(X) = -\sum_{i} p_i \log_2 p_i , $$

which sets the limit on how compactly information can be packed. The best emergency message is a tiny, high-information packet — who needs help, where, and what is nearby. Two real systems already do this beautifully: what3words slices the planet into $3\,\text{m} \times 3\,\text{m}$ squares and names each one with three everyday words (about $40{,}000$ words give $40{,}000^{3} \approx 6.4 \times 10^{13}$ squares, enough for the whole Earth, yet a six-year-old can say one out loud), and Morse code with the SOS signal — a minimal code that still works when voice and text do not. My guide, Ranger Bear, is a nod to the HackBerkeley bear, with the motto building tools for a borderless world.

What I learned

  • How three-word geocoding and search-and-rescue signaling actually work, and why "short but complete" beats "long and emotional" — straight out of Shannon.
  • Practical browser media APIs (getUserMedia, frame capture), and how to keep voice private: used once, never stored.
  • How to design AI prompts for an audience that can barely read, where tone and length matter as much as being correct.
  • The unglamorous side of shipping: environment variables, API key restrictions, and DNS records — and that sometimes the hardest blocker isn't code at all, it's access, so you always want a backup plan.

How I built my project

The app is Next.js 16 + React 19 + TypeScript + Tailwind CSS v4, deployed on Vercel at bearrier.dev. Four live APIs work together, each with an offline fallback: Claude for the dispatcher's voice, Google Maps (JavaScript, Static, Places) for the map and real landmarks, what3words for addresses both ways, and Deepgram for speech to text.

To put a 3×3 rescue grid onto the real world, I project latitude and longitude with Web Mercator. The ground resolution at zoom $z$ and latitude $\phi$ is

$$ \text{mpp} = \frac{156543.03 \,\cos\phi}{2^{z}}, $$

and each cell is one third of a 640 px tile, so a cell spans $\tfrac{640}{3}\cdot \text{mpp}$ meters. I turn that offset into a real coordinate for every cell, then invert it to find which cell any Google Place lands in.

Voice verification closes the loop end to end: the browser records the child, I send the audio to Deepgram, take the spoken words to what3words to get a point, and compare it to the child's true location using the haversine distance

$$ d = 2R \arcsin!\sqrt{\sin^{2}!\tfrac{\Delta\phi}{2} + \cos\phi_1 \cos\phi_2 \sin^{2}!\tfrac{\Delta\lambda}{2}}. $$

If $d \le 45\,\text{m}$, help is found. Round 1 also uses a deterministic "clue clarity" score so the lesson is fair and replayable:

$$ c = \min!\Big(1,\; \max_i s_i + 0.12\,(n-1)\Big), $$

where $s_i$ is each clue's strength and $n$ is how many clues were given. The helper's pin then moves from the guess toward the truth by the fraction $c$. I backed the Morse codec, the grid math, and the scoring with Vitest unit tests.

Challenges I faced

  • Locked out by a password. My single biggest setback wasn't code — I couldn't get into an account I needed, which cost me about 8 hours. I ended up buying a third laptop for $2500 just to get unblocked and keep building.
  • Closing the voice-to-location loop. Chaining microphone capture, Deepgram, what3words, and a distance check — with graceful fallbacks when a child has no mic or denies permission — took careful state handling.
  • Grid and globe. Getting the Web Mercator projection right so real Places land in the correct square, and round-tripping cell centers, was fiddly. I backed it with tests that assert every cell maps to itself.
  • An emergency that isn't scary. Prompting Claude to sound urgent and believable, but always calm, kid-safe, and short, was a real design problem.
  • Always demoable. Every integration needed an offline fallback so a missing key never breaks the game.

Built With

Share this project:

Updates