Skip to content

Torelli/ai_personal_trainer

Repository files navigation

💪 AI Personal Trainer

AI Personal Trainer is a Flutter-based application designed to generate personalized workout plans using OpenAI's GPT model. The app allows users to specify their training preferences, such as training days, goals, modalities, and duration, and generates a tailored workout plan based on these inputs.

✨ Features

  • 🛠️ Customizable Workouts: Define your training days, fitness goals, preferred training modalities, and workout duration.
  • 🧠 AI-Powered Planning: Utilizes OpenAI's GPT-3.5-Turbo to create personalized workout plans.
  • 💾 Workout Storage: Save and manage your workout plans locally for easy access.
  • 🎨 Interactive UI: Step-by-step forms to input your workout preferences.
  • ⚙️ State Management: Powered by the Provider package for efficient app state management.

🛠️ Technologies Used

  • Flutter: For building the user interface.
  • dart_openai: To interact with the OpenAI API.
  • dotenv: For managing environment variables securely.
  • Provider: For state management.
  • Local Storage: Save workouts using custom data handling.

🚀 Getting Started

Prerequisites

  1. Flutter SDK: Ensure you have Flutter installed. Installation Guide
  2. Dart: Included with Flutter.
  3. OpenAI API Key: Sign up at OpenAI to get your API key.

Installation

  1. Clone this repository:

    git clone https://github.com/torelli/ai_personal_trainer.git
    cd ai-personal-trainer
  2. Install dependencies:

    flutter pub get
  3. Set up environment variables:

    • Create a .env file in the root directory.
    • Add your API key and base URL:
      API_KEY=your_openai_api_key
      API_URL=https://api.openai.com/v1
      SYS_PROMPT=Create a workout plan based on user preferences.
  4. Run the app:

    flutter run

🏋️ How to Use

  1. Open the app.
  2. Click on the button to start creating a new workout plan.
  3. Follow the step-by-step forms:
    • 📅 Select the days you want to train.
    • 🎯 Choose your fitness goals.
    • 🏃‍♂️ Pick your preferred training modalities (e.g., calisthenics, weightlifting).
    • ⏱️ Specify the maximum duration of your workout.
  4. Save and view your workouts in the local storage feature.
  5. Click Generate Workout to receive a personalized workout plan.

📂 Project Structure

  • lib/: Contains the main application code.
    • main.dart: Entry point of the app.
    • State Management: MyAppState class manages the workout request and generated plans.
    • Workout Storage: Logic to store and retrieve workout plans locally.
    • UI Components: Includes forms for selecting days, goals, modalities, and duration.
    • API Integration: Handled by get_response.dart.

🤝 Contributing

Contributions are welcome! Please fork the repository and create a pull request with your changes.

🙌 Acknowledgments

  • OpenAI for providing the GPT model.
  • The Flutter community for extensive documentation and support.

Start your fitness journey today with AI Personal Trainer! 💪🤩

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published