Backup: 2025-07-21 18:13 - I got Claude Code
Some checks failed
CI/CD Pipeline / Backend Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Tests (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (push) Has been cancelled
CI/CD Pipeline / Security Scan (push) Has been cancelled
CI/CD Pipeline / Deploy to Staging (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
E2E Tests / E2E Tests - ${{ github.event.inputs.environment || 'staging' }} (push) Has been cancelled
E2E Tests / Notify Results (push) Has been cancelled
Dependency Updates / Update Dependencies (push) Has been cancelled

[Restore from backup: vip-coordinator-backup-2025-07-21-18-13-I got Claude Code]
This commit is contained in:
2025-07-21 18:13:00 +02:00
parent 36cb8e8886
commit 8ace1ab2c1
33 changed files with 3507 additions and 3656 deletions

151
deploy.sh
View File

@@ -1,139 +1,130 @@
#!/bin/bash
# VIP Coordinator Quick Deploy Script
# This script helps you deploy the VIP Coordinator application using Docker
# VIP Coordinator - Quick Deployment Script
# This script helps you deploy VIP Coordinator with Docker
set -e
echo "🚀 VIP Coordinator Deployment Script"
echo "===================================="
echo "🚀 VIP Coordinator - Quick Deployment Script"
echo "============================================="
# Check if Docker is installed
if ! command -v docker &> /dev/null; then
echo "❌ Docker is not installed. Please install Docker first."
echo " Visit: https://docs.docker.com/get-docker/"
exit 1
fi
# Check if Docker Compose is installed
if ! command -v docker-compose &> /dev/null; then
echo "❌ Docker Compose is not installed. Please install Docker Compose first."
echo " Visit: https://docs.docker.com/compose/install/"
exit 1
fi
echo "✅ Docker and Docker Compose are installed"
# Check if .env file exists
if [ ! -f ".env" ]; then
echo "⚠️ No .env file found. Creating one from .env.example..."
if [ -f ".env.example" ]; then
echo "📝 Creating .env file from template..."
cp .env.example .env
echo "✅ Created .env file from .env.example"
echo "⚠️ IMPORTANT: Please edit .env file with your configuration before continuing!"
echo " Required changes:"
echo " - DB_PASSWORD: Set a secure database password"
echo " - ADMIN_PASSWORD: Set a secure admin password"
echo " - GOOGLE_CLIENT_ID: Your Google OAuth Client ID"
echo " - GOOGLE_CLIENT_SECRET: Your Google OAuth Client Secret"
echo " - Update domain settings for production deployment"
echo ""
echo "🔧 IMPORTANT: Please edit the .env file and update the following:"
echo " - POSTGRES_PASSWORD (set a secure password)"
echo " - GOOGLE_CLIENT_ID (from Google Cloud Console)"
echo " - GOOGLE_CLIENT_SECRET (from Google Cloud Console)"
echo " - VITE_API_URL (your backend URL)"
echo " - VITE_FRONTEND_URL (your frontend URL)"
echo ""
echo "📖 For Google OAuth setup instructions, see:"
echo " https://console.cloud.google.com/"
echo ""
read -p "Press Enter after updating the .env file to continue..."
read -p "Press Enter after you've updated the .env file..."
else
echo "❌ .env.example file not found. Please create a .env file manually."
echo "❌ .env.example file not found. Please ensure you have the deployment files."
exit 1
fi
fi
# Validate required environment variables
echo "🔍 Validating environment configuration..."
echo "🔍 Validating configuration..."
# Source the .env file
set -a
source .env
set +a
# Check required variables
REQUIRED_VARS=("POSTGRES_PASSWORD" "GOOGLE_CLIENT_ID" "GOOGLE_CLIENT_SECRET")
MISSING_VARS=()
if [ -z "$DB_PASSWORD" ] || [ "$DB_PASSWORD" = "VipCoord2025SecureDB" ]; then
echo "⚠️ Warning: Please change DB_PASSWORD from the default value"
fi
for var in "${REQUIRED_VARS[@]}"; do
if [ -z "${!var}" ] || [ "${!var}" = "your_secure_password_here" ] || [ "${!var}" = "your_google_client_id_here" ] || [ "${!var}" = "your_google_client_secret_here" ]; then
MISSING_VARS+=("$var")
fi
done
if [ -z "$ADMIN_PASSWORD" ] || [ "$ADMIN_PASSWORD" = "ChangeThisSecurePassword" ]; then
echo "⚠️ Warning: Please change ADMIN_PASSWORD from the default value"
fi
if [ ${#MISSING_VARS[@]} -ne 0 ]; then
echo "❌ The following required environment variables are missing or have default values:"
for var in "${MISSING_VARS[@]}"; do
echo " - $var"
done
echo ""
echo "Please update your .env file with the correct values."
if [ -z "$GOOGLE_CLIENT_ID" ] || [ "$GOOGLE_CLIENT_ID" = "your-google-client-id.apps.googleusercontent.com" ]; then
echo "❌ Error: GOOGLE_CLIENT_ID must be configured"
echo " Please set up Google OAuth and update your .env file"
exit 1
fi
echo "✅ Environment configuration looks good!"
if [ -z "$GOOGLE_CLIENT_SECRET" ] || [ "$GOOGLE_CLIENT_SECRET" = "your-google-client-secret" ]; then
echo "❌ Error: GOOGLE_CLIENT_SECRET must be configured"
echo " Please set up Google OAuth and update your .env file"
exit 1
fi
# Pull the latest images
echo ""
echo "📥 Pulling latest Docker images..."
docker pull t72chevy/vip-coordinator:backend-latest
docker pull t72chevy/vip-coordinator:frontend-latest
echo "✅ Configuration validated"
# Stop existing containers if running
echo ""
echo "🛑 Stopping existing containers (if any)..."
docker-compose down --remove-orphans || true
# Pull latest images
echo "📥 Pulling latest images from Docker Hub..."
docker-compose pull
# Start the application
echo ""
echo "🚀 Starting VIP Coordinator application..."
echo "🚀 Starting VIP Coordinator..."
docker-compose up -d
# Wait for services to be healthy
echo ""
# Wait for services to be ready
echo "⏳ Waiting for services to start..."
sleep 10
# Check service status
echo ""
echo "📊 Service Status:"
echo "🔍 Checking service status..."
docker-compose ps
# Check if services are healthy
echo ""
echo "🏥 Health Checks:"
# Check if backend is healthy
echo "🏥 Checking backend health..."
for i in {1..30}; do
if curl -s http://localhost:3000/health > /dev/null 2>&1; then
echo "✅ Backend is healthy"
break
fi
if [ $i -eq 30 ]; then
echo "❌ Backend health check failed"
echo " Check logs with: docker-compose logs backend"
exit 1
fi
sleep 2
done
# Check backend health
if curl -f -s http://localhost:3000/health > /dev/null 2>&1; then
echo "✅ Backend is healthy"
else
echo "⚠️ Backend health check failed (may still be starting up)"
fi
# Check frontend
if curl -f -s http://localhost > /dev/null 2>&1; then
# Check if frontend is accessible
echo "🌐 Checking frontend..."
if curl -s http://localhost/ > /dev/null 2>&1; then
echo "✅ Frontend is accessible"
else
echo "⚠️ Frontend health check failed (may still be starting up)"
echo "⚠️ Frontend check failed, but this might be normal during startup"
fi
echo ""
echo "🎉 Deployment complete!"
echo ""
echo "📱 Access your application:"
echo "🎉 VIP Coordinator deployment completed!"
echo "============================================="
echo "📍 Access your application:"
echo " Frontend: http://localhost"
echo " Backend API: http://localhost:3000"
echo " Health Check: http://localhost:3000/health"
echo ""
echo "📋 Useful commands:"
echo " View logs: docker-compose logs -f"
echo " Stop app: docker-compose down"
echo " Restart: docker-compose restart"
echo " Update: docker-compose pull && docker-compose up -d"
echo "📋 Next steps:"
echo " 1. Open http://localhost in your browser"
echo " 2. Click 'Continue with Google' to set up your admin account"
echo " 3. The first user to log in becomes the administrator"
echo ""
echo "🆘 If you encounter issues:"
echo " 1. Check logs: docker-compose logs"
echo " 2. Verify .env configuration"
echo " 3. Ensure Google OAuth is properly configured"
echo " 4. Check that ports 80 and 3000 are available"
echo "🔧 Management commands:"
echo " View logs: docker-compose logs"
echo " Stop app: docker-compose down"
echo " Update app: docker-compose pull && docker-compose up -d"
echo ""
echo "📖 For production deployment, see DEPLOYMENT.md"