Skip to main content

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.

Workout templates in FocusFlow are generic, reusable training programs that are not tied to any specific athlete. A template defines a complete day-by-day training structure — including exercises, sets, reps, intensity targets, and coaching notes — that you can build once and clone to any athlete’s routine with a single click. Templates save significant time when you work with groups of athletes following similar training methodologies, and they serve as the foundation for your programming library.

The WorkoutTemplate Type

Templates share the same internal structure as athlete-specific routines, using RoutineDay and RoutineExercise objects, but they are stored independently in Firestore and carry no clientId.
export interface WorkoutTemplate {
  id: string;
  name: string;
  description: string;
  days: RoutineDay[];
  globalRestSeconds?: number; // Default rest period between sets, in seconds
  coachId?: string;           // Scopes the template to the coach who created it
}
FieldRequiredDescription
idYesAuto-generated ("temp_" + Date.now() + random suffix)
nameYesDescriptive template name, e.g. "PPL – Hypertrophy 6-Day"
descriptionYesBrief objective or target audience, e.g. "Anterior deltoid, pec, tricep focus"
daysYesArray of RoutineDay objects — the full day-by-day program
globalRestSecondsNoInherited by routines cloned from this template
coachIdNoSet automatically to the logged-in coach’s id
The days field uses the same RoutineDayRoutineExerciseExerciseSet hierarchy as athlete routines. See the Routine Builder reference for full type documentation on those nested types.

Creating a Template

1

Open the Templates sub-tab

In the coach dashboard, navigate to Exercises & Templates, then click the Mis Plantillas Planificadas sub-tab. You’ll see a gallery of all your existing templates plus a button to create a new one.
2

Start a new template

Click + Plantilla a Mano (the amber gradient button in the top-right corner). FocusFlow opens the TemplateHandmadeEditor — the same editing interface used in the Routine Builder — with blank fields.
3

Name and describe the template

Fill in:
  • Template Name (required) — give it a clear, descriptive name you’ll recognize when loading it: "Push – Hypertrophy Male", "Torso A – Heavy", "Fullbody 3×/week Beginner".
  • Description / Objective — describe the training goal or population, e.g. "Anterior delts, pec, and triceps focus. Hypertrophy range 8–12 reps".
  • Global Rest (s) — optional default rest timer in seconds (e.g., 180 for 3 minutes). Cloned routines inherit this value.
4

Add training days

Click the + button in the Day Distribution left panel to add a training day. FocusFlow names it automatically (Día 1, Día 2, …). Click any day in the left panel to open it in the right workspace, then:
  • Edit the day name — e.g., "Day 1: Heavy Torso", "Day B – Pull".
  • Add coaching notes — general instructions shown at the top of the day when the athlete trains.
  • Check Mark day as optional if athletes can skip this day without it counting against their compliance rate.
You can duplicate any day (copy icon) or delete it (trash icon) from the left panel.
5

Add and configure exercises

With a day open in the right workspace, use the SearchableExerciseDropdown at the bottom to find exercises from your catalog. Type a name or browse by category, then select an exercise to add it to the day’s list.For each exercise, set:
FieldExample
Sets4
Reps8-12, 3x10, 5
Methodology / RPERPE 8, RIR 2, Fallo
Initial Load (kg)60
Individual Instruction"Tempo 3:0:1, strict 2min rest"
Quick-pick shortcuts below the Reps and RPE fields let you apply common schemes (3x10, 4x12, 5x5, 3x8 / RPE 8, RPE 9, RIR 2, Fallo) in one click.Use the ▲ / ▼ buttons to reorder exercises within a day.
6

Enable per-set customization (optional)

Check the ⚙️ Personalizar series una a una checkbox on any exercise to unlock a set-by-set table where each row has its own Reps and RPE columns. Use + Añadir Serie and − Quitar Serie to adjust the set count. This is ideal for wave-loading schemes or exercises with planned back-off sets. See the Routine Builder – Per-Set Customization section for the full ExerciseSet type reference.
7

Save the template

Click Guardar Nueva Plantilla (or Guardar Modificaciones if editing an existing one) in the bottom action bar. The template is written to Firestore, appears in the template gallery, and is immediately available as a load option in the Routine Builder.

Cloning a Template to an Athlete

Loading a template into an athlete’s routine is a one-click operation from two different places:

From the Routine Builder

With the Routine Builder open for any athlete, find the Plantillas Rápidas panel on the left. Select the template from the dropdown. FocusFlow deep-clones all days and exercises — assigning fresh unique IDs to every RoutineDay and RoutineExercise — so the athlete’s routine is a fully independent copy.

From the Athlete's Routines Sub-tab

Navigate to Athletes → [Athlete] → Routines and open the Routine Builder. The Plantillas Rápidas panel on the left lists all your saved templates. Selecting one populates the builder immediately, ready for any athlete-specific adjustments before saving.
If the routine already has days configured when you load a template, FocusFlow will prompt for confirmation before replacing the existing structure. Choosing to proceed replaces all current days and exercises with the template’s cloned data.
The clone process assigns new IDs using the pattern:
  • Days: "day_" + Date.now() + "_" + randomSuffix
  • Exercises: "re_" + Date.now() + "_" + randomSuffix
This ensures no ID collisions between the template and any previously saved routines.

Common Template Patterns

Here are the most widely used template structures coaches build in FocusFlow:
A classic hypertrophy split dividing the week by movement pattern. Typically run 2× per week (6 days) or 1× per week (3 days).
DayFocus
Day 1 – PushChest, anterior/lateral deltoids, triceps
Day 2 – PullBack (width + thickness), rear delts, biceps
Day 3 – LegsQuads, hamstrings, glutes, calves
In FocusFlow, create three days and populate each from the relevant catalog categories (Pecho + Hombros + Brazos for Push, Espalda + Brazos for Pull, Piernas for Legs).
A frequency-focused split that trains upper and lower body twice per week, ideal for intermediate athletes.
DayFocus
Day A – Upper (Heavy)Horizontal push + pull, overhead press
Day B – Lower (Heavy)Squat pattern, hip hinge
Day C – Upper (Volume)Higher rep variations of Day A movements
Day D – Lower (Volume)Higher rep variations of Day B movements
The “optional” flag on days is useful here — mark Day C and Day D as optional for athletes who can only train 3 days per week.
Full-body sessions hitting every major muscle group each training day. Best for beginners or athletes with limited training frequency.
DayStructure
Day ASquat compound + Horizontal push + Horizontal pull + Accessory
Day BHip hinge compound + Vertical push + Vertical pull + Accessory
Alternate Day A and Day B across the week. Use globalRestSeconds: 180 as a starting rest period and RPE 7–8 targets while the athlete builds work capacity.
FocusFlow’s template editor places no constraints on day count or structure. Common custom splits include:
  • Bro Split (5-day): Chest / Back / Shoulders / Arms / Legs
  • Conjugate / Westside-inspired: Max Effort Upper, Max Effort Lower, Dynamic Upper, Dynamic Lower
  • Sport-specific periodization: In-season maintenance blocks with reduced volume and 2–3 days/week
  • Corrective programs: Mobility-first days with bodyweight movements at low RPE targets
Name each day clearly in the RoutineDay.name field so athletes understand the session focus at a glance.

Editing Templates

You can modify any saved template at any time from the template gallery:
  1. Navigate to Exercises & Templates → Mis Plantillas Planificadas.
  2. Click Modificar (pencil icon) on the template card.
  3. The TemplateHandmadeEditor opens pre-populated with the template’s current data (a deep clone, so you’re editing safely).
  4. Make changes to days, exercises, reps, or intensity values.
  5. Click Guardar Modificaciones.
Template edits do not retroactively affect routines that have already been cloned to athletes. Each clone is a fully independent copy stored under the athlete’s profile. If you update a template after cloning it to several athletes, those athletes’ routines remain unchanged — you would need to re-clone and re-apply the template if you want them to receive the updates.

Exporting Templates as PDF

Any template can be exported as a formatted, print-ready HTML document using the generateTemplateHTML() function from src/utils/exporters.ts. This generates a professional-looking PDF with a branded header, coach name and email, and a day-by-day table of exercises.
import { generateTemplateHTML } from "@/utils/exporters";

const exportTemplateToPDF = (template: WorkoutTemplate, coach: User) => {
  const printWindow = window.open("", "_blank");
  if (!printWindow) {
    alert("Please allow popups to export to PDF.");
    return;
  }

  const htmlContent = generateTemplateHTML(
    template,
    coach.fullName,
    coach.email
  );

  printWindow.document.write(htmlContent);
  printWindow.document.close();
  // window.print() is called automatically on load via the generated script tag
};
The exported document includes:
  • A teal gradient header with the template name, description, coach name, coach email, and generation date.
  • One section per training day with a full exercise table (name, category, sets, reps, load, RPE/intensity, notes).
  • For exercises with customized: true, the reps column shows each set’s individual targetReps (targetRpe) separated by | rather than a uniform rep range.
  • A print button and an auto-print trigger (window.print()) so the coach or athlete can save directly to PDF.
In the template gallery, every template card has an Exportar PDF button (teal icon) that calls this function directly — no custom code needed. Use it to hand printed programs to athletes before a session or attach them to email check-ins.

Build docs developers (and LLMs) love