forked from sentient-agi/ROMA
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanage_services.bat
More file actions
88 lines (84 loc) · 3.05 KB
/
Copy pathmanage_services.bat
File metadata and controls
88 lines (84 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@echo off
chcp 65001 >nul
echo ========================================
echo SentientResearchAgent Service Manager
echo ========================================
echo.
echo Choose an option:
echo.
echo 1) Setup Environment (First Time)
echo 2) Start Backend Service
echo 3) Start Frontend Service
echo 4) Start Both Backend and Frontend
echo 5) Check Service Status
echo 6) View Environment Info
echo 7) Exit
echo.
set /p "choice=Please select (1-7): "
if "%choice%"=="1" (
echo [INFO] Running environment setup...
call setup_native_windows.bat
) else if "%choice%"=="2" (
echo [INFO] Starting backend service...
start "SentientAgent-Backend" cmd /k start_backend.bat
) else if "%choice%"=="3" (
echo [INFO] Starting frontend service...
start "SentientAgent-Frontend" cmd /k start_frontend.bat
) else if "%choice%"=="4" (
echo [INFO] Starting backend and frontend services...
start "SentientAgent-Backend" cmd /k start_backend.bat
timeout /t 3 /nobreak >nul
start "SentientAgent-Frontend" cmd /k start_frontend.bat
timeout /t 5 /nobreak >nul
echo [INFO] Opening browser...
start "" "http://localhost:3000"
) else if "%choice%"=="5" (
echo [INFO] Checking service status...
echo.
echo Port usage:
netstat -ano | findstr :5000 && echo Backend service (port 5000) is running || echo Backend service (port 5000) not running
netstat -ano | findstr :3000 && echo Frontend service (port 3000) is running || echo Frontend service (port 3000) not running
echo.
echo Testing service connections:
powershell -Command "try { $response = Invoke-WebRequest -Uri 'http://localhost:5000/api/health' -Method GET -TimeoutSec 5; Write-Host 'Backend health check: Success' -ForegroundColor Green } catch { Write-Host 'Backend health check: Failed' -ForegroundColor Red }"
powershell -Command "try { $response = Invoke-WebRequest -Uri 'http://localhost:3000' -Method GET -TimeoutSec 5; Write-Host 'Frontend service: Running' -ForegroundColor Green } catch { Write-Host 'Frontend service: Not running' -ForegroundColor Red }"
) else if "%choice%"=="6" (
echo [INFO] Environment information:
echo.
echo Python version:
python --version 2>nul || echo Python not installed
echo.
echo Node.js version:
node --version 2>nul || echo Node.js not installed
echo.
echo npm version:
npm --version 2>nul || echo npm not installed
echo.
echo Virtual environment status:
if exist ".venv" (
echo ^✓ Virtual environment created
) else (
echo ^✗ Virtual environment not created
)
echo.
echo Frontend dependencies status:
if exist "frontend\node_modules" (
echo ^✓ Frontend dependencies installed
) else (
echo ^✗ Frontend dependencies not installed
)
echo.
echo .env file status:
if exist ".env" (
echo ^✓ .env file exists
) else (
echo ^✗ .env file does not exist
)
) else if "%choice%"=="7" (
echo [INFO] Exiting
exit /b 0
) else (
echo [ERROR] Invalid selection
)
echo.
pause