Files
plantillas-proyectos/scripts/frontend-entrypoint.sh
acazares 73a535291a feat: implement sidebar components and authentication flow
- Added sidebar menu components including sidebar-menu-item, sidebar-menu-skeleton, sidebar-menu-sub-button, sidebar-menu-sub-item, sidebar-menu-sub, sidebar-menu, sidebar-provider, sidebar-rail, sidebar-separator, sidebar-trigger, and sidebar.
- Introduced skeleton loading states for sidebar items.
- Integrated tooltip components for enhanced user interaction.
- Developed mobile responsiveness using media queries.
- Established authentication flow with Keycloak, including login, logout, and token management.
- Implemented server-side redirection based on authentication status.
- Enhanced error handling and logging for authentication processes.
2025-11-01 20:04:43 -05:00

45 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
set -e
# Script de inicialización para el Frontend SvelteKit
# Espera a que el backend esté disponible antes de iniciar
echo "=========================================="
echo "Frontend SvelteKit - Inicialización"
echo "=========================================="
# Función para esperar al backend
wait_for_backend() {
local url=$1
local max_attempts=30
local attempt=1
echo "Esperando a que el Backend esté disponible en ${url}..."
while [ $attempt -le $max_attempts ]; do
if wget -q -O /dev/null "${url}/health" 2>/dev/null; then
echo "✓ Backend está listo"
return 0
fi
echo "Backend no está listo aún... (intento $attempt/$max_attempts)"
attempt=$((attempt + 1))
sleep 3
done
echo "⚠ WARNING: Backend no estuvo disponible, continuando de todas formas"
return 0
}
# Esperar al backend
# En Docker, usamos el nombre del servicio. En desarrollo local, VITE_API_URL apunta a localhost
BACKEND_HEALTH_URL="${BACKEND_INTERNAL_URL:-http://backend:8000/api}"
wait_for_backend "${BACKEND_HEALTH_URL}"
echo "=========================================="
echo "Iniciando aplicación SvelteKit..."
echo "=========================================="
# Ejecutar el comando que se pasó al contenedor
exec "$@"