Files
remoteturtle/start.sh

71 lines
1.5 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
echo "🐢 Turtle Control Center - Setup & Start"
echo "========================================"
echo ""
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed. Please install Node.js 18+ first."
echo " Visit: https://nodejs.org/"
exit 1
fi
echo "✅ Node.js version: $(node --version)"
echo ""
# Install server dependencies
echo "📦 Installing server dependencies..."
cd server
if [ ! -d "node_modules" ]; then
npm install
if [ $? -ne 0 ]; then
echo "❌ Failed to install server dependencies"
exit 1
fi
else
echo " Dependencies already installed (skipping)"
fi
cd ..
# Install client dependencies
echo "📦 Installing client dependencies..."
cd client
if [ ! -d "node_modules" ]; then
npm install
if [ $? -ne 0 ]; then
echo "❌ Failed to install client dependencies"
exit 1
fi
else
echo " Dependencies already installed (skipping)"
fi
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 ""
# Start both server and client
trap 'kill 0' SIGINT
cd server
npm start &
SERVER_PID=$!
cd ../client
npm run dev &
CLIENT_PID=$!
# Wait for both processes
wait $SERVER_PID $CLIENT_PID