Files
remoteturtle/start.sh
MayaTheShy 29dfde9f25 feat: Initialize Turtle Control Center with React and WebSocket server
- Added index.html for the main entry point of the client application.
- Created package.json for client dependencies and scripts.
- Implemented App component with view controls and layout.
- Added CSS styles for the application and components.
- Developed ControlPanel component for turtle management and commands.
- Created Map3D component for 3D visualization of turtles.
- Established Zustand store for state management of turtles and WebSocket connection.
- Set up server with Express and WebSocket for handling turtle updates and commands.
- Added REST API endpoints for turtle status updates and command handling.
- Implemented start.sh script for setting up and running the application.
2026-02-15 23:49:46 -05:00

71 lines
1.5 KiB
Bash
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