# WhatsApp Broadcaster — Web GUI

A local web page for broadcasting a message to your own WhatsApp
groups/channels. Runs on your machine; connects using your own WhatsApp
account (the same way "Linked Devices" works).

It can only see and post to groups/channels the logged-in account already
belongs to — it cannot access anyone else's account or groups.

## Setup

```bash
npm install
node server.js
```

Then open **http://localhost:3000** in your browser.

## First run (authenticate)

The page will show a QR code image. On your phone:
**WhatsApp → Settings → Linked Devices → Link a Device** → scan it.

Once connected, your session is saved in `./auth_info/`, so restarting the
server later won't ask for the QR code again (unless you log out or delete
that folder).

## Using it

1. After connecting, the page shows every group/channel you belong to on
   the left, each with a checkbox.
2. Type your message in the text box on the right.
3. Check the groups you want to send to (or "Select all").
4. Click **Send**. A delivery log appears below showing each group as it
   succeeds or fails, with a short delay between sends.

## Notes & limits

- **Only your own groups.** Only groups/channels the authenticated account
  already belongs to — it cannot join or discover new ones.
- **Rate limiting.** The server waits ~2 seconds between each send. Keep
  volume reasonable; sending too fast or too widely can get a number
  flagged by WhatsApp.
- **Local only.** This runs a small web server on your own machine at
  `localhost:3000` — nobody else can reach it unless you deliberately
  expose the port.
- **Session security.** The `auth_info` folder holds your login session —
  treat it like a password. Don't share it or commit it to version control.
- **Not the official API.** This uses the WhatsApp Web protocol via
  Baileys, not Meta's official WhatsApp Business Platform. For durable,
  business-scale broadcasting Meta's official API is more appropriate,
  though it works differently (it isn't built around posting to existing
  groups).

## Troubleshooting

- **QR code doesn't appear**: refresh the browser tab; the server logs
  progress in the terminal too.
- **PowerShell blocks `npm install`**: run the same command in Command
  Prompt (`cmd`) instead, or as admin run
  `Set-ExecutionPolicy RemoteSigned -Scope CurrentUser` in PowerShell once.
- **Port 3000 already in use**: change `const PORT = 3000;` near the top of
  `server.js` to another number, e.g. `3001`.
