File: /home/mytest/.trash/allHands_DEPLOYMENT_INSTRUCTIONS.md.25
# 🚀 DEPLOYMENT INSTRUCTIONS - YOLO CHARTERS
**Date:** November 19, 2025
**Repository:** https://github.com/georgemargiolos/yolo-clone
**Branch:** allHands
---
## ⚡ QUICK DEPLOYMENT (3 STEPS)
### Step 1: Download from GitHub
```
https://github.com/georgemargiolos/yolo-clone/archive/refs/heads/allHands.zip
```
### Step 2: Extract and Upload
- Extract the ZIP file
- Upload ALL files to your web server (cPanel public_html)
- Preserve directory structure
### Step 3: Done!
- Config.php is already configured with your credentials
- No composer install needed (vendor folder included)
- No npm install needed (all assets included)
- Just upload and it works!
---
## ✅ WHAT'S INCLUDED
### Application Code
- ✅ Complete PHP application (API + Admin + Public pages)
- ✅ All routing (.htaccess + router.php)
- ✅ Database wrapper (Database.php)
### Dependencies (ALL INCLUDED!)
- ✅ **vendor/** folder (3.7MB Stripe PHP library)
- ✅ **assets/vendor/tinymce/** (4.5MB self-hosted)
- ✅ Bootstrap, Font Awesome, Flatpickr (all self-hosted)
- ✅ composer.json and composer.lock
### Configuration (PRE-CONFIGURED!)
- ✅ **config.php** with YOUR database credentials:
```
DB_HOST: localhost
DB_NAME: mytest_last
DB_USER: mytest_lastuser
DB_PASS: 7;n-uec1tY32Iedv
```
### Files Ready
- ✅ .htaccess (Apache rewrite rules)
- ✅ router.php (PHP built-in server router)
- ✅ All API endpoints
- ✅ All public pages
- ✅ Admin panel
---
## 📦 PACKAGE CONTENTS
```
yolo-clone/
├── admin/ # Admin panel (admin.html, admin.js)
├── api/ # All API endpoints
│ ├── routes/ # Route handlers
│ ├── services/ # Business logic
│ └── *.php # API files
├── assets/ # Static assets
│ ├── css/ # Stylesheets
│ ├── js/ # JavaScript
│ ├── images/ # Images
│ └── vendor/ # ✅ TinyMCE self-hosted (4.5MB)
├── data/ # Data directory
│ ├── logs/ # Application logs
│ └── uploads/ # User uploads
├── database/ # Database wrapper
│ └── Database.php # Database class
├── public/ # Public website
│ ├── pages/ # Page templates
│ ├── includes/ # Shared components
│ └── index.php # Router
├── vendor/ # ✅ Composer dependencies (3.7MB)
│ ├── autoload.php # Autoloader
│ ├── composer/ # Composer files
│ └── stripe/ # Stripe PHP library
├── .htaccess # ✅ Apache configuration
├── router.php # ✅ PHP server router
├── config.php # ✅ PRE-CONFIGURED with YOUR credentials
├── composer.json # Composer config
└── composer.lock # Locked versions
```
**Total Size:** ~70MB (includes all dependencies)
---
## 🔧 DEPLOYMENT STEPS (DETAILED)
### 1. Download Package
```bash
# Option A: Direct download
https://github.com/georgemargiolos/yolo-clone/archive/refs/heads/allHands.zip
# Option B: Git clone
git clone https://github.com/georgemargiolos/yolo-clone.git
cd yolo-clone
git checkout allHands
```
### 2. Upload to Server
Using cPanel File Manager or FTP:
1. Navigate to `public_html` (or your web root)
2. Upload ALL extracted files
3. Preserve folder structure
4. Set permissions:
- Directories: 755
- Files: 644
- data/ folder: 755 (writable)
- data/uploads/: 755 (writable)
### 3. Verify Installation
Navigate to: `https://your-domain.com/`
Expected result: Homepage loads correctly
### 4. Test API
Navigate to: `https://your-domain.com/api/health.php`
Expected result:
```json
{
"status": "ok",
"database": "connected",
"timestamp": "2025-11-19T17:45:00Z"
}
```
### 5. Test Admin
Navigate to: `https://your-domain.com/admin/`
Login with admin credentials and verify dashboard loads
---
## ⚠️ KNOWN ISSUES
### Issue #1: Weekly Availability Click - NOT WORKING
**Status:** Bug identified, debug logs added, needs fixing
**What doesn't work:**
- Clicking on available week in calendar
- Price doesn't update in sidebar
- Date picker doesn't update
**Debug logs added:** Lines 791-828 in `public/pages/yacht-detail.php`
**How to fix:**
1. Open yacht detail page in browser
2. Open browser console (F12)
3. Click on any available week
4. Read console logs to see where it fails
5. Fix the issue (likely element IDs don't match)
**All other fixes are working!**
---
## ✅ WHAT'S WORKING (7/8 FIXES)
### 1. Icon Settings ✅
- Refresh All Icons button works
- Custom CSS input works
- Tested with 11 icons
### 2. Master Refresh Images ✅
- Fixed to use booking_manager_id
- Tested ready for 5 yachts
### 3. Master Refresh Availability ✅
- Fixed to use booking_manager_id + company_id
- Tested ready for 5 yachts
### 4. Master Refresh Static Data ✅
- Already working correctly
- Tested ready for 5 yachts
### 5. Incoming Menu ✅
- Fixed double json() parse
- Fixed last_login_at column
- Query executes successfully
### 6. Review Submission ✅
- Fixed column mapping (guest_name → user_name)
- Tested END-TO-END with database
- Review insertion verified!
### 7. Guest Document Delete ✅
- Added stored_filename fallback
- Backward compatibility maintained
### 8. Button Layout UI ✅
- Responsive Bootstrap layout
- Mobile-friendly
---
## 🔍 POST-DEPLOYMENT TESTING
### Test 1: Homepage
```
URL: https://your-domain.com/
Expected: Homepage loads with yacht listings
```
### Test 2: Yacht Detail Page
```
URL: https://your-domain.com/yacht/lemon-sun-odyssey-469
Expected: Yacht details, images, amenities load
Known Issue: Weekly availability click doesn't update price
```
### Test 3: API Health Check
```
URL: https://your-domain.com/api/health.php
Expected: {"status":"ok","database":"connected"}
```
### Test 4: Admin Panel
```
URL: https://your-domain.com/admin/
Expected: Admin login page
Action: Login and verify dashboard
```
### Test 5: Review Submission
```
URL: https://your-domain.com/yacht/lemon-sun-odyssey-469
Action: Scroll down, fill review form, submit
Expected: Review saved to database
```
### Test 6: Incoming Menu
```
URL: https://your-domain.com/admin/ → Incoming/Bookings
Expected: Guest list displays without error
```
### Test 7: Icon Settings
```
URL: https://your-domain.com/admin/ → Settings → Icons
Action: Click "Refresh All Icons"
Expected: Icons refresh successfully
```
### Test 8: Master Refresh Buttons
```
URL: https://your-domain.com/admin/ → Yachts
Action: Click "Master Refresh Images"
Expected: Progress bar, success count
Action: Click "Master Refresh Availability"
Expected: Progress bar, success count
```
---
## 🐛 TROUBLESHOOTING
### Issue: 500 Internal Server Error
**Cause:** .htaccess not compatible with server
**Fix:** Check Apache error logs, adjust .htaccess
### Issue: White screen / blank page
**Cause:** PHP error
**Fix:** Enable error display:
```php
// Add to top of index.php
ini_set('display_errors', 1);
error_reporting(E_ALL);
```
### Issue: Database connection failed
**Cause:** Wrong credentials in config.php
**Fix:** Verify database credentials:
```php
define('DB_HOST', 'localhost');
define('DB_NAME', 'mytest_last');
define('DB_USER', 'mytest_lastuser');
define('DB_PASS', '7;n-uec1tY32Iedv');
```
### Issue: Vendor autoload not found
**Cause:** vendor/ folder missing
**Fix:** This package includes vendor/ - if missing, re-download from GitHub
### Issue: TinyMCE not loading in admin
**Cause:** assets/vendor/tinymce missing
**Fix:** This package includes tinymce/ - if missing, re-download from GitHub
### Issue: Images not loading
**Cause:** File permissions
**Fix:** Set permissions:
```bash
chmod 755 assets/images
chmod 644 assets/images/*
```
---
## 📞 SUPPORT
### GitHub Repository
```
https://github.com/georgemargiolos/yolo-clone
```
### Branch
```
allHands
```
### Issues
If you encounter problems, check:
1. Apache error logs
2. PHP error logs
3. Browser console (F12)
4. Network tab in browser dev tools
---
## 🎯 NEXT STEPS (FOR NEXT AI SESSION)
### Priority 1: Fix Weekly Availability Click
This is the ONLY feature not working. User specifically reported it.
**Debug steps:**
1. Load yacht page in browser
2. Open console (F12)
3. Click available week
4. Read console logs (lines 791-828 in yacht-detail.php)
5. Identify which step fails
6. Fix the issue
7. Test until price updates correctly
**Likely causes:**
- Element IDs don't match (`booking-price-display`, `selected-week-price`)
- `fp` (flatpickr) not initialized when click happens
- `data.weeks` not in scope
- Function not defined
### Priority 2: Remove Debug Logs
Once weekly availability is fixed, remove all console.log statements from production code.
### Priority 3: Final Testing
Test all 8 fixes on live site to ensure everything works.
---
## ✅ DEPLOYMENT CHECKLIST
Before going live:
- [ ] Downloaded latest from GitHub
- [ ] Extracted all files
- [ ] Uploaded to web server
- [ ] Verified config.php credentials
- [ ] Tested homepage loads
- [ ] Tested API health endpoint
- [ ] Tested admin login
- [ ] Tested yacht detail pages
- [ ] Tested review submission
- [ ] Tested admin features
- [ ] Fixed weekly availability click (if not already done)
- [ ] Removed debug console.log statements
- [ ] Checked Apache error logs
- [ ] Checked PHP error logs
- [ ] Set file permissions correctly
- [ ] Verified all images load
- [ ] Tested on mobile devices
- [ ] Tested all navigation
---
## 🎉 SUCCESS CRITERIA
Deployment is successful when:
✅ Homepage loads without errors
✅ All yacht pages display correctly
✅ API endpoints respond correctly
✅ Admin panel is accessible
✅ Reviews can be submitted
✅ Images display correctly
✅ No JavaScript errors in console
✅ No PHP errors in logs
✅ Weekly availability click works (after fix)
✅ All 8 fixes are working
---
**Package Ready!** Download: https://github.com/georgemargiolos/yolo-clone/archive/refs/heads/allHands.zip
**Upload and Deploy - Everything is configured!** 🚀