#!/bin/bash

# Build script for cPanel deployment
# This script creates a production-ready build

echo "🚀 Starting production build for cPanel deployment..."
echo ""

# Navigate to frontend directory
cd /app/frontend

echo "📦 Installing dependencies..."
yarn install

echo ""
echo "🏗️  Building production bundle..."
yarn build

echo ""
echo "✅ Build complete!"
echo ""
echo "📁 Your production files are in: /app/frontend/build"
echo ""
echo "📋 Next steps:"
echo "1. Compress the build folder: cd /app/frontend && tar -czf build.tar.gz build/"
echo "2. Download build.tar.gz"
echo "3. Upload to your cPanel hosting"
echo "4. Extract in your public_html directory"
echo "5. Copy the .htaccess file from /app/frontend/public/.htaccess to your public_html directory"
echo ""
echo "📖 For detailed instructions, see: /app/CPANEL_DEPLOYMENT.md"
