@echo off title PAKRAH - Dev Servers set PHP=G:\WEB-SERVER\php\php.exe set ROOT=%~dp0 echo ============================================ echo PAKRAH - Starting dev servers echo ============================================ rem --- 1) MySQL --- tasklist /fi "imagename eq mysqld.exe" | find /i "mysqld.exe" >nul if errorlevel 1 ( echo [1/3] MySQL is stopped, starting... start "" "%ROOT%..\..\mysql\bin\mysqld.exe" --defaults-file="%ROOT%..\..\mysql\bin\my.ini" timeout /t 8 /nobreak >nul ) else ( echo [1/3] MySQL is already running. ) rem --- 2) Backend : Laravel on :8000 --- netstat -ano | findstr /r /c:":8000 .*LISTENING" >nul if errorlevel 1 ( echo [2/3] Starting backend Laravel on http://127.0.0.1:8000 start "PAKRAH Backend" /min cmd /k "cd /d "%ROOT%backend" && "%PHP%" artisan serve --host=127.0.0.1 --port=8000" ) else ( echo [2/3] Backend already running on port 8000. ) rem --- 3) Frontend : Vite on :3000 --- netstat -ano | findstr /r /c:":3000 .*LISTENING" >nul if errorlevel 1 ( echo [3/3] Starting frontend Vite on all interfaces start "PAKRAH Frontend" /min cmd /k "cd /d "%ROOT%frontend" && npm run dev -- --host 0.0.0.0 --port 3000 --strictPort" ) else ( echo [3/3] Frontend already running on port 3000. ) echo. echo Ready: echo Local Admin panel ^> http://127.0.0.1:3000/ echo Network Admin panel ^> http://172.24.30.8:3000/ echo Local Officer app ^> http://127.0.0.1:3000/app echo Network Officer app ^> http://172.24.30.8:3000/app echo.