#!/bin/bash echo "🚀 DĂ©marrage de Veza Platform en mode dĂ©veloppement..." # VĂ©rifier si les ports sont disponibles check_port() { if lsof -Pi :$1 -sTCP:LISTEN -t >/dev/null ; then echo "⚠ Le port $1 est dĂ©jĂ  utilisĂ©. ArrĂȘt du processus..." sudo lsof -ti:$1 | xargs kill -9 2>/dev/null || true fi } # VĂ©rifier et libĂ©rer les ports check_port 8081 check_port 5176 # DĂ©marrer le backend echo "📡 DĂ©marrage du backend API..." cd veza-backend-api go run simple-server.go & BACKEND_PID=$! cd .. # Attendre que le backend dĂ©marre sleep 3 # VĂ©rifier que le backend fonctionne if curl -s http://localhost:8081/api/v1/health > /dev/null; then echo "✅ Backend API dĂ©marrĂ© avec succĂšs sur http://localhost:8081" else echo "❌ Erreur: Le backend n'a pas dĂ©marrĂ© correctement" exit 1 fi # DĂ©marrer le frontend echo "🌐 DĂ©marrage du frontend web..." cd veza-frontend npm run dev & FRONTEND_PID=$! cd .. # Attendre que le frontend dĂ©marre sleep 5 # VĂ©rifier que le frontend fonctionne if curl -s http://localhost:5176 > /dev/null; then echo "✅ Frontend web dĂ©marrĂ© avec succĂšs sur http://localhost:5176" else echo "❌ Erreur: Le frontend n'a pas dĂ©marrĂ© correctement" exit 1 fi echo "" echo "🎉 Veza Platform est maintenant opĂ©rationnel !" echo "" echo "đŸ“± Applications disponibles:" echo " 🌐 Web App: http://localhost:5176" echo " 📊 API Backend: http://localhost:8081" echo " 📈 Health Check: http://localhost:8081/api/v1/health" echo "" echo "đŸ–„ïž Pour dĂ©marrer l'application desktop:" echo " ./start-desktop.sh" echo "" echo "âč Pour arrĂȘter tous les services:" echo " ./stop-veza.sh" echo "" # Fonction de nettoyage cleanup() { echo "" echo "🛑 ArrĂȘt des services..." kill $BACKEND_PID 2>/dev/null || true kill $FRONTEND_PID 2>/dev/null || true echo "✅ Services arrĂȘtĂ©s" exit 0 } # Capturer Ctrl+C pour arrĂȘter proprement trap cleanup SIGINT # Attendre indĂ©finiment echo "⏳ Appuyez sur Ctrl+C pour arrĂȘter les services..." wait