When should I run, and what should I wear?

How WeatherToRun grew from an hourly forecast into an iPhone app for planning a run, choosing what to wear, and revisiting the weather from a recorded workout.

Start with the decision

Before a run, I used to compare temperature, humidity, wind, and rain in my head. I wanted to know when to head out and what to wear.

I built WeatherToRun around an hourly score and clothing guidance, putting both ahead of the detailed forecast in my first web sketches. On iPhone, I carried that idea through the whole run, from choosing a window to looking back at the conditions during a recorded workout.

WeatherToRun sketch 1 - Main view explorationWeatherToRun sketch 2 - Component structureWeatherToRun sketch 3 - User flow design

Initial sketches of the main view, component structure, and user flow.

A score should not hide a bad condition

Each hour gets a score from 0 to 100, labeled Bad, OK, or Good. It combines temperature, dew point, wind and gusts, precipitation, and UV index.

A weighted average can make an hour look comfortable even when one condition is severe. Strong wind can therefore cap the score, while weather codes add penalties for hazards such as thunderstorms, freezing rain, and snow.

Research informs the formula, but the weights and thresholds are product decisions. The score helps compare forecast hours. Climate preferences adjust for acclimation, and separate clothing preferences let runners choose more or fewer layers.

Plan for the whole run

A morning can start cool and finish in direct sun. On Today, runners can tap an hour for conditions and clothing or drag across the chart to see what changes during the time they’ll be outside. Tapping a gear suggestion explains why it’s there, and Closet lets runners hide items they don’t wear.

Plan compares future windows of the same duration. I weighted each forecast hour by how much of the run falls within it, then gave extra weight to the toughest hour. The score breakdown shows which conditions drove the result. Recommendations skip windows that include a Bad hour, and runners can prefer windows that fit entirely in daylight.

With enough recent long runs in History, the app can estimate a typical duration and use the runner’s routine to choose among similarly scored windows. Once a runner picks a time, they can save it directly from Plan with an optional note. The run appears on the matching date in Today or Plan.

Review the weather from a completed run

History imports completed workouts from Apple Health, Garmin Connect, or COROS. A recap shows the recorded distance, duration, and pace, with the activity source and location side by side. When GPS is available, the app uses the route’s starting point and the workout’s time to look up historical weather and suggest clothing for similar conditions. For eligible workouts without GPS, runners can choose a city for that lookup.

WeatherToRun Plus adds weather by split and Weather trends. Split weather uses the estimated time of each split at the run’s location. To compare pace across conditions, I pair runs of similar distances and wait for at least three comparable pairs before showing a pattern. Runners can leave an unusual effort out of trends while keeping it in History.

WeatherToRun Plan on iPhone with a selected forecast window, a saved run, and recommended start timesWeatherToRun History on iPhone with workout stats, a Central Park route map, and the weather score for the run

Plan and History with example runs in New York.

Check conditions without opening the app

The free Home Screen widget shows the current running score and conditions. Plus adds widgets for clothing, hourly scores, and recommended windows. On Apple Watch, Plus shows current conditions and upcoming windows, with a forecast for the time a runner is considering.

I gave the forecast and outfit widgets a timeline that advances through the hours already loaded. That lets them show the right hour even when WidgetKit delays its next refresh.

Ask about analytics during setup

The iPhone app used to ask about usage analytics in Settings. New runners now get that choice during setup and can change it later in Settings.

Keep optional data separate

On the web, air quality has its own request and cache lifetime. Weather and scores can render while air quality loads, and they stay visible if that request fails.

The server retries eligible provider failures, and the client makes one retry for eligible route failures. Errors identify a timeout, network problem, or invalid response. Sentry records the operation, caller, status, and rounded coordinates so I can investigate.

Give each cache a clear responsibility

The browser requests weather through a Node.js API route. Apple WeatherKit is the default provider; an environment setting can select Open-Meteo.

I round coordinates to two decimal places so nearby requests can share a cache entry. The route allows five minutes of browser caching, an hour of CDN caching, and an hour of background revalidation. TanStack Query treats client data as fresh for an hour and refreshes on an hourly interval while the query is active.

These settings reduce repeated provider requests, with a freshness tradeoff: an hourly forecast may be cached rather than newly fetched.

Retire old behavior for returning users

An earlier version used a service worker. The current worker removes the old app caches and unregisters itself when it activates. Keeping that URL available gives returning users a way to retire the previous worker.

The current web app requires a network connection for forecasts. Its standalone display setting is separate from offline support.