mat-d3v/ravito 是一个托管在 GitHub 上的开源项目,主要使用 TypeScript 编写,采用 MIT License 许可证。
仓库全名
mat-d3v/ravito
README 摘要
Open Ravito | See the demo | Lire en français Drop the race GPX and your past runs. Ravito tells you when you'll reach each aid station, how much margin you have on every cutoff, and prints a pace band for your wrist. Everything runs in your browser. No account, no server, no tracking: your files never leave your computer. Why another planner? Watch makers (Garmin…
Drop the race GPX and your past runs. Ravito tells you when you’ll reach each aid station, how much margin you have on every cutoff, and prints a pace band for your wrist.
Everything runs in your browser. No account, no server, no tracking: your files never leave your computer.
Why another planner?
Watch makers (Garmin PacePro, COROS Pace Strategy) and a few web tools already split a course by gradient, some using your fitness data. Ravito differs in three ways:
A transparent, per-gradient calibration. Ravito shows how fast you actually go at −20 %, 0 % or +25 % from your own runs, next to the generic model, with the amount of data behind each point. No black box.
Built for long races. The plan accounts for fatigue after hours on your feet, and for stops at aid stations, so cutoff margins are realistic.
Open, private, brand-agnostic. Free software, a single static page, works with files from any watch.
Features
Course import: GPX (with aid stations read from its waypoints), TCX, FIT, and .gz versions.
History import: individual files or your whole Strava export (.zip or unzipped folder). With activities.csv, walks, hikes and rides are left out automatically.
Robust elevation handling: fixed-step resampling, smoothing and a 3 m hysteresis threshold, so noisy GPS altitude doesn’t inflate the gain or the grades.
Two modes: predict my time (intensity slider) or aim for a time (Ravito finds the matching effort).
Aid stations: stop time and clock cutoffs (multi-day races supported); the margin turns red when you’re too late.
Interactive elevation profile, per-section table, kilometre splits, CSV export and a printable pace band.
Under “Download your account”, click Get Started, then request the download.
Strava emails you the archive, usually within a few hours.
Drop the .zip into Ravito as it is.
More in Strava’s help. Files from Garmin Connect, COROS or Suunto work too: export them as GPX, TCX or FIT.
Connecting Strava directly (local version)
For people comfortable with a terminal: instead of waiting for the export email, Ravito can read your runs straight from the Strava API. It runs on your own machine, with your own Strava API application, so no third-party server ever sees your data or your keys.
Create your Strava API application at strava.com/settings/api. Any name works; set Authorization Callback Domain to 127.0.0.1.
In this folder, run:
npm install
npm run strava
On first run, paste your Client ID and Client Secret (or set STRAVA_CLIENT_ID and STRAVA_CLIENT_SECRET). Ravito opens in your browser at http://127.0.0.1:5180.
Click Connect to Strava, allow access, and your recent runs load on their own.
Good to know:
Only runs are fetched (Run and Trail Run, the 200 most recent; change it with npm run strava -- --max=300). Each run is downloaded once, then kept in a local cache.
Strava limits how many requests an app can make every 15 minutes. If you hit the limit, Ravito pauses and resumes on its own.
Credentials, tokens and cache live in ~/.config/ravito (or RAVITO_HOME). npm run strava -- --forget deletes them all.
New Strava API apps only accept their own owner (“Single Player Mode”): that’s exactly this use, so no review by Strava is needed.
How the model works
Course: the track is resampled every 25 m and the elevation smoothed over 150 m before grades are computed.
Generic curve: speed relative to flat ground follows the energy cost of running on slopes (Minetti et al., 2002), softened for hiking on steep climbs. On descents, the gain is capped at about +10 % around −8 %, then speed drops on steep, technical ground.
Your curve: each run is cut into 100 m pieces (stops removed). Walks tagged as runs on Strava are left out: their median speed on rolling terrain is under 6.5 km/h. Recent runs count more (60-day half-life), so the curve follows your current fitness. For each 2 % gradient class, your median speed is blended with the generic curve according to how much data you have. On climbs, speed is forced to keep decreasing as the slope steepens.
Race simulation: every 25 m, speed = your curve × intensity × fatigue factor. Fatigue kicks in after 1.5 h (training runs already include it) and grows with elapsed time; the “slowdown with fatigue” slider sets how fast.
The engine (src/engine/) is pure TypeScript with no DOM, covered by unit tests: recovering a known runner’s curve from synthetic runs, ignoring pauses, rejecting bike rides, solving a target time, aid-station timing.
How accurate is it?npm run backtest -- "<Strava export folder>" predicts each of your runs from your earlier runs only, and reports the error. On a test history of 99 runs, the median error on moving time is 4.3 % (mean 5.5 %). Most of that error comes from runs done at different intensities, which no model can know in advance.
Running it locally
npm install
npm run dev # http://localhost:5173/ravito/
npm test # engine tests
npm run build # static site in dist/
Add ?demo to the address to load the demo course, and ?lang=fr or ?lang=en to pick the language. The demo course and demo runner are fully synthetic; no real race track is redistributed.
Roadmap
Post-race analysis: compare plan vs. actual, section by section, and refine your curve.
评论