# StarMeet - Namecheap Deployment Checklist

Use this checklist to ensure a successful deployment on Namecheap hosting.

## Pre-Deployment

### Local Preparation
- [ ] Run `composer install --no-dev --optimize-autoloader`
- [ ] Run `php artisan config:cache`
- [ ] Run `php artisan route:cache`
- [ ] Run `php artisan view:cache`
- [ ] Run `composer dump-autoload --optimize`
- [ ] Remove development files (node_modules, .git, tests)
- [ ] Create deployment ZIP file

### Files to Include
- [ ] app/ folder
- [ ] bootstrap/ folder
- [ ] config/ folder
- [ ] database/ folder
- [ ] public/ folder
- [ ] resources/ folder
- [ ] routes/ folder
- [ ] storage/ folder (with .gitignore files)
- [ ] vendor/ folder (or install on server)
- [ ] artisan file
- [ ] composer.json & composer.lock
- [ ] .env.namecheap (rename to .env on server)
- [ ] .htaccess (in public folder)
- [ ] deploy-namecheap.php (helper script)

### Files to Exclude
- [ ] .env (will create new on server)
- [ ] node_modules/
- [ ] .git/
- [ ] tests/
- [ ] phpunit.xml
- [ ] README files (optional)

---

## Namecheap cPanel Setup

### PHP Configuration
- [ ] Login to cPanel
- [ ] Go to **Select PHP Version**
- [ ] Select PHP 8.2 or 8.3
- [ ] Enable required extensions:
  - [ ] BCMath
  - [ ] Ctype
  - [ ] cURL
  - [ ] DOM
  - [ ] Fileinfo
  - [ ] JSON
  - [ ] Mbstring
  - [ ] OpenSSL
  - [ ] PDO
  - [ ] PDO_MySQL
  - [ ] Tokenizer
  - [ ] XML
  - [ ] ZIP

### Database Setup
- [ ] Go to **MySQL Database Wizard**
- [ ] Create database (note the name with prefix)
- [ ] Create database user (note the username with prefix)
- [ ] Set strong password
- [ ] Add user to database with **ALL PRIVILEGES**
- [ ] Save credentials securely

### SSL Certificate
- [ ] Go to **SSL/TLS**
- [ ] Install Let's Encrypt certificate
- [ ] Enable AutoSSL if available

---

## File Upload

### Upload Method
- [ ] FTP (FileZilla) OR
- [ ] cPanel File Manager

### Upload Location
**Option 1 - Primary Domain:**
- [ ] Upload Laravel files to `/home/username/starmeet/`
- [ ] Upload public folder contents to `/home/username/public_html/`

**Option 2 - Subdomain:**
- [ ] Create subdomain in cPanel
- [ ] Upload all files to subdomain folder
- [ ] Point document root to `subdomain/public`

### File Permissions
- [ ] Set storage/ to 755 (or 777 if issues)
- [ ] Set bootstrap/cache/ to 755 (or 777 if issues)
- [ ] Set .env to 644

---

## Configuration

### Environment File (.env)
- [ ] Rename .env.namecheap to .env
- [ ] Update APP_URL with your domain
- [ ] Update DB_DATABASE with your database name
- [ ] Update DB_USERNAME with your database username
- [ ] Update DB_PASSWORD with your database password
- [ ] Generate APP_KEY (via SSH or deploy script)

### public_html/index.php
- [ ] Update path to Laravel directory:
  ```php
  $laravelPath = '/home/username/starmeet';
  ```

### .htaccess
- [ ] Ensure .htaccess exists in public_html/
- [ ] Verify rewrite rules are correct
- [ ] Add HTTPS redirect if SSL installed

---

## Database Migration

### Via SSH (Recommended)
```bash
ssh username@yourdomain.com
cd /home/username/starmeet
php artisan migrate --force
php artisan db:seed --force
```

### Via Deploy Script
- [ ] Upload deploy-namecheap.php to Laravel root
- [ ] Access via browser: `https://yourdomain.com/deploy-namecheap.php`
- [ ] Click "System Check" first
- [ ] Click "Fresh + Seed" to setup database
- [ ] **DELETE deploy-namecheap.php after use!**

---

## Post-Deployment

### Cache Configuration
- [ ] Run `php artisan config:cache`
- [ ] Run `php artisan route:cache`
- [ ] Run `php artisan view:cache`

### Storage Link
- [ ] Run `php artisan storage:link`
- [ ] Or use deploy script

### Testing
- [ ] Visit homepage: `https://yourdomain.com`
- [ ] Test login with default credentials
- [ ] Test admin dashboard
- [ ] Test celebrity browsing
- [ ] Test booking flow

### Security
- [ ] Delete deploy-namecheap.php
- [ ] Verify .env is not accessible via browser
- [ ] Check file permissions
- [ ] Enable HTTPS redirect in .htaccess

---

## Troubleshooting

### If 500 Error
1. Check PHP version (must be 8.2+)
2. Check file permissions
3. Check error logs in cPanel
4. Verify .env file exists

### If Database Error
1. Verify credentials in .env
2. Check database exists
3. Ensure user has privileges
4. Try DB_HOST as `localhost` or `127.0.0.1`

### If "No input file specified"
1. Check .htaccess exists
2. Try alternative rewrite rule:
   ```
   RewriteRule ^(.*)$ index.php?/$1 [L]
   ```

---

## Default Login Credentials

| Role | Email | Password |
|------|-------|----------|
| Admin | admin@starmeet.com | password |
| User | user@example.com | password |

---

## Support Resources

- **Namecheap Support:** https://www.namecheap.com/support/
- **Laravel Docs:** https://laravel.com/docs/11.x
- **StarMeet Docs:** README.md

---

**Deployment Date:** _______________

**Deployed By:** _______________

**Notes:** _______________
