Skip to content

Installation

This guide will walk you through setting up the Fitness Dashboard on your local machine.

Prerequisites

Before you begin, ensure you have the following installed:

  • Python 3.10+: Download from python.org
  • Git: For cloning the repository
  • MySQL: Local database server (for development)

Required Libraries

The application includes advanced analytics features requiring:

  • scipy: Statistical analysis and scientific computing
  • scikit-learn: Algorithms for automatic workout classification
  • plotly: Interactive visualizations and charts

These are automatically installed with Poetry but may require additional system dependencies on some platforms.

Installation Methods

Choose the installation method that best suits your workflow:

Poetry provides dependency management and virtual environment handling.

Step 1: Install Poetry

If you don't have Poetry installed:

curl -sSL https://install.python-poetry.org | python3 -

Note

Poetry may be installed in ~/.local/bin/poetry on some systems.

Step 2: Clone and Setup

git clone https://github.com/dagny/fitness-dashboard.git
cd fitness-dashboard

# Install dependencies
poetry install

# Activate the virtual environment
poetry shell

Traditional Python virtual environment setup.

Step 1: Clone Repository

git clone https://github.com/dagny/fitness-dashboard.git
cd fitness-dashboard

Step 2: Create Virtual Environment

python3 -m venv .st-db
source .st-db/bin/activate  # On Windows: .st-db\Scripts\activate

Step 3: Install Dependencies

pip install -r requirements.txt

Automatic environment activation when entering the project directory.

Step 1: Install direnv

brew install direnv  # macOS
# or
sudo apt install direnv  # Ubuntu

Step 2: Setup Shell Integration

Add to your ~/.zshrc or ~/.bashrc:

eval "$(direnv hook zsh)"  # for zsh
eval "$(direnv hook bash)" # for bash

Step 3: Project Setup

git clone https://github.com/dagny/fitness-dashboard.git
cd fitness-dashboard

poetry config virtualenvs.in-project true
poetry install

Step 4: Create .envrc

cat > .envrc << EOF
VENV_PATH=$(poetry env info -p)
source "$VENV_PATH/bin/activate"
export STREAMLIT_THEME="dark"
dotenv
EOF

touch .env
echo ".env" >> .gitignore
direnv allow

Environment Configuration

Create your environment configuration file:

cp .env.example .env  # If available
# or create manually
touch .env

Add the following environment variables to your .env file:

# Database Configuration
MYSQL_USER=your_username
MYSQL_PWD=your_password
MYSQL_HOST=localhost
MYSQL_PORT=3306

# Application Settings
STREAMLIT_THEME=dark
DEBUG=true

Verify Installation

Test your installation by running:

# Core dependencies
python -c "import streamlit; print('Streamlit version:', streamlit.__version__)"
python -c "import pymysql; print('PyMySQL installed successfully')"

# AI/ML dependencies  
python -c "import scipy; print('SciPy version:', scipy.__version__)"
python -c "import sklearn; print('Scikit-learn version:', sklearn.__version__)"
python -c "import plotly; print('Plotly version:', plotly.__version__)"

If all imports succeed, your installation is ready for AI-powered fitness analytics.

Next Steps

Once installation is complete:

  1. Database Setup: Configure your MySQL database following the Database Setup guide
  2. Quick Start: Launch the application with our Quick Start guide
  3. Configuration: Customize your setup in the Configuration Guide

Troubleshooting

Common Issues

Poetry Not Found

If poetry command is not found, try:

~/.local/bin/poetry --version
Add ~/.local/bin to your PATH or create an alias.

MySQL Connection Error

Ensure MySQL is running and credentials are correct:

mysql -u your_username -p

Python Version Compatibility

The application requires Python 3.10+. Check your version:

python --version

For more troubleshooting help, see the Troubleshooting Reference.