-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
60 lines (50 loc) · 2.51 KB
/
Copy pathstart.bat
File metadata and controls
60 lines (50 loc) · 2.51 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
@echo off
setlocal
set PORT_BACKEND=8080
set PORT_FRONTEND=5173
:: ── Kill stale processes on our ports ───────────────────────────────────────
echo Stopping existing servers...
for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":%PORT_BACKEND% " 2^>nul') do (
taskkill /PID %%a /F >nul 2>&1
)
for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":%PORT_FRONTEND% " 2^>nul') do (
taskkill /PID %%a /F >nul 2>&1
)
timeout /t 1 /nobreak >nul
:: ── Install / sync dependencies ─────────────────────────────────────────────
if not exist .venv (
echo Creating virtualenv...
python -m venv .venv
)
echo Syncing dependencies...
call .venv\Scripts\activate.bat
pip install -q -r requirements.txt 2>&1 | findstr /v "^$"
:: ── Build frontend ───────────────────────────────────────────────────────────
echo Building frontend...
pushd frontend\mac
call npm install --silent
call npm run build
popd
:: ── Warm-up ──────────────────────────────────────────────────────────────────
python scripts\warmup.py
:: ── Launch servers ───────────────────────────────────────────────────────────
echo.
echo Launching backend (:%PORT_BACKEND%) + frontend (:%PORT_FRONTEND%)...
echo.
start "swarma-backend" cmd /k "call .venv\Scripts\activate.bat && python run.py"
timeout /t 2 /nobreak >nul
start "swarma-frontend" cmd /k "cd frontend\mac && npx vite --force --port %PORT_FRONTEND%"
timeout /t 2 /nobreak >nul
echo.
echo ──────────────────────────────────────
echo [OK] READY
echo.
echo App: http://localhost:%PORT_FRONTEND%/
echo Backend: http://localhost:%PORT_BACKEND%/
echo Mock: http://localhost:%PORT_FRONTEND%/?mock
echo Preview: http://localhost:%PORT_FRONTEND%/?preview=concierge
echo ──────────────────────────────────────
echo.
echo Close the backend and frontend windows to stop all servers.
echo.
endlocal