#!/bin/bash # 🔄 Full Development Environment (Frontend + Backend) echo "🔄 Starting Full Development Environment..." # Navigate to project root PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # Function to check if command exists command_exists() { command -v "$1" >/dev/null 2>&1 } # Check Node.js if ! command_exists node; then echo "❌ Node.js is not installed. Please install Node.js first." exit 1 fi echo "✅ Node.js is ready" # Start backend in background echo "🔧 Starting Backend on http://localhost:3001..." cd "$PROJECT_DIR/backend" if [ ! -d "node_modules" ]; then echo "📦 Installing backend dependencies..." npm install fi npm run start:dev & BACKEND_PID=$! # Start frontend echo "🎨 Starting Frontend on http://localhost:3000..." cd "$PROJECT_DIR/frontend" if [ ! -d "node_modules" ]; then echo "📦 Installing frontend dependencies..." npm install fi # Wait a bit for backend to start sleep 3 npm run dev & FRONTEND_PID=$! echo "🎉 Full development environment started!" echo "Frontend: http://localhost:3000" echo "Backend: http://localhost:3001" # Wait for user to exit echo "Press Ctrl+C to stop all services..." # Cleanup on exit trap "kill $BACKEND_PID $FRONTEND_PID 2>/dev/null" EXIT wait