-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_windows.bat
More file actions
47 lines (41 loc) · 1.32 KB
/
Copy pathstart_windows.bat
File metadata and controls
47 lines (41 loc) · 1.32 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
@chcp 65001 > nul
@echo off
echo ========================================================
echo AI Note Application - One-Click Launcher
echo ========================================================
echo [0/3] Checking Ports...
call :freePort 3000
call :freePort 5176
echo [1/3] Checking Frontend Dependencies...
if not exist "node_modules" (
echo node_modules not found. Installing frontend dependencies...
call npm install
) else (
echo Frontend dependencies ready.
)
echo [2/3] Checking Backend Dependencies...
if not exist "server\node_modules" (
echo server/node_modules not found. Installing backend dependencies...
cd server
call npm install
cd ..
) else (
echo Backend dependencies ready.
)
echo [3/3] Starting Backend and Frontend Services...
echo.
echo Application will open in your default browser...
echo Press Ctrl+C to stop the servers.
echo.
start "" cmd /c "timeout /t 2 /nobreak > nul & start http://localhost:5176"
npm run dev
:freePort
set PORT=%1
for /f "tokens=5" %%a in ('netstat -ano ^| findstr :%PORT% ^| findstr LISTENING') do set PID=%%a
if "%PID%"=="" goto :eof
for /f "tokens=1" %%b in ('tasklist /FI "PID eq %PID%" /NH') do set PNAME=%%b
echo Port %PORT% is in use by PID %PID% (%PNAME%). Attempting to stop it...
taskkill /F /PID %PID% > nul 2>&1
set PID=
set PNAME=
goto :eof