-
-
End card
-
34% have no athletic trainer, with the source line
-
Wordmark plus the live landing headline
-
Wed 4 PM: Red, ≈90.4°F, max 1 hr
-
Hour-by-hour chart, 6–8 AM suggested
-
Water breaks at real clock times
-
Spanish message with the English facts beside it
-
85°F/80% humidity → 86.9°F WBGT, Yellow
-
Ono & Tonouchi formula, 7/7 coefficients
-
Self-check passes, with what it asserts
-
Deterministic. Tested. Cited. AI only does language.
-
Free, global, no meter, no login, plus the phone view
Inspiration
Exertional heat stroke is a leading cause of sport-related death in US high schools, and 34% of US secondary schools with athletics programs have no athletic trainer (Stearns et al., Sports Health, 2024). Youth rec leagues, summer camps and marching bands often have no one at all.
The guidelines that prevent heat deaths already exist: the WBGT heat index plus the US Soccer / Korey Stringer Institute activity table, which tells you exactly how long to practice and how often to break at each heat level. But a WBGT meter only tells you about right now. Practices are planned days ahead, often by volunteer coaches who have never seen that table.
So we built for one person: Coach Maria, who runs a volunteer U14 soccer team in Houston on Monday, Wednesday and Friday at 4 PM. She has no trainer, and many of her families speak Spanish. She doesn't need another thermometer. She needs to know when her team should practice this week, and what to do once they're out there.
What it does
SidelineSafe turns the hourly forecast
- Plan: Enter a city and the usual schedule. Each practice gets a flag (Green → Yellow → Orange → Red → Black), rated by its hottest hour, not the average. SidelineSafe finds the safest window that day, applies the guideline's time cap (Orange 2 h, Red 1 h, Black cancel), and builds a printable practice card with water breaks as real clock times. The URL is the plan: share it, no login needed.
- Message families: One tap writes a note to parents in 10 languages. The day, times and flag come from the plan, and AI only does the wording.
- Now: The current flag, when it changes next, an "I have a meter" override, and a heat log with CSV export.
- Learn: Sliders that show why humidity matters: 85°F at 80% humidity is 86.9°F WBGT (Yellow), while 95°F at 15% is only 80.3°F (Green).
- Replay: Run any past week from the weather archive, so you can see real summer heat even in November.
A real result (Houston, Wed July 12, 2023, from the archive):
4:00 PM → ✕ RED, ≈90.4°F WBGT, max 1 hour. Move to 6:00 AM → YELLOW, full 2 hours. Water breaks at 6:20, 6:40, 7:00, 7:20 and 7:40 AM.
Try it: https://sidelinesafe.deployxa.online
How we built it
- Next.js + TypeScript + Tailwind, with no other dependencies. The hour-by-hour chart is hand-written SVG.
- Weather: Open-Meteo forecast, historical-archive and geocoding APIs. They are free, global and keyless.
- Science, as pure functions in
lib/wbgt.ts:- The Ono & Tonouchi (2014) WBGT regression, the formula Japan's Ministry of the Environment uses. We checked all 7 coefficients against the paper.
- The US Soccer / KSI regional flag table, copied word for word.
- A planner, a break scheduler and a "next flag change" finder.
- Tested:
node lib/wbgt.check.tsasserts every flag boundary in all 3 regions, that the heat estimate rises with temperature, humidity, sun and wind, the humid-beats-dry claim, the planner rules (minimum-risk window, Red caps 120 → 60 min, Black cancels, an already-safe time stays put), the break clock times, and the message template. - AI, kept in its lane:
/api/briefsends only the plan's facts to Claude Haiku 5.5 (≤ 2 KB, allowlisted languages). A deterministic guard rejects any message that doesn't contain every clock time word for word and falls back to a template. If the AI changes a time, it's thrown out. - Accessible: Every flag is icon + text, never color alone, with WCAG AA contrast. Tabs work with the keyboard, the chart bars are focusable and the chart is also available as a table. It works at 360 px, and the print stylesheet prints only the card.
- Deployed on Deployxa.
Challenges we ran into
- Demoing a summer problem in November. Live forecasts were cool, so we added a replay mode over the historical archive and searched past summers for real weeks that hit Red and Black. That's where Maria's July 2023 week comes from.
- A trap inside a published formula. The regression's sun term is quadratic (+7.619·SR − 4.557·SR²), so past 0.836 kW/m² more sun makes the estimate go down. Desert noon gets close to that. We hold sun at the peak, which is the conservative choice, and the self-check guards it.
- An over-eager planner. Pure "minimize WBGT" told coaches to move practices that were already Green to 6 AM. We added a rule: keep the usual time if moving wouldn't lower the flag.
- Trusting AI with safety information. A wrong time in a parent message is a safety bug, so AI only writes the prose and code checks every time it outputs.
Accomplishments that we're proud of
- Every safety decision is deterministic, tested and cited. The flags, windows, caps and break times all come from pure functions with assertions. AI only touches wording, and even that has a deterministic check.
- It plans ahead and tells you what to do. Most heat tools read the current conditions. SidelineSafe tells you when to practice, for how long, and when to break.
- Free, global, no meter, no login. It works anywhere Open-Meteo has data, on a phone, at no cost to the volunteers who need it most.
- Honest about uncertainty. Estimates are shown as ±2°F, there's a meter override, and every card says it's for planning, not a substitute for an on-site meter or medical advice.
What we learned
- Humidity is the hidden danger. A humid 85°F day is more dangerous than a dry 95°F day, and that is exactly what a thermometer gets wrong.
- Being safe means being conservative. We rate the worst hour, not the average, hold the sun term at its peak, and never move a practice that's already safe.
- Put AI where it's good and fence it everywhere else. Translation and tone are a great fit for AI. Clock times are not.
- **Read the paper, not the blog post.
What's next for SidelineSafe
- Sending the message for you: SMS and push, so the family note goes out in one tap instead of copy-paste.
- Team rosters to track athletes, contacts and preferred languages. ## What we learned
- Humidity is the hidden danger. A humid 85°F day is more dangerous than a dry 95°F day, and that is exactly what a thermometer gets wrong.
- Being safe means being conservative. We rate the worst hour, not the average, hold the sun term at its peak, and never move a practice that's already safe.
- Put AI where it's good and fence it everywhere else. Translation and tone are a great fit for AI. Clock times are not.
- Read the paper, not the blog post. Checking coefficients and guideline text against their original sources caught things a quick copy would have missed.
What's next for SidelineSafe
- Sending the message for you: SMS and push, so the family note goes out in one tap instead of copy-paste.
- Team rosters to track athletes, contacts and preferred languages.
- A heat-acclimatization tracker that follows the 14-day heat-acclimatization period many state policies require.
- Lightning and air-quality alerts alongside heat.
- Meter calibration against real school WBGT readings, to tighten the ±2°F estimate.
- Pilots with youth leagues, camps and athletic departments that have no trainer.
Built With
- anthropic
- claude
- deployxa
- next.js
- node.js
- open-meteo
- openrouter
- react
- svg
- tailwind-css
- typescript