70 lines
1.6 KiB
Batchfile
70 lines
1.6 KiB
Batchfile
@echo off
|
||
echo 🐢 Turtle Control Center - Setup ^& Start
|
||
echo ========================================
|
||
echo.
|
||
|
||
REM Check if Node.js is installed
|
||
where node >nul 2>nul
|
||
if %ERRORLEVEL% NEQ 0 (
|
||
echo ❌ Node.js is not installed. Please install Node.js 18+ first.
|
||
echo Visit: https://nodejs.org/
|
||
pause
|
||
exit /b 1
|
||
)
|
||
|
||
echo ✅ Node.js is installed
|
||
node --version
|
||
echo.
|
||
|
||
REM Install server dependencies
|
||
echo 📦 Installing server dependencies...
|
||
cd server
|
||
if not exist "node_modules\" (
|
||
call npm install
|
||
if %ERRORLEVEL% NEQ 0 (
|
||
echo ❌ Failed to install server dependencies
|
||
pause
|
||
exit /b 1
|
||
)
|
||
) else (
|
||
echo ℹ️ Dependencies already installed (skipping)
|
||
)
|
||
cd ..
|
||
|
||
REM Install client dependencies
|
||
echo 📦 Installing client dependencies...
|
||
cd client
|
||
if not exist "node_modules\" (
|
||
call npm install
|
||
if %ERRORLEVEL% NEQ 0 (
|
||
echo ❌ Failed to install client dependencies
|
||
pause
|
||
exit /b 1
|
||
)
|
||
) else (
|
||
echo ℹ️ Dependencies already installed (skipping)
|
||
)
|
||
cd ..
|
||
|
||
echo.
|
||
echo ✨ Setup complete!
|
||
echo.
|
||
echo 🚀 Starting servers...
|
||
echo.
|
||
echo Server will be available at:
|
||
echo 🌐 Web Interface: http://localhost:3000
|
||
echo 📡 API Server: http://localhost:3001
|
||
echo 🔌 WebSocket: ws://localhost:3002
|
||
echo.
|
||
echo Press Ctrl+C to stop all servers
|
||
echo.
|
||
|
||
REM Start both servers
|
||
start "Turtle Control Server" cmd /k "cd server && npm start"
|
||
timeout /t 2 /nobreak >nul
|
||
start "Turtle Control Client" cmd /k "cd client && npm run dev"
|
||
|
||
echo.
|
||
echo ✅ Both servers are starting in separate windows
|
||
pause
|