Repository navigation
Expand file tree
/
Copy pathstart.bat
More file actions
67 lines (59 loc) · 1.74 KB
/
Copy pathstart.bat
File metadata and controls
67 lines (59 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
@echo off
chcp 65001 >nul 2>&1
setlocal enabledelayedexpansion
REM ================================
REM IP Radar - IP Lookup Tool
REM http://127.0.0.1:8000
REM ================================
set "PROJECT_ROOT=%~dp0"
cd /d "%PROJECT_ROOT%"
echo ========================================
echo IP Radar - IP Lookup Tool
echo ========================================
echo.
REM --- Check Python ---
set "PYTHON="
where python3 >nul 2>&1 && set "PYTHON=python3"
if not defined PYTHON (
where python >nul 2>&1 && set "PYTHON=python"
)
if not defined PYTHON (
echo [ERROR] Python not found. Please install Python 3.12+
pause
exit /b 1
)
echo Python: !PYTHON! --version
REM --- Virtual environment ---
if not exist "backend\.venv\Scripts\activate.bat" (
echo Venv: Not found, creating...
"!PYTHON!" -m venv backend\.venv
call backend\.venv\Scripts\activate.bat
"!PYTHON!" -m pip install -q -r backend\requirements.txt
) else (
call backend\.venv\Scripts\activate.bat
)
echo Venv: %VENV%
REM --- Frontend build ---
if not exist "frontend\dist\index.html" (
echo Frontend: Not built, building...
where npm >nul 2>&1
if !ERRORLEVEL! equ 0 (
cd frontend
call npm ci --silent 2>nul
call npm run build
cd "%PROJECT_ROOT%"
echo Frontend: Build complete
) else (
echo Frontend: npm not found, API only mode
)
) else (
echo Frontend: Already built
)
echo.
echo --^> http://127.0.0.1:8000
echo Ctrl+C to stop
echo.
cd backend
for /f %%N in ('python -m ipdb._batch_pool n-workers') do set WORKERS=%%N
python -m uvicorn main:app --host 127.0.0.1 --port 8000 --workers %WORKERS%
pause