-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstart.bat
More file actions
56 lines (48 loc) · 1.87 KB
/
Copy pathstart.bat
File metadata and controls
56 lines (48 loc) · 1.87 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
@echo off
REM =============================================================
REM Atour Hotel Price Comparison - Unified launcher (Windows)
REM Starts frontend (Astro landing page :4321) and backend (Streamlit results :8501)
REM Usage: double-click start.bat
REM =============================================================
setlocal enabledelayedexpansion
cd /d "%~dp0"
set "FRONTEND=%~dp0frontend"
set "BACKEND=%~dp0backend"
set "ASTRO_PORT=4321"
set "STREAMLIT_PORT=8501"
echo ==================================================
echo Atour - One-click launcher
echo Frontend (landing): http://localhost:%ASTRO_PORT%
echo Backend (results): http://localhost:%STREAMLIT_PORT%
echo ==================================================
REM ---- 1) Frontend Astro ----
if not exist "%FRONTEND%\node_modules" (
echo [frontend] Installing dependencies...
pushd "%FRONTEND%"
call npm install
popd
)
echo [frontend] Building Astro - result page: http://localhost:%STREAMLIT_PORT%
pushd "%FRONTEND%"
set "RESULT_APP_URL=http://localhost:%STREAMLIT_PORT%"
call npm run build
popd
echo [frontend] Starting preview (port %ASTRO_PORT%)...
start "Atour-Frontend" /D "%FRONTEND%" cmd /c "npm run preview -- --port %ASTRO_PORT% --host"
REM ---- 2) Backend Streamlit ----
if not exist "%BACKEND%\.venv" (
echo [backend] Creating virtualenv and installing dependencies...
pushd "%BACKEND%"
python -m venv .venv
call .venv\Scripts\activate.bat
pip install -r requirements.txt
popd
)
echo [backend] Starting Streamlit (port %STREAMLIT_PORT%)...
start "Atour-Backend" /D "%BACKEND%" cmd /c ".venv\Scripts\python.exe -m streamlit run app.py --server.port %STREAMLIT_PORT% --server.headless true"
echo.
echo Both services started:
echo Landing page: http://localhost:%ASTRO_PORT%
echo Results page: http://localhost:%STREAMLIT_PORT%
echo Close the corresponding window to stop each service.
endlocal