-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun-dev.bat
More file actions
69 lines (55 loc) · 1.74 KB
/
Copy pathrun-dev.bat
File metadata and controls
69 lines (55 loc) · 1.74 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
@echo off
REM GAPS 2 - Local Development Runner (Windows)
REM Starts both the Flask backend and Angular frontend dev servers
setlocal
set "ROOT_DIR=%~dp0"
set "BACKEND_DIR=%ROOT_DIR%backend"
set "FRONTEND_DIR=%ROOT_DIR%frontend"
echo === Setting up Backend ===
REM Check Python
where python >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: Python not found. Please install Python 3.9+
exit /b 1
)
REM Create virtual environment if needed
if not exist "%BACKEND_DIR%\venv\Scripts\activate.bat" (
echo Creating Python virtual environment...
python -m venv "%BACKEND_DIR%\venv"
)
REM Activate and install dependencies
call "%BACKEND_DIR%\venv\Scripts\activate.bat"
echo Installing Python dependencies...
pip install -r "%BACKEND_DIR%\requirements.txt" --quiet
echo.
echo === Setting up Frontend ===
REM Check Node
where node >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: Node.js not found. Please install Node.js 20+
exit /b 1
)
REM Install Node deps if needed
if not exist "%FRONTEND_DIR%\node_modules" (
echo Installing Node dependencies...
cd /d "%FRONTEND_DIR%"
call npm install
)
echo.
echo === Starting Servers ===
echo.
REM Start backend in a new window
echo Starting Flask backend on http://localhost:4277
start "GAPS2 Backend" cmd /k "cd /d %BACKEND_DIR% && call venv\Scripts\activate.bat && python run.py"
REM Wait for backend to start
timeout /t 3 /nobreak >nul
REM Start frontend in a new window
echo Starting Angular frontend on http://localhost:4200
start "GAPS2 Frontend" cmd /k "cd /d %FRONTEND_DIR% && npx ng serve --proxy-config proxy.conf.json --open"
echo.
echo Both servers are running!
echo Frontend: http://localhost:4200
echo Backend: http://localhost:4277
echo.
echo Close the server windows to stop them.
pause