╔════════════════════════════════════════════════════════════════╗
║                        QUICK ANSWERS                            ║
║            Self-Hosted WhatsApp Server FAQ                      ║
╚════════════════════════════════════════════════════════════════╝


Q1: DO I NEED TO KEEP THE BROWSER TAB OPEN?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✅ YES - Keep the WhatsApp Web browser window open (can minimize)
❌ NO  - The QR code tab auto-closes (you don't need it)

TWO TABS OPEN:
1. WhatsApp Web (web.whatsapp.com) → ⚠️ MUST STAY OPEN
2. QR Code (localhost:3000/qr)     → ✅ Auto-closes after scan

WHY?
The server controls the WhatsApp Web browser to send messages.
If you close it = connection lost = messages won't send.

WHAT TO DO:
After scanning QR → Minimize the WhatsApp Web window (don't close)
                  → Use your app to send messages


Q2: WHY ARE MY PHOTOS SENDING AS FILES?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✅ FIXED! Restart your server to apply the fix.

SOLUTION:
1. Stop server (Ctrl+C in terminal)
2. Start server again: node server.js
3. Reconnect to WhatsApp if needed
4. Try sending image again

NOW:
• Images (jpg, png, gif) → Send as images 🖼️
• Files (pdf, doc, zip)  → Send as files 📄


Q3: HOW DO I START THE SERVER?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

WINDOWS:
  Double-click: INSTALL-AND-RUN.bat

LINUX/MAC:
  Terminal: ./run.sh
  Or:       chmod +x run.sh && ./run.sh

MANUAL:
  Terminal: node server.js


Q4: WHAT HAPPENS AFTER I SCAN THE QR CODE?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

AUTOMATIC STEPS:
1. QR code tab shows "✅ Connected!"
2. Tab auto-closes after 3 seconds
3. WhatsApp Web window stays open
4. Terminal shows: "✅ CONNECTED!"
5. You can now send messages from app.php

WHAT YOU DO:
1. Go to your main app (app.php)
2. Click "Connect to Local Server"
3. Start sending messages!


Q5: CAN I CLOSE THE TERMINAL WINDOW?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

❌ NO - Closing terminal = Server stops = No more messages

WHAT TO DO:
Minimize the terminal window, keep it running in background


Q6: WHAT IF I ACCIDENTALLY CLOSE EVERYTHING?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

NO PROBLEM! Just restart:

1. Open terminal in whatsapp-server folder
2. Run: node server.js
3. Wait for QR code
4. Scan QR code again
5. Connected!


Q7: DO I NEED TO SCAN QR CODE EVERY TIME?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

DEPENDS:

✅ NO  - If you keep server running (same session)
❌ YES - If you restart the server or computer


Q8: CAN I USE MY PHONE WHILE SERVER IS RUNNING?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✅ YES! You can use WhatsApp normally on your phone
✅ All sent messages appear in your chat history
✅ You can send from phone and app simultaneously


Q9: WHERE ARE MY SENT MESSAGES?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✅ In your WhatsApp phone app (under each contact's chat)
✅ In WhatsApp Web window (if you look at it)
✅ They appear as if YOU sent them personally


Q10: HOW DO I KNOW IF SERVER IS RUNNING?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

SIGNS SERVER IS RUNNING:
✅ Terminal window is open with "Server running" message
✅ WhatsApp Web browser window is open
✅ You can access: http://localhost:3000/api/status

CHECK IN BROWSER:
Visit: http://localhost:3000/health
Should see: {"status":"ok",...}


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                         QUICK WORKFLOW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

┌─────────────────────────────────────────────────────────────┐
│ FIRST TIME SETUP                                            │
├─────────────────────────────────────────────────────────────┤
│ 1. Run INSTALL-AND-RUN.bat (Windows)                        │
│    Or run ./run.sh (Linux/Mac)                              │
│ 2. Wait for QR code to appear                               │
│ 3. Scan QR code with WhatsApp on phone                      │
│ 4. See "Connected!" message                                 │
│ 5. QR tab closes automatically                              │
│ 6. Minimize WhatsApp Web window                             │
│ 7. Open app.php in browser                                  │
│ 8. Click "Connect to Local Server"                          │
│ 9. Start sending messages!                                  │
└─────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────┐
│ DAILY USE (After initial setup)                             │
├─────────────────────────────────────────────────────────────┤
│ 1. Make sure server is still running                        │
│    (Check terminal + WhatsApp Web window)                   │
│ 2. If not running: Start server again                       │
│ 3. Open app.php                                             │
│ 4. Send messages!                                           │
└─────────────────────────────────────────────────────────────┘


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                      REMEMBER THESE 3 THINGS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

1️⃣  KEEP WhatsApp Web browser window OPEN (can minimize)

2️⃣  KEEP Terminal window OPEN (server must run)

3️⃣  IMAGES now send as images (after server restart)


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                         TROUBLESHOOTING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

PROBLEM: Can't send messages
→ Check if WhatsApp Web window is open
→ Check if terminal shows "CONNECTED"

PROBLEM: Images sending as files
→ Stop server (Ctrl+C)
→ Start server again
→ Problem fixed!

PROBLEM: QR code not showing
→ Wait 30 seconds
→ Check terminal for any errors
→ Make sure Node.js is installed

PROBLEM: Connection keeps dropping
→ Don't close WhatsApp Web window
→ Keep terminal open
→ Check your internet connection


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                           MORE HELP
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📖 BROWSER-TAB-INFO.txt    → Detailed info about browser tabs
📖 IMAGE-ATTACHMENT-FIX.md → Image sending fix details
📖 QUICK-START.md          → Full setup instructions
📖 TROUBLESHOOTING.md      → Complete troubleshooting guide

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Last Updated: 2025-10-24
