#!/bin/bash # LuckyChit Flutter Web Deployment Script # Quick script to rebuild and deploy web changes echo "๐Ÿš€ Deploying Flutter Web Updates" echo "=================================" echo "" # Check if we're in the right directory if [ ! -f "pubspec.yaml" ]; then echo "โŒ Error: pubspec.yaml not found!" echo "Please run this script from the luckychit directory" exit 1 fi # Clean previous build echo "๐Ÿงน Cleaning previous build..." flutter clean # Get dependencies echo "๐Ÿ“ฆ Getting dependencies..." flutter pub get # Build for production echo "๐Ÿ”จ Building for web (production mode)..." echo " This may take a few minutes..." flutter build web --release # Check if build was successful if [ $? -eq 0 ]; then echo "" echo "โœ… Build successful!" echo "" echo "๐Ÿ“ Build output location: build/web/" echo "" echo "๐Ÿ“ค Next steps to deploy:" echo "" echo "Option 1 - nginx (Recommended):" echo " sudo cp -r build/web/* /var/www/luckychit/" echo " sudo systemctl restart nginx" echo "" echo "Option 2 - PM2 with Express:" echo " pm2 restart luckychit-web" echo "" echo "Option 3 - Upload to server:" echo " scp -r build/web/* user@server:/var/www/luckychit/" echo "" echo "๐Ÿ’ก Tip: Users may need to clear browser cache (Ctrl+Shift+R)" else echo "" echo "โŒ Build failed! Please check the errors above." exit 1 fi