============================================================
  WhatsApp Web.js Self-Hosted Server
  EASY SETUP GUIDE - IMPROVED VERSION
============================================================

QUICK START (EASIEST METHOD):
------------------------------------------------------------

Windows (RECOMMENDED):
  1. Double-click "INSTALL-AND-RUN.bat"
  2. Wait for automatic setup (2-5 minutes first time)
  3. QR code will appear - THREE WAYS TO VIEW IT:

     Option A: In the terminal window (scan directly)
     Option B: Open browser: http://localhost:3000/qr
     Option C: In your web app, click "Show QR Code"

  4. Scan QR code with WhatsApp on your phone
  5. Done!

  NEW: Web-based QR code viewer!
  NEW: Better Puppeteer compatibility!
  NEW: Improved error handling!

Linux/Mac:
  1. Double-click "START.sh" or run: ./START.sh
  2. Wait for automatic setup (first time only)
  3. Scan QR code with WhatsApp
  4. Done!

============================================================
  ALTERNATIVE METHOD (Manual Setup):
============================================================

Windows:
  1. Double-click "SETUP.bat" (one time setup)
  2. Wait for installation to complete
  3. Double-click "START.bat" to run server
  4. Scan QR code with WhatsApp

Linux/Mac:
  1. Run: chmod +x *.sh
  2. Run: ./SETUP.sh (one time setup)
  3. Run: ./START.sh to run server
  4. Scan QR code with WhatsApp

============================================================
  REQUIREMENTS:
============================================================

The SETUP scripts will install everything automatically:
  - Node.js (v14 or higher)
  - npm (comes with Node.js)
  - All required packages

If automatic installation fails, manually install Node.js:
  Download from: https://nodejs.org/

============================================================
  WHAT HAPPENS ON FIRST RUN:
============================================================

1. START.bat/START.sh checks if dependencies are installed
2. If not installed, runs SETUP automatically
3. SETUP installs Node.js (if needed) and all packages
4. Server starts automatically
5. QR code appears - scan it with WhatsApp mobile app
6. Start sending messages!

============================================================
  FILES EXPLANATION:
============================================================

Windows Users:
  INSTALL-AND-RUN.bat   - ONE-CLICK setup and run (RECOMMENDED)

Mac/Linux Users:
  SETUP.sh              - One-time setup script
  START.sh              - Run the server
  DOUBLE-CLICK-ME.sh    - Quick launcher

All Files:
  server.js             - Main server code
  package.json          - Dependencies list
  README.txt            - This file

============================================================
  TROUBLESHOOTING:
============================================================

Problem: Window closes immediately on Windows
Solution: FIXED! All .bat files now stay open automatically
          If you downloaded before, get the latest version

Problem: Scripts won't run on Linux/Mac
Solution: Run: chmod +x *.sh

Problem: "Node.js not found" on Windows
Solution: 1. Install from https://nodejs.org/
          2. RESTART your computer
          3. Run the batch file again

Problem: "Node.js not found" on Linux/Mac
Solution: The SETUP script will install it automatically
          Or download from: https://nodejs.org/

Problem: Installation fails on Windows
Solution: 1. Right-click and "Run as Administrator"
          2. Check internet connection
          3. Try: npm cache clean --force
          4. Run installer again

Problem: Port 3000 already in use
Solution: Edit server.js and change PORT = 3000 to 3001

Problem: QR code not appearing in terminal
Solution: Open browser and go to: http://localhost:3000/qr
          The QR code will be displayed in a web page

Problem: WhatsApp won't connect
Solution: Delete .wwebjs_auth folder and try again

Problem: Dependencies not installing
Solution: 1. Check internet connection
          2. Run as Administrator (Windows)
          3. Clear npm cache: npm cache clean --force
          4. Try: npm install --legacy-peer-deps

============================================================
  SERVER INFORMATION:
============================================================

Once running, access:
  - Server URL: http://localhost:3000
  - QR Code Viewer: http://localhost:3000/qr
  - Health Check: http://localhost:3000/health
  - API Status: http://localhost:3000/api/status
  - Get QR (API): http://localhost:3000/api/qr

============================================================
  NEED HELP?
============================================================

1. Read QUICK-START.md for detailed guide
2. Check if Node.js is installed: node --version
3. Check if npm is installed: npm --version
4. Look at server console for error messages

============================================================
  SECURITY NOTES:
============================================================

- Server runs on localhost only (not accessible remotely)
- WhatsApp session stored in .wwebjs_auth folder
- Keep this folder private
- Never share your session data

============================================================

Made with care for TinyToolPro
License: MIT

============================================================
