@echo off echo ======================================== echo UK Energy Bill Analyzer echo ======================================== echo. echo Starting the application... echo. echo The web app will open in your default browser. echo Press Ctrl+C to stop the server. echo. REM Get the directory where the batch file is located set APP_DIR=%~dp0 REM Start the backend server cd /d "%APP_DIR%" REM Check if .env file exists if not exist ".env" ( echo. echo WARNING: No .env file found! echo Please create a .env file with your API keys. echo See .env.template for instructions. echo. ) REM Check if Python is available python --version >nul 2>&1 if %errorlevel% equ 0 ( echo Starting web server on http://localhost:8080 echo. timeout /t 2 /nobreak >nul start http://localhost:8080/energy-analyzer-octopus.html python server.py if %errorlevel% neq 0 ( echo. echo ERROR: Server crashed! See error message above. echo. pause ) ) else ( echo Python not found. Checking for Python3... python3 --version >nul 2>&1 if %errorlevel% equ 0 ( echo Starting web server on http://localhost:8080 echo. timeout /t 2 /nobreak >nul start http://localhost:8080/energy-analyzer-octopus.html python3 server.py if %errorlevel% neq 0 ( echo. echo ERROR: Server crashed! See error message above. echo. pause ) ) else ( echo. echo ERROR: Python is not installed or not in PATH echo. echo Please install Python from https://www.python.org/downloads/ echo Make sure to check "Add Python to PATH" during installation. echo. pause exit /b 1 ) )