Getting started
Concepts
The handful of words these pages use everywhere — programs, runs, halts, the active program and the people involved.
Trainerflow is built around a small vocabulary. Most of it will feel familiar to anyone who has written a training plan, but a few words have a precise meaning here, so let us pin them down before going any further.
Program
A program is a training plan written in Coach. It is a small project of
source files, with one of them, src/main.cl, as its entry point: when the
program runs, main.cl is what runs. A program can be split into as many files
as you like and can import the standard library.
You write a program once, in the SPDK, and you can run it as many times as you want. Writing it and running it are two separate things, which brings us to runs.
Program run
A program run (or just run) is a program being followed by an athlete. When you activate a program, Trainerflow takes a snapshot of its source at that moment and starts running it. From then on the run has a life of its own:
- it remembers every halt the athlete has gone through and everything they entered along the way,
- it keeps its own copy of the source, so editing the program does not disturb someone halfway through it,
- it has a status: running, paused or stopped.
We say that programs are edited while runs are advanced.
Halt
A halt is a point where a run stops and waits for the athlete. Every time an exec is called, or the program asks for a measurement, the run halts. The athlete sees the halt as a screen on their phone: the exercises with their targets, or a single question.
When the athlete continues, whatever they entered goes back to the program and the run moves on to the next halt. If they made a mistake they can step back, which undoes the latest halt as if it never happened.
Active program
Each person runs at most one program at a time. That run is their active program, and it is what the mobile app opens when they press play. Activating a new program while another one is active is not possible; stop the old run first.
Roles
Everyone with a Trainerflow account has a role:
| Role | What they do |
|---|---|
| Athlete | Writes their own programs and runs them. |
| Trainer | Writes programs and runs them for their trainees. A trainer can also run programs themselves. |
| Trainee | Runs the programs their trainer activates for them. Trainees do not write programs. |
A trainer and a trainee are connected by an invitation. You can read all about it in trainers and trainees.
Libraries
A library is a collection of Coach files that programs import from. The
one every program depends on is the standard library, called coach, which
holds ready-made actions, inputs, outputs and exercises. Libraries are released
in versions, so a program keeps working the same way even as the library grows.