The Routine Builder is FocusFlow’s advanced programming tool for coaches. It lets you construct structured, multi-day training blocks for individual athletes — complete with exercise selection, set and rep schemes, RPE or RIR intensity targets, expected loads, and optional per-set customization. Every routine you build is stored in Firestore, tied to the athlete’s profile, and immediately visible to them in their workout panel when marked active.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/piratta/gymApp/llms.txt
Use this file to discover all available pages before exploring further.
Opening the Routine Builder
The Routine Builder can be opened from two places inside FocusFlow:Athlete's Routines Sub-tab
Navigate to Athletes → [Athlete] → Routines, then click New Routine or the edit icon on an existing routine. The builder opens pre-loaded with that athlete’s data.
Templates Tab
Navigate to Exercises & Templates → Mis Plantillas Planificadas, then click a template’s Modificar button. The same editor interface opens, operating on the generic template rather than an athlete-specific routine.
Routine Structure
FocusFlow routines follow a four-level type hierarchy:Routine → RoutineDay → RoutineExercise → ExerciseSet. Understanding these types helps you reason about how data flows from the builder into the athlete’s live workout session.
Routine
The top-level container, scoped to a specific athlete viaclientId.
RoutineDay
A single training day within the routine.RoutineExercise
An exercise assigned to a day, holding all programming parameters.ExerciseSet
An individual set record, used both for programming targets and for tracking athlete performance.When
customized is false on a RoutineExercise, all sets share the same repsText and intensity values. When customized is true, each ExerciseSet has its own targetReps and targetRpe, allowing wave loading, back-off sets, and other advanced schemes.Building a Routine Step by Step
Name the routine and set dates
In the General Configuration panel on the left, enter a block name (e.g., “Hypertrophy Mesocycle 1”). Optionally set a Start Date and End Date to give the block a defined duration. These dates are stored on the
Routine object and displayed to the athlete.Set a global rest timer
Enter a value in Global Rest (seconds) — for example,
180 for a 3-minute rest. This becomes the default rest timer between sets in the athlete’s live workout session. Individual exercises can override this if needed. The value is stored as globalRestSeconds on the Routine.Add training days
Click Agregar Día in the Days Structure panel. FocusFlow automatically names new days sequentially (Día 1, Día 2, …). Rename each day to reflect its training focus — for example:
Day A – Push (Chest / Shoulders / Triceps)Day B – Pull (Back / Biceps)Day C – Legs (Quads / Glutes / Hamstrings)
Add exercises to each day
With a day expanded, click Añadir Ejercicio. A search panel appears with:
- A text search field (debounced, 150 ms) — filters by exercise name.
- A category filter dropdown — narrow results to Pecho, Espalda, Piernas, etc.
Configure each exercise
For every exercise you can set:
You can also reorder exercises within a day using the ▲ / ▼ arrows (visible on hover), or mark an exercise as Optional so it doesn’t count against compliance if skipped.
| Field | Description |
|---|---|
| Sets | Number of working sets (setsCount) |
| Reps (Target) | Free-text rep target (repsText): "8-10", "5", "12-15" |
| Intensity | RPE or RIR string (intensity): "RPE 8", "RIR 2", "Failure" |
| Base Weight (kg) | Suggested starting load (expectedWeight) |
| Notes | Per-exercise cues shown to the athlete: "Tempo 3:0:1", "Pause at bottom" |
Per-Set Customization
By default, all sets in an exercise share the samerepsText and intensity. Toggle Personalizar Series on any exercise to switch into per-set mode — each set gets its own targetReps and targetRpe fields.
This is useful for:
- Wave loading —
8 @ RPE 7,6 @ RPE 8,4 @ RPE 9 - Back-off sets — heavy top sets followed by lighter volume sets
- AMRAP finishers — last set is max reps while the earlier sets are fixed
customized is active you can:
- Add a set — click Añadir Serie; the new set inherits the previous set’s values.
- Edit any set — change
targetRepsandtargetRpeinline. - Remove a set — click the trash icon; remaining sets are automatically re-indexed.
repsText and intensity.
Toggling off customization resets per-set overrides. The
setsCount is preserved so you don’t lose the number of sets, only the individual targets.Template Loading
The Plantillas Rápidas panel on the left side of the Routine Builder lets you load any of your saved workout templates directly into the routine being built. Select a template from the dropdown — FocusFlow will deep-clone all days and exercises (assigning fresh IDs to everyRoutineDay and RoutineExercise) so editing the loaded routine never affects the original template.
Active vs. Next Routine
An athlete can have more than one routine in their profile at the same time. TheisActive flag controls which one is currently running.
Active Routine
isActive: true — the routine shown to the athlete in their daily workout panel. Only one routine should be active at a time.Next Routine
isActive: false — a second routine queued to start. The coach can build the next training block in advance without disrupting the current program.isActive: true by default. You can toggle isActive from the athlete’s Routines sub-tab to swap which block is live.
Exporting Routines
FocusFlow can generate a printable HTML sheet of any routine or template usinggenerateTemplateHTML() from src/utils/exporters.ts. The output is a fully styled, print-ready HTML document with a table of every day and exercise — suitable for handing to the athlete as a PDF or physical printout.
| Parameter | Type | Description |
|---|---|---|
template | object | An object with name, optional description, and days array |
coachFullName | string | Coach’s full name, printed in the document header |
coachEmail | string | Coach’s email, printed in the document header |
dateStr | string (optional) | Override the date string; defaults to today in es-ES locale |
- A teal gradient header card with the template name, description, coach info, and date.
- One table per training day listing exercise name, category, sets, reps (or per-set breakdown for customized exercises), expected load, RPE/intensity, and coaching notes.
- A print button and
window.print()trigger on load.
Columns in the exported table
Columns in the exported table
| Column | Source field |
|---|---|
| EXERCISE | RoutineExercise.name |
| CATEGORY | RoutineExercise.category |
| SETS | RoutineExercise.setsCount |
| REPS | repsText or per-set breakdown if customized: true |
| LOAD | RoutineExercise.expectedWeight (kg) |
| RPE/INT | RoutineExercise.intensity or “Personalizado” |
| NOTES | RoutineExercise.notes |