═══════════════════════════════════════════════════════════════════════ CPANEL DEPLOYMENT CHECKLIST - Waste Management Backend ═══════════════════════════════════════════════════════════════════════ PRE-DEPLOYMENT ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ☐ 1. Access to cPanel hosting account ☐ 2. Domain or subdomain configured ☐ 3. PHP 8.1+ available on hosting ☐ 4. MySQL database access ☐ 5. FTP/File Manager access ☐ 6. SSL certificate ready (Let's Encrypt recommended) CPANEL SETUP ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ☐ 7. Create MySQL database via cPanel → MySQL Databases Database Name: ___________________________ ☐ 8. Create database user Username: _________________________________ Password: _________________________________ ☐ 9. Add user to database with ALL PRIVILEGES ☐ 10. Note down database credentials: - Full DB Name (with prefix): _______________ - Username (with prefix): _______________ - Password: _______________ FILE UPLOAD ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ☐ 11. ZIP the backend folder (exclude .git, node_modules) ☐ 12. Upload to cPanel File Manager → public_html ☐ 13. Extract ZIP file ☐ 14. Move all files from 'backend' folder to document root ☐ 15. Verify these files exist: ☐ .htaccess (root) ☐ public/.htaccess ☐ .env ☐ artisan ☐ composer.json CONFIGURATION ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ☐ 16. Edit .env file and update: ☐ APP_ENV=production ☐ APP_DEBUG=false ☐ APP_URL=https://yourdomain.com ☐ DB_CONNECTION=mysql ☐ DB_HOST=localhost ☐ DB_DATABASE= ☐ DB_USERNAME= ☐ DB_PASSWORD= ☐ MAIL_HOST=smtp.hostinger.com (already configured) ☐ MAIL_PORT=465 ☐ MAIL_USERNAME=contact@getmyxam.com ☐ MAIL_PASSWORD=Demo4512@ DATABASE MIGRATION ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ☐ 17. Go to cPanel → phpMyAdmin ☐ 18. Select your database ☐ 19. Click "Import" tab ☐ 20. Upload: database/mysql_migration.sql ☐ 21. Click "Go" to execute ☐ 22. Verify tables created: ☐ users ☐ requests ☐ trips ☐ notifications ☐ personal_access_tokens ☐ sessions ☐ cache ☐ migrations PERMISSIONS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ☐ 23. Set folder permissions to 755: ☐ storage/ ☐ storage/framework/ ☐ storage/framework/cache/ ☐ storage/framework/sessions/ ☐ storage/framework/views/ ☐ storage/logs/ ☐ bootstrap/cache/ ☐ 24. Set file permissions to 644 in storage/ DOMAIN CONFIGURATION ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ☐ 25. In cPanel → Domains, set Document Root to: /public_html/public (or /home/username/public_html/public) ☐ 26. Ensure .htaccess in root redirects to public/ ☐ 27. Enable SSL/HTTPS via cPanel → SSL/TLS TESTING ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ☐ 28. Test API endpoint: URL: https://yourdomain.com/api/test Expected: {"success": true, "message": "API is working!"} ☐ 29. Test login endpoint: POST: https://yourdomain.com/api/login Body: {"email": "admin@wastemanagement.com", "password": "Admin@123"} ☐ 30. Verify OTP email sent (check contact@getmyxam.com inbox) ☐ 31. Test other endpoints: ☐ /api/users ☐ /api/requests ☐ /api/trips FLUTTER APP UPDATE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ☐ 32. Update lib/api_constants.dart: final String url = "https://yourdomain.com"; final String baseUrl = "https://yourdomain.com/api"; ☐ 33. Rebuild Flutter app ☐ 34. Test login from Flutter app ☐ 35. Test all features: ☐ Authentication ☐ Request creation ☐ Trip management ☐ Notifications SECURITY ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ☐ 36. Change default admin password from Admin@123 ☐ 37. Ensure APP_DEBUG=false in production ☐ 38. Verify storage/ is NOT publicly accessible ☐ 39. Enable HTTPS-only access ☐ 40. Review storage/logs/laravel.log for errors FINAL VERIFICATION ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ☐ 41. All API endpoints working ☐ 42. Database connected successfully ☐ 43. Email notifications working ☐ 44. SSL certificate active ☐ 45. Flutter app connected to production ☐ 46. No errors in Laravel logs ☐ 47. Authentication working ☐ 48. File uploads working (if applicable) OPTIONAL OPTIMIZATIONS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ☐ 49. Run: php artisan config:cache (if SSH available) ☐ 50. Run: php artisan route:cache ☐ 51. Run: php artisan view:cache ☐ 52. Set up automated backups via cPanel ☐ 53. Configure cron jobs if needed ═══════════════════════════════════════════════════════════════════════ DEPLOYMENT COMPLETE! 🎉 ═══════════════════════════════════════════════════════════════════════ Your API is now live at: https://yourdomain.com/api Default Admin Credentials: Email: admin@wastemanagement.com Password: Admin@123 ⚠️ IMPORTANT: Change the admin password immediately! Need help? Check DEPLOYMENT_GUIDE.txt for detailed instructions.