#!/bin/bash # LMDpro Production Deployment Script # This script automates the deployment process set -e echo "๐Ÿš€ Starting LMDpro deployment..." # Check if .env.production exists if [ ! -f ".env.production" ]; then echo "โŒ Error: .env.production file not found!" echo "Please create .env.production with your production environment variables." exit 1 fi # Install dependencies echo "๐Ÿ“ฆ Installing dependencies..." npm ci --only=production # Type check echo "๐Ÿ” Running type checks..." npm run typecheck # Build the application echo "๐Ÿ—๏ธ Building application..." npm run build # Test the build echo "๐Ÿงช Testing production build..." npm run start & BUILD_PID=$! sleep 10 # Check if the server is running if curl -f http://localhost:3000 >/dev/null 2>&1; then echo "โœ… Production build test successful!" kill $BUILD_PID else echo "โŒ Production build test failed!" kill $BUILD_PID exit 1 fi echo "๐ŸŽ‰ Deployment preparation complete!" echo "๐Ÿ“‹ Next steps:" echo "1. Upload the .next folder and other files to your hosting provider" echo "2. Set up environment variables on your hosting platform" echo "3. Configure your custom domain DNS settings" echo "4. Start the production server with 'npm start'"