๐ Project Overview
Fitness Coach Bot is an advanced AI-powered fitness coaching chatbot that integrates Python, Flask, and SQLAlchemy to create an intelligent personal fitness trainer. This project offers personalized workout plan generation based on fitness goals and levels, detailed exercise instructions with proper form techniques, comprehensive progress tracking for workouts and fitness metrics, personalized nutrition advice for different fitness objectives, goal setting and achievement tracking, interactive chat interface with AI fitness coach, health tips across multiple categories, workout history and analytics, user profile management, and comprehensive fitness analytics dashboard. Perfect for fitness apps, health platforms, personal training applications, and individuals seeking AI-powered fitness guidance.
โก Quick Facts
โจ Features
Core Features
๐๏ธ Personalized Workout Plans
AI-generated workout routines tailored to your fitness level, goals, and preferences. Get custom plans for weight loss, muscle gain, endurance, and more.
๐ช Exercise Guidance
Detailed exercise instructions with proper form techniques, muscle groups targeted, equipment needed, and helpful tips for safe and effective workouts.
๐ Progress Tracking
Monitor your fitness journey with comprehensive tracking of workouts completed, streaks, calories burned, goals met, and overall progress statistics.
๐ฅ Nutrition Advice
Personalized nutrition recommendations based on your fitness goals. Get advice for muscle gain, weight loss, endurance training, and general health.
Advanced Features
๐ฏ Goal Setting
Set and track fitness objectives including weight loss, muscle gain, endurance improvement, flexibility, and general health goals.
๐ก Health Tips
Randomized health and wellness advice across multiple categories including nutrition, exercise, recovery, motivation, and safety.
๐ค User Profiles
Store personal information including age, weight, height, fitness goals, activity level, and preferences for personalized coaching.
๐ Workout Analytics
Comprehensive analytics dashboard with visualizations showing workout frequency, progress trends, goal completion, and fitness metrics.
๐ Exercise Database
Extensive collection of exercises with categories (strength, cardio, flexibility), muscle groups, equipment needed, and difficulty levels.
๐ค AI Workout Generator
Intelligent workout plan creation based on user goals, fitness level, available equipment, and time constraints.
๐ฑ Responsive Design
Beautiful, modern UI that works seamlessly on desktop, tablet, and mobile devices for fitness coaching anywhere.
๐ฌ Interactive Chat
Natural conversation interface with AI fitness coach for asking questions, getting advice, and receiving personalized guidance.
๐ Workout History
Track completed workouts with timestamps, exercises performed, sets, reps, and progress notes for comprehensive history.
๐ Achievement System
Gamification features with achievements, badges, and rewards for maintaining workout streaks and reaching fitness milestones.
๐ Data Security
Secure user data storage with proper database management, input validation, and privacy protection for fitness information.
โก Fast Performance
Optimized database queries and efficient processing for fast responses and smooth fitness coaching interactions.
๐ ๏ธ Technologies
Python
Core programming language for educational platform
LanguageFlask
Python web framework for backend API
FrameworkSQLAlchemy
SQL toolkit and ORM for database operations
DatabaseSQLite
Lightweight database for development and production
DatabaseFlask-SQLAlchemy
Flask extension for SQLAlchemy integration
ORMpython-dotenv
Environment variable management for configuration
ConfigSpeech Recognition
Voice input/output processing for multilingual interactions
VoiceModular Architecture
Clean, modular code structure for easy extension
Architecture๐ฆ Installation Guide - Step by Step
โฑ๏ธ Installation Time: ~5 minutes
Follow these simple steps to set up the Fitness Coach Bot on your system.
๐ Prerequisites
๐ Web Browser
Modern web browser (Chrome, Firefox, Safari, Edge) for accessing the educational platform
Recommended: Latest version of Chrome or Firefox
๐พ Database Setup
SQLite database will be created automatically on first run (no external database required)
Note: For production, PostgreSQL or MySQL can be configured
๐ Internet Connection
Required for Flask server and downloading dependencies
๐ Step-by-Step Installation
Option A: Download ZIP
- Download the project ZIP file from the repository
- Extract it to your desired location (e.g.,
C:\Projects\fitness-coach-botor~/Projects/fitness-coach-bot) - Navigate to the extracted folder
Option B: Clone with Git
git clone https://github.com/rskworld/fitness-coach-bot.git
cd fitness-coach-bot
Install required Python packages using pip.
# Install dependencies
pip install -r requirements.txt
Initialize the SQLite database with sample data including exercises, workout plans, and health tips.
# Initialize database with sample data
python init_db.py
This will create the SQLite database file (fitness_coach.db) and populate it with:
- Sample exercises with categories and muscle groups
- Pre-built workout plans for different fitness levels
- Health tips across multiple categories
- Database schema for users, progress, and workouts
Start the Flask backend server by running app.py.
# Start Flask server
python app.py
# The server will start on http://localhost:5000
Open the HTML file in your browser or use a local web server.
Method 1: Direct File Opening
- Open index.html in your browser
Method 2: Using Local Web Server (Recommended)
# In a new terminal, start HTTP server
python -m http.server 8000
# Then open: http://localhost:8000
โ Installation Complete!
Congratulations! You've successfully set up the Fitness Coach Bot. The chatbot is ready to use with all features including:
- AI-powered fitness coaching with personalized workout plans
- Exercise database with detailed instructions and form tips
- Progress tracking for workouts, streaks, and fitness goals
- Nutrition advice tailored to your fitness objectives
- Goal setting and achievement tracking
- Health tips across multiple categories
- User profile management with fitness information
- Workout history and comprehensive analytics
- Interactive chat interface with AI fitness coach
Next Steps:
- Ensure the Flask server is running (Step 4)
- Open the frontend in your browser (Step 5)
- Start chatting with the fitness coach to get workout plans and advice
- Explore all the features, exercises, workout plans, and fitness tracking!
๐ง Troubleshooting Installation
โ Database Issues
Solution: Ensure you've run python init_db.py to create the database. Check that the instance/fitness_coach.db file exists.
โ Flask Server Not Starting
Solution: Check Python version (3.8+), verify dependencies installed with pip install -r requirements.txt, ensure port 5000 is available.
โ Connection Errors
Solution: Verify Flask server is running on port 5000, check script.js has correct API_BASE_URL, ensure CORS is enabled in Flask.
โ Import Errors
Solution: Reinstall dependencies, check virtual environment is activated, verify all packages in requirements.txt are installed.
๐ Usage Guide - Step by Step
๐ฏ Getting Started with Fitness Coach Bot
Step-by-Step Usage Instructions
๐ Step 1: Start Backend Server
- Ensure Flask server is running:
python run.py - Check server status at
http://localhost:5000 - You should see the Fitness Coach Bot interface
๐ Step 2: Open Frontend
- Open http://localhost:5000 in your web browser
- You should see the Fitness Coach Bot interface with:
- Chat messages area with markdown support
- Text input field
- Workout plan selection
- Quick action buttons for common fitness questions
- Features panel with chatbot capabilities
- Statistics cards showing conversation stats
- Send button
๐ฌ Step 3: Start Chatting
- Text Input: Type your fitness question or request and press Enter or click Send
- Workout Plans: Ask for personalized workout plans based on your goals
- Exercise Guidance: Get detailed instructions for specific exercises
- Try These:
- "Hello! How are you?" (English)
- "เคจเคฎเคธเฅเคคเฅ! เคเคช เคเฅเคธเฅ เคนเฅเค?" (Hindi)
- "Hola! ยฟCรณmo estรกs?" (Spanish)
- "Translate: Hello world to Spanish"
- "Create a beginner workout plan"
- "What exercises target the chest?"
- View Responses: The fitness coach will provide personalized workout plans, exercise guidance, and fitness advice
โ๏ธ Step 4: Explore Features
Try out the chatbot features:
- Language Selection: Manually select your preferred language
- Workout Plans: Request workout plans for different fitness levels
- Progress Tracking: Track your workouts and fitness progress
- Exercise Guidance: Get detailed instructions for specific exercises
- Nutrition Advice: Ask for nutrition recommendations for your goals
- Progress Tracking: Monitor your fitness progress and achievements
๐ป Using the Fitness Coach Bot
You can interact with the Fitness Coach Bot through the web interface:
# Example Interactions
User: "Create a beginner workout plan"
Bot: "Great decision to start your fitness journey! Here's a beginner-friendly workout plan..."
User: "What exercises target the chest?"
Bot: [List of chest exercises with detailed instructions]
User: "What should I eat for muscle gain?"
Bot: [Personalized nutrition recommendations for muscle gain]
User: "How do I track my fitness progress?"
Bot: [Comprehensive guide on tracking workouts, progress, and achievements]
User: "Show me a full body workout"
Bot: [Complete full body workout routine with exercises and sets]
# Quick Action Buttons
- Beginner Plan: Get a beginner-friendly workout routine
- Chest Exercises: View exercises targeting the chest
- Nutrition: Get nutrition advice for your goals
- Progress: Learn how to track fitness progress
- Full Body: Get a complete full body workout
- Health Tips: Receive health and wellness tips
๐ Features Usage
๐๏ธ Workout Plans
Get personalized workout routines tailored to your fitness level and goals - beginner, intermediate, or advanced
๐ช Exercise Guidance
Receive detailed exercise instructions with proper form techniques, muscle groups, and safety tips
๐ Progress Tracking
Monitor your fitness journey with comprehensive tracking of workouts, streaks, and achievements
๐ฅ Nutrition Advice
Get personalized nutrition recommendations based on your fitness goals and activity level
๐ฏ Goal Setting
Set and track fitness objectives including weight loss, muscle gain, endurance, and flexibility
๐ก Health Tips
Receive randomized health and wellness advice across nutrition, exercise, recovery, and motivation
๐ Analytics
View comprehensive fitness analytics including workout frequency, progress trends, and goal completion
๐ค User Profiles
Store and manage your personal fitness information, goals, and preferences for personalized coaching
๐ Advanced Features & Capabilities
The Fitness Coach Bot includes advanced AI capabilities, workout generation, exercise database, and comprehensive fitness tracking. Here's what you can do:
๐ค AI Workout Generation
The bot excels at creating personalized workout plans based on your fitness level, goals, available equipment, and time constraints. Get custom routines tailored to your needs.
๐ช Exercise Database
Access an extensive collection of exercises with detailed instructions, proper form techniques, muscle groups targeted, equipment needed, and difficulty levels.
๐ Comprehensive Tracking
Track your fitness journey with detailed analytics including workouts completed, streaks maintained, calories burned, goals achieved, and overall progress statistics.
๐ฅ Smart Nutrition
Receive personalized nutrition advice based on your fitness goals. Get recommendations for muscle gain, weight loss, endurance training, and general health.
๐ป Code Examples
Basic Fitness Coach Bot Integration
// Python Flask backend - app.py
from flask import Flask, request, jsonify
from models.fitness_models import db, User, Exercise, WorkoutPlan
from utils.fitness_coach import FitnessCoach
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///fitness_coach.db'
db.init_app(app)
fitness_coach = FitnessCoach()
@app.route('/api/chat', methods=['POST'])
def chat():
data = request.json
message = data.get('message', '')
user_id = session.get('user_id', 'anonymous')
# Get AI fitness coach response
response = fitness_coach.get_response(message, user_id)
return jsonify({
'success': True,
'response': response,
'timestamp': datetime.now().isoformat()
})
else:
response = response_en
return jsonify({
'response': response,
'detected_language': detected_lang,
'confidence': language_detector.get_confidence()
})
if __name__ == '__main__':
app.run(debug=True, port=5000)
JavaScript Frontend Integration
// Frontend JavaScript - chatbot.js
async function sendMessage(message, userLanguage = null) {
const response = await fetch('http://localhost:5000/chat', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
message: message,
language: userLanguage // Optional: let chatbot detect automatically
})
});
const data = await response.json();
return {
response: data.response,
detectedLanguage: data.detected_language,
languageName: data.language_name,
confidence: data.confidence
};
}
// Usage
sendMessage('Hello! How are you?').then(result => {
console.log('Chatbot:', result.response);
console.log('Detected Language:', result.detectedLanguage);
console.log('Confidence:', result.confidence);
});
Complete Fitness Coach Bot Example
// Fitness Coach Bot Class
class FitnessCoachBot {
constructor(apiUrl) {
this.apiUrl = apiUrl || 'http://localhost:5000/api';
this.conversationHistory = [];
this.userId = 'anonymous';
}
async sendMessage(message) {
const response = await fetch(`${this.apiUrl}/chat`, {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
message: message
})
});
const data = await response.json();
// Update conversation history
if (data.success) {
this.conversationHistory.push(
{role: 'user', content: message},
{role: 'assistant', content: data.response}
);
}
return {
response: data.response,
timestamp: data.timestamp
};
}
async getWorkoutPlans() {
const response = await fetch(`${this.apiUrl}/workout-plans`);
const data = await response.json();
return data.plans || [];
}
async getExercises(category = null, muscleGroup = null) {
const params = new URLSearchParams();
if (category) params.append('category', category);
if (muscleGroup) params.append('muscle_group', muscleGroup);
const response = await fetch(`${this.apiUrl}/exercises?${params}`);
const data = await response.json();
return data.exercises || [];
}
clearHistory() {
this.conversationHistory = [];
}
}
// Usage
const fitnessBot = new FitnessCoachBot();
fitnessBot.sendMessage('Create a beginner workout plan').then(result => {
console.log('Fitness Coach:', result.response);
});
// Get exercises
fitnessBot.getExercises('strength', 'chest').then(exercises => {
console.log('Chest Exercises:', exercises);
});
Configuration Example
// Frontend config - app.js
const FitnessCoachConfig = {
api: {
baseUrl: 'http://localhost:5000/api',
endpoints: {
chat: '/chat',
workoutPlans: '/workout-plans',
exercises: '/exercises',
userProfile: '/user/profile',
progress: '/progress'
}
},
fitness: {
categories: ['strength', 'cardio', 'flexibility', 'endurance'],
goals: ['weight_loss', 'muscle_gain', 'endurance', 'general_health'],
difficultyLevels: ['beginner', 'intermediate', 'advanced']
},
ui: {
animationDuration: 300,
messageDelay: 500,
autoScroll: true
}
};
// Access configuration
console.log(FitnessCoachConfig.fitness.categories);
# Backend config - config.py
import os
from dotenv import load_dotenv
load_dotenv()
class Config:
SECRET_KEY = os.getenv('SECRET_KEY', 'fitness-coach-bot-2026-rskworld')
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL', 'sqlite:///fitness_coach.db')
SQLALCHEMY_TRACK_MODIFICATIONS = False
# Fitness categories
EXERCISE_CATEGORIES = ['strength', 'cardio', 'flexibility', 'endurance']
MUSCLE_GROUPS = ['chest', 'back', 'shoulders', 'arms', 'legs', 'core']
FITNESS_GOALS = ['weight_loss', 'muscle_gain', 'endurance', 'general_health']
DIFFICULTY_LEVELS = ['beginner', 'intermediate', 'advanced']
๐ API Integration
Fitness Coach Bot API
The application uses Python Flask with SQLAlchemy for database operations and AI-powered fitness coaching. The backend handles workout plan generation, exercise database queries, progress tracking, and nutrition advice, while the frontend uses JavaScript for user interactions and real-time chat interface.
Available APIs & Technologies
| API/Technology | Type | Description |
|---|---|---|
| Flask REST API | Backend | Python Flask server for fitness coaching endpoints |
| SQLAlchemy ORM | Database | Database operations for exercises, workouts, and user data |
| SQLite Database | Database | Lightweight database for storing fitness data |
| Fitness Coach Engine | AI Module | AI-powered workout plan generation and coaching |
| LocalStorage | Browser API | Store user settings and chat history |
| Exercise Database | Data | Comprehensive collection of exercises with instructions |
Backend API Endpoints
# Flask Backend - app.py
@app.route('/api/chat', methods=['POST'])
def chat():
data = request.get_json()
message = data.get('message', '')
user_id = session.get('user_id', 'anonymous')
# Get AI fitness coach response
response = fitness_coach.get_response(message, user_id)
return jsonify({
'success': True,
'response': response,
'timestamp': datetime.now().isoformat()
})
@app.route('/api/workout-plans', methods=['GET'])
def get_workout_plans():
plans = WorkoutPlan.query.all()
return jsonify({
'success': True,
'plans': [plan.to_dict() for plan in plans]
})
@app.route('/api/exercises', methods=['GET'])
def get_exercises():
category = request.args.get('category')
muscle_group = request.args.get('muscle_group')
query = Exercise.query
if category:
query = query.filter_by(category=category)
if muscle_group:
query = query.filter_by(muscle_group=muscle_group)
exercises = query.all()
return jsonify({
'success': True,
'exercises': [exercise.to_dict() for exercise in exercises]
})
@app.route('/api/user/profile', methods=['GET', 'POST'])
def user_profile():
if request.method == 'POST':
# Save user profile
data = request.get_json()
# Update user profile logic
return jsonify({'success': True})
else:
# Get user profile
user_id = session.get('user_id')
# Retrieve user profile logic
return jsonify({'success': True, 'profile': {}})
@app.route('/api/health', methods=['GET'])
def health():
return jsonify({
'status': 'healthy',
'database_configured': True
})
// Frontend JavaScript - API Integration
async function sendMessage(message, userLanguage = null) {
try {
const response = await fetch('http://localhost:5000/chat', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
message: message,
language: userLanguage // null for auto-detection
})
});
if (!response.ok) {
throw new Error('API request failed');
}
const data = await response.json();
return {
response: data.response,
detectedLanguage: data.detected_language,
languageName: data.language_name,
confidence: data.confidence
};
} catch (error) {
console.error('Error:', error);
return {error: error.message};
}
}
// Detect language
async function detectLanguage(text) {
const response = await fetch('http://localhost:5000/detect_language', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({text: text})
});
return await response.json();
}
// Translate text
async function translateText(text, targetLanguage) {
const response = await fetch('http://localhost:5000/translate', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
text: text,
target_language: targetLanguage
})
});
return await response.json();
}
Browser Compatibility
// Check Fitness Coach Bot API Connection
async function checkHealth() {
try {
const response = await fetch('http://localhost:5000/api/health');
const data = await response.json();
console.log('Server Status:', data.status);
console.log('Database Configured:', data.database_configured);
return data.database_configured;
} catch (error) {
console.error('Health check failed:', error);
return false;
}
}
// Get workout plans
async function getWorkoutPlans() {
const response = await fetch('http://localhost:5000/api/workout-plans');
const data = await response.json();
return data.plans || [];
}
// Get exercises by category
async function getExercisesByCategory(category) {
const response = await fetch(`http://localhost:5000/api/exercises?category=${category}`);
const data = await response.json();
return data.exercises || [];
}
// Recommended setup:
// - Backend: Python 3.8+ with Flask, SQLAlchemy, SQLite
// - Frontend: Modern browsers (Chrome, Edge, Safari, Firefox)
// - Database: SQLite for development, PostgreSQL for production
// - Dependencies: flask, flask-sqlalchemy, sqlalchemy
โ๏ธ Configuration
Configuration in this application is handled through environment variables and settings files:
Database Configuration
The Fitness Coach Bot uses SQLite database by default. No external API keys required!
# Database will be created automatically
# Just run: python init_db.py
# For production, you can configure PostgreSQL/MySQL in config.py:
# SQLALCHEMY_DATABASE_URI = 'postgresql://user:pass@localhost/fitness_db'
# Optional environment variables:
FLASK_ENV=development
SECRET_KEY=your-secret-key-here
PORT=5000
Note: The database is initialized automatically when you run python init_db.py. No external API keys needed!
Python Configuration (config.py)
The config.py file contains configuration settings:
# config.py
import os
class Config:
SECRET_KEY = os.getenv('SECRET_KEY', 'fitness-coach-bot-2026-rskworld')
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL', 'sqlite:///fitness_coach.db')
SQLALCHEMY_TRACK_MODIFICATIONS = False
# Fitness categories
EXERCISE_CATEGORIES = ['strength', 'cardio', 'flexibility', 'endurance']
MUSCLE_GROUPS = ['chest', 'back', 'shoulders', 'arms', 'legs', 'core']
FITNESS_GOALS = ['weight_loss', 'muscle_gain', 'endurance', 'general_health']
DIFFICULTY_LEVELS = ['beginner', 'intermediate', 'advanced']
Frontend Configuration
Edit app.js to configure API endpoint:
// app.js
const API_BASE_URL = 'http://localhost:5000/api';
// Fitness categories
const EXERCISE_CATEGORIES = ['strength', 'cardio', 'flexibility', 'endurance'];
const MUSCLE_GROUPS = ['chest', 'back', 'shoulders', 'arms', 'legs', 'core'];
const FITNESS_GOALS = ['weight_loss', 'muscle_gain', 'endurance', 'general_health'];
const DIFFICULTY_LEVELS = ['beginner', 'intermediate', 'advanced'];
Browser LocalStorage Settings
User settings are automatically saved to browser's local storage:
// Settings are saved automatically
localStorage.setItem('chatbotSettings', JSON.stringify({
model: 'gpt-3.5-turbo',
maxTokens: 1024,
temperature: 0.7,
language: 'en',
autoDetectLanguage: true,
culturalAdaptation: true,
voiceEnabled: false
}));
// Load settings
const settings = JSON.parse(localStorage.getItem('chatbotSettings'));
Runtime Configuration
Configure settings through the web interface:
- Language: Select preferred language (12+ languages supported)
- Auto-detect Language: Enable/disable automatic language detection
- Cultural Adaptation: Enable/disable cultural adaptation of responses
- Voice Input/Output: Enable/disable voice functionality
- Exercise Guidance: Get detailed instructions for exercises
- Progress Tracking: Monitor your fitness progress and achievements
All settings are saved automatically and persist across browser sessions.
๐ Project Structure
The Fitness Coach Bot follows a clean, organized structure for easy navigation and maintenance.
fitness-coach-bot/
โโโ fitness-coach-bot/
โ โโโ templates/
โ โ โโโ index.html # Main HTML interface
โ โโโ static/
โ โ โโโ css/
โ โ โ โโโ style.css # Modern styling
โ โ โโโ js/
โ โ โโโ app.js # Frontend logic
โ โโโ models/
โ โ โโโ fitness_models.py # Database models
โ โโโ utils/
โ โ โโโ fitness_coach.py # Core AI coaching engine
โ โ โโโ ai_workout_generator.py # Workout generation
โ โ โโโ nutrition_ai.py # Nutrition advice
โ โ โโโ analytics_engine.py # Progress analytics
โ โ โโโ ... # Other utilities
โ โโโ app.py # Flask backend server
โ โโโ config.py # Configuration settings
โ โโโ init_db.py # Database initialization
โ โโโ requirements.txt # Python dependencies
โโโ demo/
โ โโโ index.html # Documentation page
โ โโโ demo.html # Interactive demo
โ โโโ style.css # Demo styling
โ โโโ script.js # Demo scripts
โโโ instance/
โ โโโ fitness_coach.db # SQLite database
โโโ README.md # Project documentation
๐ Frontend Files
Location: fitness-coach-bot/templates/ and fitness-coach-bot/static/
templates/index.html- Main UI interface with chatstatic/css/style.css- Modern gradient stylingstatic/js/app.js- JavaScript functionality
๐ Backend Files
Location: fitness-coach-bot/
app.py- Flask server & API endpointsconfig.py- Configuration settingsinit_db.py- Database initialization scriptmodels/fitness_models.py- Database modelsutils/fitness_coach.py- Core AI coaching engineutils/ai_workout_generator.py- Workout generationutils/nutrition_ai.py- Nutrition advice module
โ๏ธ Configuration
Setup: Configure these files for your environment
config.py- Application configurationrequirements.txt- Python dependenciesinit_db.py- Database setup script
๐ง Troubleshooting
Database Issues
- Ensure you've run
python init_db.pyto create the database - Check that the
instance/fitness_coach.dbfile exists - Verify SQLAlchemy is properly installed:
pip install flask-sqlalchemy - Check database permissions if using SQLite
- For production, configure PostgreSQL or MySQL in
config.py - Restart the Flask server after database changes
Flask Server Issues
- Server not starting: Check Python version (3.8+), verify dependencies installed with
pip install -r requirements.txt - Port 5000 in use: Change port in
.envfile or stop other applications using port 5000 - Import errors: Ensure virtual environment is activated, reinstall dependencies
- CORS errors: Verify Flask-CORS is installed and enabled in
app.py - Connection refused: Check firewall settings, ensure server is running on correct port
Frontend Connection Issues
- Failed to fetch: Ensure Flask server is running, check
API_BASE_URLinchatbot.js - CORS errors: Make sure Flask-CORS is installed and configured in backend
- Server offline indicator: Check server status at
http://localhost:5000 - Port mismatch: Verify frontend
API_BASE_URLmatches backend port - Database not found: Run
python init_db.pyto create the database - Exercise data missing: Ensure init_db.py ran successfully and populated sample data
Common Issues
- Database not found: Run
python init_db.pyto create and populate the database - Module not found: Install dependencies with
pip install -r requirements.txt - SQLAlchemy errors: Ensure flask-sqlalchemy is installed:
pip install flask-sqlalchemy - Database connection errors: Check database file permissions and path in config.py
- No exercises showing: Verify init_db.py ran successfully and populated sample data
- Workout plans not loading: Check database has workout plan data, re-run init_db.py if needed
- Import errors: Ensure all Python modules are in correct directories (models/, utils/)
๐ Requirements
Backend Requirements:
- Python 3.8 or higher
- Flask web framework
- SQLAlchemy ORM
- Flask-SQLAlchemy extension
- SQLite database (included with Python)
Frontend Requirements:
- Modern Web Browser (Chrome, Edge, Safari, Firefox)
- JavaScript ES6+ support
- LocalStorage API
- Bootstrap 5 (via CDN)
Database Requirements:
- SQLite (included, no setup needed)
- For production: PostgreSQL or MySQL (optional)
Python Dependencies (see requirements.txt):
- flask
- flask-sqlalchemy
- sqlalchemy
- werkzeug
- jinja2
Optional Dependencies:
- PostgreSQL/MySQL drivers for production databases
- Additional Python packages as needed
Browser Compatibility: Chrome, Edge, Safari, or Firefox - all modern browsers supported.
Python Version: Python 3.8 or higher required for backend server.
Database: SQLite included with Python - no external database setup required!
๐ฏ Use Cases
๐๏ธ Personal Training
AI-powered personal fitness trainer available 24/7 for workout plans and exercise guidance
๐ช Fitness Apps
Integrate fitness coaching capabilities into mobile and web fitness applications
๐ฅ Health Platforms
Fitness coaching chatbot for health platforms and wellness applications
๐ฑ Mobile Fitness
On-the-go fitness coaching with workout plans and progress tracking for mobile users
๐ Website Integration
Add fitness coaching chat support to websites and health platforms
๐ Analytics & Insights
Track workout statistics, progress trends, and fitness metrics for comprehensive analytics
๐ฏ Goal Achievement
Help users set and achieve fitness goals with personalized coaching and progress tracking
๐ฅ Collaboration
Multi-user chat rooms with multilingual support for team collaboration
๐ฌ Support
For support, questions, or more projects:
- Website: https://rskworld.in
- Email: help@rskworld.in
- Phone: +91 93305 39277
๐ License
This project is provided as-is for educational and development purposes.
MIT License - See LICENSE file for details.