Skip to the content.

Workout Templates & Athlete Logging System

Overview

The BPVA Calendar App now includes a comprehensive workout template and logging system specifically designed for pole vault training. This system allows coaches/admins to create detailed workout templates, and athletes to log their actual performance against those templates.

How Workouts Work

Two-Part System:

  1. Workout Templates (Created by Coaches)
    • Reusable workout plans you create as an admin/coach
    • Include all prescribed exercises, sets, reps, and pole vault parameters
    • Can be assigned to all athletes or specific groups
    • Athletes use these as a guide for their training
  2. Workout Logs (Completed by Athletes)
    • Individual athlete’s record of what they actually did
    • Based on your template but tracks their actual performance
    • Includes athlete notes, difficulty ratings, and your feedback
    • Helps you monitor athlete progress and compliance

Workout Template Structure

Template Information:

Workout Segments:

Each workout is divided into segments by type:

Exercise Details:

For each exercise in a segment, you can specify:

Standard Parameters:

Pole Vault Specific:

Additional Info:

Athlete Workout Logs

What Athletes Track:

When athletes complete your workout template, they log:

Actual Performance:

Subjective Feedback:

Completion Tracking:

Coach Feedback:

As an admin/coach, you can:

workout_logs

Legacy workouts Collection

The old workouts collection is still present but deprecated. It will eventually be migrated to the new template system.

Service Layer

WorkoutTemplateService

Located at: lib/services/workout_template_service.dart

Template Management (Coach/Admin):

Workout Log Management (Athlete):

Analytics:

UI Screens

Admin/Coach Screens

AdminWorkoutTemplateScreen

Location: lib/screens/admin/admin_workout_template_screen.dart

WorkoutTemplateEditorScreen

Location: lib/screens/admin/workout_template_editor.dart

Athlete Screens

AthleteWorkoutScreen

Location: lib/screens/athlete/athlete_workout_screen.dart

Two tabs:

  1. Available Tab:
    • Shows all visible workout templates
    • “Start” button to begin a workout
  2. My Logs Tab:
    • Shows athlete’s workout history
    • Progress indicators (completion percentage)
    • “Continue” button for incomplete workouts
    • View completed workouts

WorkoutLoggingScreen

Location: lib/screens/athlete/athlete_workout_screen.dart

Integration with Existing Features

Warmup Drills Integration

Workout segments can reference existing warmup drill groups:

WorkoutSegment(
  type: SegmentType.warmup,
  warmupDrillGroupId: "A0O081Yx66c2onp8geAO", // References warmup_drills collection
)

This allows coaches to reuse the comprehensive warmup drill library already built.

User Role Integration

The workout system respects existing role hierarchy:

Workflow Examples

Coach Creating a Template

  1. Navigate to Admin Dashboard → Workout Templates
  2. Click “New Template”
  3. Fill in basic info (name, goal, difficulty, duration, visibility)
  4. Add equipment needed
  5. Add segments (e.g., Warmup, Technique, Vaulting, Cooldown)
  6. For each segment, add exercises with prescribed parameters
  7. Save template

Athlete Logging a Workout

  1. Open “My Workouts” screen
  2. Navigate to “Available” tab
  3. Find desired workout and tap “Start”
  4. Work through each segment:
    • View prescribed exercise details
    • Enter actual sets, reps, weight performed
    • Mark exercises as completed
    • Add notes about performance
  5. Progress bar updates automatically
  6. When done, tap “Complete Workout”

Coach Reviewing Athlete Performance

  1. Navigate to admin area (future feature)
  2. View athlete workout logs
  3. See completion percentage and actual vs. prescribed values
  4. Add coach feedback/evaluation

Future Enhancements

Phase 2 Features

Phase 3 Features

Database Indexes

Recommended Firestore indexes (add to firestore.indexes.json):

{
  "indexes": [
    {
      "collectionGroup": "workout_templates",
      "queryScope": "COLLECTION",
      "fields": [
        { "fieldPath": "visibility", "order": "ASCENDING" },
        { "fieldPath": "createdAt", "order": "DESCENDING" }
      ]
    },
    {
      "collectionGroup": "workout_logs",
      "queryScope": "COLLECTION",
      "fields": [
        { "fieldPath": "userId", "order": "ASCENDING" },
        { "fieldPath": "scheduledDate", "order": "DESCENDING" }
      ]
    },
    {
      "collectionGroup": "workout_logs",
      "queryScope": "COLLECTION",
      "fields": [
        { "fieldPath": "userId", "order": "ASCENDING" },
        { "fieldPath": "completed", "order": "ASCENDING" },
        { "fieldPath": "scheduledDate", "order": "DESCENDING" }
      ]
    }
  ]
}

Testing

Unit Tests

Integration Tests

Widget Tests

Notes for Development

  1. Pole Vault Context: All exercise templates support pole vault-specific fields (grip height, pole used, approach steps, bar height)
  2. Offline Support: Consider implementing offline persistence for workout logging (athletes may not have internet in gym)
  3. Media Uploads: Video URLs are stored as strings - integrate with Firebase Storage for actual video uploads
  4. Performance: Use pagination for workout log lists if athletes accumulate many logs
  5. Validation: Add validation for pole vault measurements (e.g., grip height should be less than pole length)

Migration from Legacy System

The old workouts collection used a simpler structure. To migrate:

  1. Create a migration script to convert old workouts to templates
  2. Preserve old data by copying to workout_templates with appropriate metadata
  3. Add deprecation notice in old workout management screen
  4. Eventually remove old collection after full migration

For questions or support, contact the development team or refer to the main app documentation in .github/copilot-instructions.md.