-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun_all.bat
More file actions
57 lines (49 loc) · 1.86 KB
/
Copy pathrun_all.bat
File metadata and controls
57 lines (49 loc) · 1.86 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
@echo off
ECHO =======================================================
ECHO == EIDO Sentinel - Local Development Startup (Windows) ==
ECHO =======================================================
ECHO.
ECHO This script will start the FastAPI backend and the Streamlit UI.
ECHO Two new command prompt windows will open.
ECHO Please close this window and the two new windows to stop the servers.
ECHO.
REM Check for python
python --version >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: 'python' command not found. Please ensure Python is installed and in your PATH.
pause
exit /b
)
REM Check for uvicorn
uvicorn --version >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: 'uvicorn' not found. Have you installed requirements? (pip install -r requirements.txt)
pause
exit /b
)
REM Check for streamlit
streamlit --version >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: 'streamlit' not found. Have you installed requirements? (pip install -r requirements.txt)
pause
exit /b
)
REM Load variables from .env file if it exists
if exist .env (
for /f "tokens=1,* delims==" %%a in ('findstr /R /V "^#" .env') do (
set "%%a=%%b"
)
)
REM Use defaults if not set in .env
if not defined API_PORT set API_PORT=8000
if not defined STREAMLIT_SERVER_PORT set STREAMLIT_SERVER_PORT=8501
if not defined API_HOST set API_HOST=127.0.0.1
ECHO Starting FastAPI backend on http://%API_HOST%:%API_PORT%...
start "FastAPI Backend" cmd /c "uvicorn api.main:app --host %API_HOST% --port %API_PORT% --reload"
ECHO.
ECHO Starting Streamlit UI on http://localhost:%STREAMLIT_SERVER_PORT%...
timeout /t 3 /nobreak >nul
start "Streamlit UI" cmd /c "streamlit run ui/app.py --server.port %STREAMLIT_SERVER_PORT%"
ECHO.
ECHO Both servers are starting in new windows.
ECHO =======================================================