Spaces:
Sleeping
Sleeping
| @echo off | |
| setlocal | |
| set "ROOT=%~dp0" | |
| set "PYTHON_EXE=python" | |
| set "BACKEND_PORT=8000" | |
| set "FRONTEND_PORT=5173" | |
| cd /d "%ROOT%" | |
| where %PYTHON_EXE% >nul 2>nul | |
| if errorlevel 1 ( | |
| echo System Python was not found in PATH. | |
| echo Install Python or add it to PATH, then run this file again. | |
| pause | |
| exit /b 1 | |
| ) | |
| if not exist "backend\main.py" ( | |
| echo backend\main.py was not found. | |
| pause | |
| exit /b 1 | |
| ) | |
| if not exist "package.json" ( | |
| echo package.json was not found. | |
| pause | |
| exit /b 1 | |
| ) | |
| where npm >nul 2>nul | |
| if errorlevel 1 ( | |
| echo npm was not found in PATH. | |
| echo Install Node.js or add npm to PATH, then run this file again. | |
| pause | |
| exit /b 1 | |
| ) | |
| if not exist "node_modules\.bin\vite.cmd" ( | |
| echo Frontend dependencies are missing. Running npm install... | |
| call npm install | |
| if errorlevel 1 ( | |
| echo npm install failed. | |
| pause | |
| exit /b 1 | |
| ) | |
| ) | |
| start "Nodes UI Flow Backend" /D "%ROOT%" cmd /k ""%PYTHON_EXE%" "backend\main.py" --server --port %BACKEND_PORT%" | |
| start "Nodes UI Flow Frontend" /D "%ROOT%" cmd /k "npm run dev -- --host 0.0.0.0 --port %FRONTEND_PORT%" | |
| timeout /t 2 /nobreak >nul | |
| start "" "http://localhost:%FRONTEND_PORT%" | |
| echo Backend: http://localhost:%BACKEND_PORT% | |
| echo Frontend: http://localhost:%FRONTEND_PORT% | |
| echo Live debug can point to Brains separately, usually http://localhost:8001. | |
| echo. | |
| echo Close the opened Backend and Frontend terminal windows to stop the interface. | |
| endlocal | |