deckhearth/deploy-vercel.sh

64 lines
No EOL
2 KiB
Bash
Executable file

#!/bin/bash
# TCG Vault - Vercel Pro Deployment Script
echo "🚀 Preparing TCG Vault for Vercel Pro deployment..."
echo ""
# Check if we're in the right directory
if [ ! -d "frontend" ] || [ ! -d "backend" ]; then
echo "❌ Please run this script from the tcg-vault root directory"
exit 1
fi
echo "📦 Setting up frontend for Vercel..."
cd frontend
# Install dependencies (if needed)
if [ ! -d "node_modules" ]; then
echo "📥 Installing frontend dependencies..."
npm install
fi
# Run build test
echo "🔨 Testing production build..."
npm run build
if [ $? -eq 0 ]; then
echo "✅ Frontend build successful!"
else
echo "❌ Frontend build failed. Please fix errors and try again."
exit 1
fi
cd ..
echo ""
echo "🎯 Next Steps for Vercel Pro Deployment:"
echo ""
echo "1. 🏗️ BACKEND (Railway):"
echo " • Push your backend/ folder to a GitHub repository"
echo " • Connect to Railway at https://railway.app"
echo " • Set environment variable: ALLOWED_ORIGINS=https://your-app.vercel.app"
echo ""
echo "2. 🌟 FRONTEND (Vercel Pro):"
echo " • Push your frontend/ folder to a GitHub repository"
echo " • Go to https://vercel.com/dashboard"
echo " • Import Project → Connect your frontend GitHub repo"
echo " • Add environment variable: REACT_APP_API_URL=https://your-railway-app.railway.app/api/v1"
echo " • Deploy! 🚀"
echo ""
echo "💡 Pro Tips:"
echo " • Use separate GitHub repos for frontend and backend"
echo " • Vercel will auto-detect React settings"
echo " • Railway will auto-detect Python/FastAPI"
echo " • Both will auto-deploy when you push code updates"
echo ""
echo "🎉 With Vercel Pro, you get enterprise-grade hosting with:"
echo " ⚡ Global edge network (40+ locations)"
echo " 📊 Advanced observability & monitoring"
echo " 🔒 Enterprise security (WAF protection)"
echo " 🚀 4-CPU build machines (2x faster builds)"
echo " 📈 10M requests & 1TB transfer included"
echo ""
echo "✨ Your TCG Vault will be blazing fast worldwide!"