┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ CPANEL DEPLOYMENT - QUICK REFERENCE ┃ ┃ Waste Management Backend ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ 📌 STEP-BY-STEP (5 MINUTES) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1. CREATE DATABASE IN CPANEL ┌────────────────────────────────────────────────┐ │ cPanel → MySQL Databases → Create New │ │ Database Name: waste_management │ │ Username: waste_user │ │ Password: [Your Strong Password] │ │ Grant ALL PRIVILEGES │ └────────────────────────────────────────────────┘ 2. UPLOAD FILES ┌────────────────────────────────────────────────┐ │ • ZIP the 'backend' folder │ │ • cPanel → File Manager → public_html │ │ • Upload ZIP │ │ • Extract ZIP │ │ • Move all files to public_html root │ └────────────────────────────────────────────────┘ 3. CONFIGURE .ENV ┌────────────────────────────────────────────────┐ │ File Manager → Edit .env │ │ │ │ Update these lines: │ │ APP_ENV=production │ │ APP_DEBUG=false │ │ APP_URL=https://yourdomain.com │ │ │ │ DB_CONNECTION=mysql │ │ DB_HOST=localhost │ │ DB_DATABASE=cpanel_prefix_waste_management │ │ DB_USERNAME=cpanel_prefix_waste_user │ │ DB_PASSWORD=your_password │ └────────────────────────────────────────────────┘ 4. IMPORT DATABASE ┌────────────────────────────────────────────────┐ │ cPanel → phpMyAdmin │ │ Select your database │ │ Import → Choose file │ │ Select: database/mysql_migration.sql │ │ Click Go │ └────────────────────────────────────────────────┘ 5. SET PERMISSIONS ┌────────────────────────────────────────────────┐ │ Right-click → Change Permissions → 755 │ │ │ │ Folders to set: │ │ • storage/ │ │ • storage/framework/ │ │ • storage/logs/ │ │ • bootstrap/cache/ │ └────────────────────────────────────────────────┘ 6. CONFIGURE DOMAIN ┌────────────────────────────────────────────────┐ │ cPanel → Domains │ │ Set Document Root: │ │ /public_html/public │ │ │ │ Enable SSL (Let's Encrypt) │ └────────────────────────────────────────────────┘ 7. TEST API ┌────────────────────────────────────────────────┐ │ Visit: https://yourdomain.com/api/test │ │ │ │ Expected Response: │ │ { │ │ "success": true, │ │ "message": "API is working!", │ │ "version": "1.0.0" │ │ } │ └────────────────────────────────────────────────┘ 8. UPDATE FLUTTER APP ┌────────────────────────────────────────────────┐ │ lib/api_constants.dart: │ │ │ │ final String url = "https://yourdomain.com"; │ │ final String baseUrl = │ │ "https://yourdomain.com/api"; │ └────────────────────────────────────────────────┘ 🔐 IMPORTANT CREDENTIALS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Default Admin Login: 📧 Email: admin@wastemanagement.com 🔑 Password: Admin@123 ⚠️ CHANGE AFTER FIRST LOGIN! Email SMTP (Pre-configured): 📮 Host: smtp.hostinger.com 🔌 Port: 465 📧 Email: contact@getmyxam.com 🔑 Password: Demo4512@ 📁 IMPORTANT FILES ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Must be uploaded: ✓ .htaccess (root folder) ✓ public/.htaccess ✓ .env (configured) ✓ All vendor/ files ✓ All app/ files ✓ database/mysql_migration.sql Documentation: 📖 DEPLOYMENT_GUIDE.txt (detailed instructions) ✅ DEPLOYMENT_CHECKLIST.txt (step-by-step) 📝 DEPLOYMENT_README.txt (overview) ⚡ COMMON ISSUES & FIXES ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ❌ 500 Internal Server Error ✅ Check storage/ permissions = 755 ✅ Check .env configuration ✅ Review storage/logs/laravel.log ❌ Database Connection Error ✅ Use full DB name: prefix_dbname ✅ Verify credentials in .env ✅ Check DB_HOST = localhost ❌ Routes Not Working ✅ Document root = /public ✅ .htaccess files uploaded ✅ mod_rewrite enabled ❌ CORS Errors ✅ Update config/cors.php ✅ Add app domain to allowed_origins 🧪 TEST ENDPOINTS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1. API Health: GET https://yourdomain.com/api/test 2. Login (get OTP): POST https://yourdomain.com/api/login Body: {"email": "admin@wastemanagement.com"} 3. Verify OTP: POST https://yourdomain.com/api/verify-otp Body: {"email": "admin@wastemanagement.com", "otp": "123456"} 📞 NEED HELP? ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Read full documentation: → DEPLOYMENT_GUIDE.txt → DEPLOYMENT_CHECKLIST.txt → DEPLOYMENT_README.txt Check Laravel logs: → storage/logs/laravel.log Enable debug mode (temporarily): → .env: APP_DEBUG=true ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ 🎉 YOUR BACKEND IS READY TO DEPLOY! ┃ ┃ Follow steps 1-8 and you'll be live in 5 minutes! ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛