@echo off REM BDFR Web Interface Startup Script for Windows REM This script provides an easy way to start the BDFR web interface on Windows setlocal enabledelayedexpansion REM Colors for output (Windows 10+) set "RED=[91m" set "GREEN=[92m" set "YELLOW=[93m" set "BLUE=[94m" set "NC=[0m" REM Function to print colored output (simplified for Windows) echo 🌟 BDFR Web Interface Startup echo ================================================== REM Check if we're in the right directory if not exist "requirements.txt" ( echo ❌ Error: Please run this script from the web_interface directory echo Usage: start.bat pause exit /b 1 ) if not exist "app" ( echo ❌ Error: app directory not found echo Please make sure you're in the web_interface directory pause exit /b 1 ) echo â„šī¸ Checking Python version... REM Check Python version python --version > temp_python_version.txt 2>&1 set /p PYTHON_VERSION=nul if errorlevel 1 ( echo ❌ Error: Python 3 is required echo Current version: %PYTHON_VERSION% pause exit /b 1 ) REM Install dependencies echo â„šī¸ Checking and installing dependencies... if exist requirements.txt ( echo â„šī¸ Installing Python dependencies... python -m pip install -r requirements.txt if !errorlevel! neq 0 ( echo ❌ Failed to install dependencies pause exit /b 1 ) echo ✅ Dependencies installed successfully ) else ( echo ❌ requirements.txt not found pause exit /b 1 ) REM Check if BDFR module is available echo â„šī¸ Checking BDFR module availability... python -c "import sys; sys.path.insert(0, '../bdfr'); import bdfr.api; print('BDFR API imported successfully')" >nul 2>&1 if !errorlevel! neq 0 ( echo âš ī¸ Warning: BDFR module not found in Python path echo Make sure the parent directory is in your Python path echo Or run this script from the project root directory echo Attempting to install BDFR... cd .. python -m pip install -e . cd web_interface if !errorlevel! neq 0 ( echo ❌ Failed to install BDFR pause exit /b 1 ) echo ✅ BDFR installed successfully ) else ( echo ✅ BDFR module found ) REM Start the server echo. echo ================================================== echo â„šī¸ Starting BDFR Web Interface... echo â„šī¸ Server will be available at: http://localhost:8000 echo â„šī¸ API documentation at: http://localhost:8000/docs echo â„šī¸ Press Ctrl+C to stop the server echo ================================================== REM Start uvicorn server python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload REM This code runs when the server is stopped echo. echo â„šī¸ BDFR Web Interface stopped pause