veza/scripts/archive/validate-veza.sh
2025-12-12 21:34:34 -05:00

187 lines
No EOL
4.9 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
# 🎵 Veza Platform - Validation Finale
# ====================================
echo "🎵 Validation finale de Veza Platform"
echo "===================================="
echo ""
# Couleurs
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
print_success() {
echo -e "${GREEN}$1${NC}"
}
print_error() {
echo -e "${RED}$1${NC}"
}
print_info() {
echo -e "${BLUE} $1${NC}"
}
print_warning() {
echo -e "${YELLOW}⚠️ $1${NC}"
}
# Validation 1: Services de base
echo "🔧 Validation des services de base..."
echo "------------------------------------"
# Backend API
if curl -s http://localhost:8080/api/health | grep -q "healthy"; then
print_success "Backend API opérationnel"
else
print_error "Backend API non accessible"
fi
# Frontend Web
if curl -s http://localhost:5176/ > /dev/null; then
print_success "Frontend Web accessible"
else
print_error "Frontend Web non accessible"
fi
# PostgreSQL
if pg_isready -h localhost -p 5432 > /dev/null 2>&1; then
print_success "PostgreSQL opérationnel"
else
print_error "PostgreSQL non accessible"
fi
# Redis
if redis-cli ping | grep -q "PONG"; then
print_success "Redis opérationnel"
else
print_error "Redis non accessible"
fi
echo ""
# Validation 2: Fonctionnalités principales
echo "🎵 Validation des fonctionnalités principales..."
echo "---------------------------------------------"
# Test de l'API backend
HEALTH_RESPONSE=$(curl -s http://localhost:8080/api/health)
if echo "$HEALTH_RESPONSE" | grep -q "healthy"; then
print_success "API Backend fonctionnelle"
VERSION=$(echo "$HEALTH_RESPONSE" | jq -r '.version' 2>/dev/null || echo "N/A")
print_info "Version Backend: $VERSION"
else
print_error "API Backend non fonctionnelle"
fi
# Test de l'interface web
WEB_RESPONSE=$(curl -s http://localhost:5176/)
if echo "$WEB_RESPONSE" | grep -q "react"; then
print_success "Interface React chargée"
else
print_error "Interface React non chargée"
fi
echo ""
# Validation 3: Architecture et fichiers
echo "🏗️ Validation de l'architecture..."
echo "--------------------------------"
# Vérifier la structure des dossiers
DIRECTORIES=("veza-frontend" "veza-backend-api" "veza-desktop" "veza-chat-server")
for dir in "${DIRECTORIES[@]}"; do
if [ -d "$dir" ]; then
print_success "Dossier $dir présent"
else
print_error "Dossier $dir manquant"
fi
done
# Vérifier les fichiers de configuration
FILES=("docker-compose.production.yml" "start-veza.sh" "stop-veza.sh")
for file in "${FILES[@]}"; do
if [ -f "$file" ]; then
print_success "Fichier $file présent"
else
print_error "Fichier $file manquant"
fi
done
echo ""
# Validation 4: Ports et processus
echo "🔌 Validation des ports et processus..."
echo "-------------------------------------"
# Vérifier les ports essentiels
PORTS=(
"5176:Frontend"
"8080:Backend"
"5432:PostgreSQL"
"6379:Redis"
)
for port_info in "${PORTS[@]}"; do
port=$(echo $port_info | cut -d: -f1)
service=$(echo $port_info | cut -d: -f2)
if netstat -tuln 2>/dev/null | grep -q ":$port "; then
print_success "Port $port ($service) ouvert"
else
print_warning "Port $port ($service) fermé ou non détecté"
fi
done
echo ""
# Validation 5: Résumé et recommandations
echo "📊 Résumé de la validation"
echo "=========================="
# Compter les succès
SUCCESS_COUNT=$(grep -c "✅" <<< "$(tail -n +50 $0)")
ERROR_COUNT=$(grep -c "❌" <<< "$(tail -n +50 $0)")
WARNING_COUNT=$(grep -c "⚠️" <<< "$(tail -n +50 $0)")
echo "Tests réussis: $SUCCESS_COUNT"
echo "Tests échoués: $ERROR_COUNT"
echo "Avertissements: $WARNING_COUNT"
echo ""
if [ $ERROR_COUNT -eq 0 ]; then
echo -e "${GREEN}🎉 Veza Platform est complètement fonctionnel !${NC}"
echo ""
echo "📱 Accès aux applications :"
echo " 🌐 Web App: http://localhost:5176"
echo " 🖥️ Desktop: ./start-desktop.sh"
echo ""
echo "🔧 Services actifs :"
echo " ✅ Backend API: http://localhost:8080"
echo " ✅ Frontend: http://localhost:5176"
echo " ✅ PostgreSQL: localhost:5432"
echo " ✅ Redis: localhost:6379"
echo ""
echo "🚀 Commandes utiles :"
echo " - Démarrage complet: ./start-veza.sh"
echo " - Arrêt: ./stop-veza.sh"
echo " - Test complet: ./test-veza-complete.sh"
echo " - Desktop: ./start-desktop.sh"
echo ""
echo -e "${GREEN}✅ L'application Veza est prête à être utilisée !${NC}"
else
echo -e "${YELLOW}⚠️ Veza Platform est partiellement fonctionnel.${NC}"
echo ""
echo "🔧 Actions recommandées :"
echo " - Redémarrer les services: ./start-veza.sh"
echo " - Vérifier les logs: tail -f logs/*.log"
echo " - Tester manuellement: http://localhost:5176"
fi
echo ""
echo "🎵 Validation terminée"