#!/bin/bash
# Transfer workspace to Ubuntu server using rsync

# Configuration
SERVER_USER="admin_n"
SERVER_IP="192.168.43.201"  # Replace with your actual server IP
REMOTE_PATH="~/infoscreen_server_2025"

echo "🚀 Transferring workspace to Ubuntu server..."

# Check if server IP is provided
if [ "$SERVER_IP" = "your-server-ip" ]; then
    echo "❌ Please edit this script and replace 'your-server-ip' with your actual server IP"
    exit 1
fi

# Get current directory (project root)
CURRENT_DIR="$(pwd)"
echo "📁 Transferring from: ${CURRENT_DIR}"

# Transfer files using rsync (more efficient than scp)
rsync -avz --progress \
  --exclude='node_modules/' \
  --exclude='__pycache__/' \
  --exclude='.git/' \
  --exclude='*.log' \
  --exclude='.vscode/' \
  --exclude='dashboard/.vite/' \
  --exclude='server/received_screenshots/' \
  --exclude='server/screenshots/' \
  --exclude='mosquitto/data/' \
  --exclude='mosquitto/log/' \
  ./ ${SERVER_USER}@${SERVER_IP}:${REMOTE_PATH}/

echo "✅ Transfer complete!"
echo ""
echo "📋 Next steps on your server:"
echo "1. SSH to your server: ssh ${SERVER_USER}@${SERVER_IP}"
echo "2. Go to project: cd infoscreen_server_2025"
echo "3. Run setup: ./setup-dev-environment.sh"
echo "4. Start development: ./start-dev.sh"
