@echo off
setlocal
cd /d "%~dp0"
echo.
echo ========================================
echo   Nexora Esports - Setup Dependencies
echo ========================================
echo.

where python >nul 2>nul
if errorlevel 1 (
  echo Python not found. Please install Python first.
  pause
  exit /b 1
)

if not exist ".venv" (
  echo Creating virtual environment...
  python -m venv .venv
)

echo Activating virtual environment...
call ".venv\Scripts\activate.bat"

echo Upgrading pip...
python -m pip install --upgrade pip

echo Installing project packages...
pip install -r requirements.txt

if not exist ".env" (
  echo Creating .env from .env.example...
  copy ".env.example" ".env" >nul
)

echo Initializing database...
python -c "from app import init_db; init_db(); print('Database ready')"

echo.
echo Setup complete. Now run start.bat
pause
