A self-hosted endurance training platform for runners, cyclists, and multi-sport athletes.
Website · Documentation · Self-hosting · 简体中文 · AGPL-3.0-only
Important
Production installation uses only an exact-version, signature-verified Docker release bundle from GitHub Releases. The source workflow below is intended for evaluation and development rather than production installation.
Trainingload.ai turns completed workouts into training context you can act on. Import FIT, TCX, or GPX files, connect an Intervals.icu account with a personal API key, inspect pace, heart-rate, power, route, and load data, then connect that evidence to a calendar and training plan.
This repository provides an open-source, self-hosted training app. Your structured data stays in your PostgreSQL instance, uploaded files stay on local storage, and official telemetry is disabled. The AI coach supports OpenAI, DeepSeek, OpenRouter, DashScope, and custom OpenAI-compatible services, with configurable API keys, base URLs, and models.
Trainingload.ai is designed around a complete training loop:
plan → complete a workout → analyze the activity → review training load → confirm the next adjustment
For athletes comparing an open-source, self-hosted alternative to TrainingPeaks, Intervals.icu, or Runalyze, Trainingload.ai focuses on combining running and cycling analysis, PMC-style load trends, planning, and an AI coach that connects to supported providers. Feature coverage is different, so review the self-host boundaries before migrating.
These screens are rendered from the current Self-host Client with deterministic sample data.
| Training calendar | AI coach |
|---|---|
![]() |
![]() |
- Activity import and analysis — upload FIT, TCX, and GPX files; review GPS routes, laps, pace, heart rate, power, elevation, and derived metrics.
- Training load and fitness trends — follow TSS or TRIMP-based load, Intensity Factor, CTL, ATL, TSB, PMC-style trends, zones, thresholds, and effective VO2max context.
- Plans, workouts, and calendar — build and follow running, cycling, multi-sport, endurance, and strength plans; compare planned work with completed activities.
- AI coach across supported providers — connect OpenAI, DeepSeek, OpenRouter, DashScope, or a custom OpenAI-compatible endpoint for activity reviews, plan drafts, follow-up questions, and confirmable adjustments.
- Evidence-based workflow — recommendations can use athlete profile, activity history, current load, plan progress, and prior reviews instead of treating one metric as the full story.
- Local data ownership — training data stays in your own PostgreSQL database and uploaded files stay on your own server. You can export or delete account data at any time, with documented backup and restore workflows.
- Open maps — self-host includes activity route maps powered by MapLibre, with support for OpenFreeMap, OSM-compatible map services, and custom map configurations.
- Internationalized product and docs — the application and documentation include multiple locales, with English fallback where a translation is incomplete.
AI output is training guidance, not medical diagnosis. Training metrics are models and should be interpreted together with context and how you feel.
Requirements: Docker Engine or Docker Desktop with Compose v2, Node.js 22+, pnpm 9+, 2 CPU, 2 GiB RAM, and at least 5 GiB of free disk space.
corepack enable
pnpm install --frozen-lockfile
# Inspect the initialization plan, then create local secrets and data folders.
pnpm self-host -- init --dry-run --json
pnpm self-host -- init --json
# Inspect the Docker source-build plan, then build and start the complete stack.
pnpm self-host -- start --source --dry-run --json
pnpm self-host -- start --source --jsonOpen http://localhost:43210, enter your name, and complete onboarding. The default listener is 127.0.0.1; keep it on loopback unless you provide an authenticated HTTPS reverse proxy.
The management CLI generates three independent instance secrets and never prints them. It starts PostgreSQL, a permission initializer, database migrations, Server, and Client. Docs and Caddy are not part of the runtime stack.
Production installation uses the exact-version release bundle described in SELF_HOSTING.md. CI builds, scans, and signs linux/amd64 and linux/arm64 images, and the bundle pins every image by digest.
flowchart LR
Browser[Browser] --> Client[Next.js Client and BFF]
Client --> Server[NestJS Server]
Server --> Database[(PostgreSQL)]
Server --> Files[Local file storage]
Server -. optional outbound .-> AI[Owner-selected AI provider]
Server -. optional outbound .-> Intervals[Intervals.icu API]
Server -. optional outbound .-> Garmin[Garmin Personal API]
The browser reaches one Client port. The Server and PostgreSQL stay on the private Compose network. Uploaded files use local storage, notifications stay in the application, and AI providers, Intervals.icu, and Garmin Personal API are optional outbound connections. COROS MCP is not enabled on Self-host.
| Area | Self-host behavior |
|---|---|
| AI | OpenAI, DeepSeek, OpenRouter, DashScope, or a custom OpenAI-compatible service |
| Imports | FIT, TCX, GPX, Intervals.icu personal API key, and Garmin Personal API |
| Maps | MapLibre with OpenFreeMap, OSM-compatible, or custom map configuration |
| Storage | PostgreSQL plus local uploaded-file storage |
| Product access | Core training features and BYOK AI are available directly |
| Telemetry | Official telemetry is fixed off in the signed self-host configuration |
| Network | Loopback by default; remote exposure is an operator security decision |
See known limitations before choosing a production topology.
| Path | Purpose |
|---|---|
apps/client |
Next.js product UI and same-origin BFF |
apps/server |
NestJS API, training domain services, workers, and self-host entrypoint |
apps/docs |
Product documentation and training knowledge site; built separately |
packages/prisma |
Prisma schema, generated Client, and self-host migration lineage |
packages/messages |
Client and server message catalogs |
packages/shared |
Shared training contracts, types, and plan templates |
scripts/selfhost |
Install, lifecycle, backup, restore, diagnostics, and release verification tools |
docker/selfhost |
Machine-readable image, Compose, and release contracts |
corepack enable
pnpm install --frozen-lockfile
pnpm prisma:generate
pnpm boundary:check
pnpm messages:check
pnpm selfhost:inventory:check
pnpm build:selfhost
pnpm test:selfhost
# Regenerate the deterministic Self-host screenshots used in this README.
pnpm screenshots:readmeBuild the documentation separately with pnpm docs:build. Running the product does not require the Docs application.
Cross-package dependencies must use declared package exports rather than unpublished internal paths.
Self-host supports connecting Garmin with a Garmin Personal API key. COROS MCP is not enabled on Self-host. The managed/closed-source product adds Garmin Developer API separately.
- Architecture and deployment composition
- Install and configure self-host
- Operate and troubleshoot an instance
- Known limitations
- Back up and restore
- Upgrade and roll back
- Get support
Read CONTRIBUTING.md and the Code of Conduct before participating. Use SUPPORT.md for product and deployment questions. Report vulnerabilities through the private process in SECURITY.md, never through a public issue.
Trainingload.ai public code is licensed under AGPL-3.0-only. External contributions are accepted under the same license. A separate written agreement is required before a contribution can be used under a separate commercial license.
The AGPL desktop app lives in apps/desktop. It packages this same checkout's Client, Server, and migrations with Electron and PGlite. Build with pnpm desktop:build and run with pnpm desktop:start; see the desktop README for local packaging and signing status.


