The problem
About 350,000 people in the United States have an out-of-hospital cardiac arrest each year, and about 90% do not survive (American Heart Association). Immediate CPR can double or triple the chance of survival, but only about 4 in 10 receive bystander CPR before EMS arrives, and about 10% have a bystander apply an AED. Most of those arrests happen at home. The public steps are simple — call 911, then push hard and fast in the center of the chest at 100 to 120 times a minute — and most people never get a chance to feel that beat.
What it does
Second Beat is a zero-backend web app you can open on a phone or a laptop.
- A living 110-BPM coach (the midpoint of the AHA’s public 100–120 adult rate) with a tactile, original metronome and a mute toggle. Timing feedback is clearly labeled as timing practice — it cannot measure depth or recoil.
- Four rehearsal scenes around Elmhurst, Queens, pinned only to official inventory coordinates or the Census centroid for ZIP 11373, never a private home address: lunch at Queens Center Mall, Friday night at Lost Battalion Hall Recreation Center, community night at I.S. 5, and a Sunday dinner at home (where most arrests actually happen).
- A generic AED board — not a copy of any manufacturer’s device — that walks through power, pad placement, standing clear, a practice shock, and returning to compressions.
- A searchable map of the official New York City AED Inventory, published by the Health Department under Local Law 91 of 2023. Distances and walking times are computed on the device. The app is honest that this is a registry extract, not a live cabinet-status feed, and that some public AEDs (including many in MTA stations) may be missing.
Call 911 first in a real emergency. This project is education, not a certification and not medical advice. A certified course still matters.
How I built it
I built a static site of HTML, CSS, and ES modules so it can ship on GitHub Pages with no server. Official inventory rows are cleaned and grouped at build time (npm run data) into 4,002 sites. A 110-BPM clock, haversine search, and the coach state machine are covered by unit tests. Headless Chrome walks the full rehearsal on desktop, tablet, and mobile. Final verified run: 35/35 unit and data tests pass, ESLint reports 0 errors / 0 warnings, and 94/94 headless-Chrome E2E checks pass.
Visual energy comes from a 60-fps Canvas pulse field, an original Web Audio thump (not a commercial song), and a dark, typographic interface rather than a generic dashboard. Prefers-reduced-motion is respected.
Challenges I ran into
The official registry is useful and incomplete at the same time. It is not a live “this cabinet works right now” feed, and some public places are absent. The honest product is a rehearsal plus a clearly labeled map, not a dispatch tool. I also had to keep medical claims inside public AHA guidance — Hands-Only for a teen or adult who suddenly collapses, with a clear caveat that breaths matter especially for infants, children, drowning, and overdose — and keep the AED board generic so it does not impersonate a specific device.
Accomplishments that I'm proud of
A judge can feel the 110-BPM beat in ten seconds, with no account and no setup. The Queens Center and Lost Battalion Hall scenes sit on official inventory coordinates. The home scene sits on a Census ZIP centroid and tells the harder truth: most arrests happen at home, and the beat is what you always have.
What I learned
Useful emergency tools have to be honest about what they cannot do. A metronome cannot certify CPR. A published registry cannot promise a cabinet is unlocked. Stating those limits clearly made the rest of the product stronger.
What's next
A short, optional “find a certified course” path that still stays on official AHA listings, and a print-friendly one-page reminder of the two public Hands-Only steps plus the nearest registered cabinets to a saved ZIP (still on-device). I would only add another city’s registry if that city publishes one as official open data.
Built with
HTML, CSS, JavaScript (ES modules), Canvas, Web Audio, official NYC Open Data (AED Inventory 2er2-jqsx, Borough Boundaries gthc-hcne), U.S. Census 2020 ZCTA gazetteer, Node.js (node --test, ESLint, Puppeteer) for tests and the data build. No backend, no API keys, no runtime dependencies.
Links
- Live demo: https://mogzz2008.github.io/second-beat/
- Repo: https://github.com/mogzz2008/second-beat
- Official inventory: https://data.cityofnewyork.us/Health/New-York-City-Automated-External-Defibrillator-AED/2er2-jqsx
- AHA, What is CPR?: https://cpr.heart.org/en/resources/what-is-cpr
Built With
- canvas
- css3
- github
- html5
- javascript
- nyc-open-data
- svg
- web-audio-api