PaceMind

A web app that predicts the finishing time on a trail or ultra GPX route, calibrated on the runner's own Strava history. It includes an AI coach for pacing strategy and training plans. It is a personal project, open source soon.

Why I built it

I am a runner, and the time calculators I found use a constant pace corrected for elevation. I wanted an estimate that accounted for how I run uphill, downhill and when tired, and that also said how uncertain it is: not a crystal ball, but a range.

The idea started in 2022 and 2024 as prototypes (a training calendar, which stayed an experiment). I picked it up again in 2026 with Claude Code, which wrote much of the code while I decided what to build and checked the result.

Time prediction on a GPX route, with confidence interval and method used.

How it works

The prediction has three levels. The first uses a physical model of the cost of running uphill and downhill (Minetti), with no personal data. The second learns the user's parameters after at least five Strava activities. The third is a statistical correction on the second one's errors, and it switches on only if it does better than the previous level on recent runs: otherwise it stays out. The estimate has an 80% interval.

The route is split into 50-metre segments and enriched with surface type (OpenStreetMap), weather, training load and intensity from heart rate. Past races are recognised automatically in the history.

The AI coach can change plans, waypoints and strategy through defined tools, has safety limits and a daily token budget per user. Training plans start from templates (trail 30K, 50K, 80K, marathon) and are compared with actual activities.

A few screens

Technical choices

  • The machine-learning level is used only if it proves it beats the physics: a simple, honest estimate is better than a complicated, worse one.
  • The backend is Python (Flask, SQLAlchemy), the interface is Vue 3 with a Leaflet map and ECharts charts.
  • Paid plans with Stripe (free, subscription, race-week pass), with limits enforced by the server and not by the interface.
  • Usage statistics (Plausible, PostHog) are off unless configured.

What I did

The whole project: prediction model, activity import and analysis, AI coach, training plans, payments and interface, working with Claude Code. It is about 220 commits, 64,000 lines of Python and 20,000 of Vue and TypeScript, with 98 test files.

Honest limits

It is in beta and does not yet have a public service with users: the screens above come from a test copy with fake data, and the demo with a sample route is the only part reachable without an account. It depends on Strava, and fetching activities is the most fragile part. Still to do, among other things, are Garmin and Coros integration and in-race tracking.

Stack: Python, Flask, SQLAlchemy, scikit-learn, Vue 3, Vite, Pinia, Tailwind, Leaflet, ECharts, PostgreSQL, Stripe, Docker, Nginx.