@echo off REM Flask 伺服器啟動腳本 echo ======================================== echo HR Performance System - Flask Server echo ======================================== echo. REM 檢查 Python 是否安裝 python --version >nul 2>&1 if errorlevel 1 ( echo [ERROR] Python is not installed or not in PATH echo Please install Python 3.8 or higher pause exit /b 1 ) REM 檢查虛擬環境 if not exist "venv\" ( echo [INFO] Creating virtual environment... python -m venv venv if errorlevel 1 ( echo [ERROR] Failed to create virtual environment pause exit /b 1 ) echo [SUCCESS] Virtual environment created echo. ) REM 啟動虛擬環境 echo [INFO] Activating virtual environment... call venv\Scripts\activate.bat REM 安裝依賴 echo [INFO] Installing dependencies... pip install -r requirements.txt if errorlevel 1 ( echo [ERROR] Failed to install dependencies pause exit /b 1 ) echo. REM 檢查 .env 檔案 if not exist ".env" ( echo [WARNING] .env file not found echo Please create .env file with required configuration echo. ) REM 啟動 Flask 伺服器 echo [INFO] Starting Flask server... echo Server will run on http://127.0.0.1:5002 echo Press Ctrl+C to stop the server echo. python app.py pause