# Vue + PHP Integration Test

## Testing Setup

This setup simulates how your Vue app will integrate with Joomla/PHP projects.

### Files Created:
- **`index.php`** - Form to input user data (simulates Joomla user system)
- **`app.php`** - Main page with Vue app embedded between header/footer
- **`dist/`** - Built Vue app assets

### How to Test:

1. **Build Vue App:**
   ```bash
   npm run build
   ```

2. **Start PHP Server:**
   ```bash
   php -S localhost:8000
   ```

3. **Open Browser:**
   - Press Cmd+Shift+P (macOS) or Ctrl+Shift+P (Windows/Linux)
   - Type: Simple Browser: Show
   - Go to: `http://localhost:8000/index.php`
   - Fill in test data:
     - User ID: `test123`
     - Email: `test@example.com`
     - Phone: `+40712345678`
   - Click "Launch Vue App"

3. **Verify Integration:**
   - Should see PHP header/footer around Vue app
   - Vue app should display user data from PHP
   - Check browser console for "PHP passed user data to Vue"

### Integration Flow:
```
index.php (form) → POST data → app.php → window.joomlaUserData → Vue app
Vue app → /api/proxy.php → DigitalOcean API → Real tender data
```

### CORS Solution:
- **Problem:** Browser blocks direct API calls due to CORS policy
- **Solution:** PHP proxy (`/api/proxy.php`) makes server-side API calls
- **Benefit:** Eliminates CORS issues while getting real data

### Benefits:
- ✅ Tests real PHP-to-Vue data passing
- ✅ Shows Vue app embedded in larger project
- ✅ Validates mobile responsiveness in PHP context
- ✅ Simulates production Joomla integration

Enjoy testing! 🚀

firebase deploy --only functions

firebase functions:log --only testSendNotifications  

curl -X POST https://us-central1-sky-group-d9dd0.cloudfunctions.net/testSendNotifications
