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.
This commit is contained in:
MayaTheShy
2026-02-15 23:49:46 -05:00
parent dc6a9a94b7
commit 29dfde9f25
14 changed files with 1398 additions and 0 deletions

70
start.sh Normal file
View File

@@ -0,0 +1,70 @@
#!/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