Skip to content

UgoLambert/Sporto

Repository files navigation

Musculation Program Generator

A comprehensive web application that generates personalized strength training (musculation) programs based on user preferences and goals. Built with Python Flask and integrated with the ExerciseDB API.

Features

🎯 Personalized Programs

  • Training Objectives: Muscle gain (hypertrophy) or weight loss (fat burning)
  • Flexible Frequency: 1-7 training days per week with appropriate splits
  • Equipment Options: Gym equipment or bodyweight-only workouts

💪 Smart Program Generation

  • Training Splits: Automatically selects optimal splits based on frequency
    • 1-2 days: Full body workouts
    • 3-4 days: Upper/lower or push/pull/legs splits
    • 5+ days: Body part splits
  • Exercise Selection: Prioritizes compound movements and balances muscle groups
  • Progressive Parameters: Sets, reps, and rest periods tailored to objectives

🌐 ExerciseDB Integration

  • Access to thousands of exercises with detailed instructions
  • Exercise filtering by muscle groups and equipment
  • GIF demonstrations when available
  • Comprehensive exercise database

📱 User Experience

  • Responsive Design: Works perfectly on desktop, tablet, and mobile
  • Interactive Interface: Clean, modern UI with Bootstrap 5
  • Export Functionality: Print or download programs as text files
  • Exercise Demos: Modal popups with instructions and animations

Installation & Setup

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)
  • Internet connection (for ExerciseDB API)

Quick Start

  1. Clone or download the project

    cd /path/to/your/workspace
  2. Install dependencies

    pip install -r requirements.txt
  3. Run the application

    python app.py
  4. Open your browser Navigate to http://localhost:5000

Development Setup

  1. Create virtual environment (recommended)

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  2. Install dependencies

    pip install -r requirements.txt
  3. Set environment variables (optional)

    export FLASK_ENV=development
    export SECRET_KEY=your-secret-key-here
  4. Run with debug mode

    python app.py

Project Structure

musculation-app/
├── app.py                 # Main Flask application
├── api_service.py         # ExerciseDB API integration
├── program_generator.py   # Workout program generation logic
├── requirements.txt       # Python dependencies
├── README.md             # This file
├── static/
│   ├── css/
│   │   └── style.css     # Custom styles
│   └── js/
│       └── main.js       # Frontend JavaScript
└── templates/
    ├── base.html         # Base template
    ├── index.html        # Main form page
    └── program.html      # Generated program display

Usage Guide

Generating a Program

  1. Select Your Objective

    • Muscle Gain: Focus on hypertrophy with 6-12 reps, longer rest periods
    • Weight Loss: Higher reps (12-20), shorter rest, circuit-style training
  2. Choose Training Frequency

    • Consider your schedule and experience level
    • 3-4 days per week is optimal for most people
  3. Equipment Availability

    • Gym Equipment: Access to weights, machines, cables
    • Bodyweight Only: No equipment needed, perfect for home workouts
  4. Generate Program

    • Click "Generate My Program" and wait a few seconds
    • Your personalized program will be displayed

Using Your Program

  • Exercise Instructions: Click the demo/info buttons for detailed guidance
  • Print Program: Use the print button for offline access
  • Export Program: Download as text file for your phone or notes
  • Progressive Overload: Follow the progression guidelines provided

API Endpoints

The application also provides REST API endpoints:

  • GET /api/exercises/search?q=exercise_name - Search exercises
  • GET /api/exercises/muscle/<muscle_name> - Get exercises by muscle
  • GET /health - Health check and API status

Training Science Behind the App

Program Design Principles

  1. Frequency Distribution

    • Lower frequencies focus on full-body compound movements
    • Higher frequencies allow for specialized muscle group targeting
  2. Exercise Selection

    • Prioritizes compound movements (squats, deadlifts, presses)
    • Balances primary and secondary muscle groups
    • Considers equipment limitations
  3. Volume and Intensity

    • Muscle Gain: 3-4 sets, 6-12 reps, 2-3 min rest
    • Weight Loss: 2-3 sets, 12-20 reps, 30-60 sec rest

Supported Training Splits

  • Full Body: All major muscle groups each session
  • Upper/Lower: Upper body and lower body alternating
  • Push/Pull/Legs: Movement pattern based split
  • Body Part Split: Individual muscle groups per session

Troubleshooting

Common Issues

Program not generating?

  • Check internet connection (requires ExerciseDB API access)
  • Try refreshing the page and generating again
  • Check browser console for errors

No exercises showing?

  • API might be temporarily unavailable
  • The app will show a basic fallback program
  • Try again in a few minutes

Exercises not loading?

  • Some exercises may not have complete data
  • Instructions are still provided for proper form

Browser Compatibility

  • Recommended: Chrome, Firefox, Safari, Edge (latest versions)
  • Mobile: iOS Safari, Chrome Mobile
  • Requirements: JavaScript enabled

Contributing

Code Structure

  • app.py: Flask routes and application logic
  • api_service.py: ExerciseDB API wrapper with caching and rate limiting
  • program_generator.py: Core workout generation algorithms
  • templates/: Jinja2 HTML templates
  • static/: CSS and JavaScript assets

Adding Features

  1. New Exercise Filters: Extend api_service.py
  2. Training Splits: Modify program_generator.py
  3. UI Components: Update templates and static files

License

This project is open source and available under the MIT License.

Acknowledgments

  • ExerciseDB API: Provides comprehensive exercise database
  • Bootstrap 5: Modern, responsive UI framework
  • Font Awesome: Beautiful icons throughout the interface
  • Flask: Lightweight and powerful Python web framework

Support

For issues, questions, or contributions:

  1. Check existing documentation
  2. Review the troubleshooting section
  3. Open an issue with detailed information

Built with ❤️ for the fitness community

Transform your fitness journey with personalized, science-based workout programs.

About

A vibe coded web app to create a gym program. It's ugly but it was fun ;)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published