Desktop WhatsApp Web automation for CSV-driven message campaigns.
The application is packaged for non-technical users. They install it, open it, choose a contacts CSV and message template, scan WhatsApp Web once, and future launches reuse the saved local browser profile automatically.
The project uses Electron plus Electron Builder for distribution.
Why Electron:
- It creates a real desktop app with native installers, shortcuts, uninstall support, app metadata, and a friendly first-run experience.
- It lets the existing Node.js automation engine run unchanged in the main process.
- It supports macOS Intel, macOS Apple Silicon, and Windows from one packaging configuration.
- It is more maintainable for this use case than
pkg,nexe, or Node SEA. Those tools are better for terminal executables and do not provide a professional desktop shell or installer experience by themselves.
The automation logic remains in src/core and src/infrastructure. The desktop layer in src/desktop is only an adapter.
Mutable data is stored in the operating system app-data directory, never beside the executable.
macOS:
~/Library/Application Support/WhatsApp Automation/
Windows:
%APPDATA%/WhatsApp Automation/
The app creates:
profile/for the persistent WhatsApp Web browser profilebrowsers/for Playwright-managed Chromiumlogs/for audit and diagnostic logsscreenshots/for failure screenshotsstate.jsonfor resume checkpointsconfig.jsonfor user-local runtime configuration
The app uses playwright-core and automatically installs Chromium on first launch when missing. The browser download runs silently from the desktop app and writes into the app-data browsers/ folder.
Users never need to install Node.js, npm, Playwright, Chromium, VS Code, or Git.
npm install
npm test
npm run startThe original CLI adapter is still available for development:
npm run start:cli -- --csv data/input/contacts.csv --template data/input/template.txtnpm run build
npm run package
npm run dist
npm run dist:mac
npm run dist:winnpm run buildruns tests and verifies packaging metadata.npm run packagecreates an unpacked app inrelease/for inspection.npm run distcreates an installer for the current OS.npm run dist:maccreates signed-ready macOS DMG builds for Intel and Apple Silicon. Run this on macOS.npm run dist:wincreates a Windows NSIS installer. Run this on Windows.
macOS builds produce a DMG with a standard app-to-Applications layout.
Windows builds produce an NSIS installer that:
- creates a Start Menu entry
- creates a desktop shortcut
- supports uninstall
- preserves app data during uninstall unless the release policy changes
- Update
versioninpackage.json. - Run
npm installif dependencies changed. - Run
npm run build. - On macOS, run
npm run dist:mac. - On Windows, run
npm run dist:win. - Smoke-test first launch, browser download, QR scan, campaign run, restart profile reuse, and uninstall.
- Publish the generated installer files from
release/.
The macOS configuration is signing-ready and uses hardened runtime entitlements. Add Apple Developer credentials in the release environment before public distribution.
Windows signing can be added through Electron Builder certificate environment variables in the release environment.
- Update
playwright-coreinpackage.json. - Run
npm install. - Run
npm test. - Delete the local app-data
browsers/folder on a test machine. - Launch the desktop app and confirm Chromium installs automatically.
- Run a small campaign against test data.
If the app says browser resources are installing, wait for the first-launch download to finish. This can take a few minutes on slower networks.
If WhatsApp asks for a QR code, scan it in the browser window that opens. The app stores the session in the local profile/ folder and reuses it on later launches.
If a campaign stops, open the logs folder from the app and review logs.csv, combined.log, and any screenshots.
If resume is enabled, the app resumes only when the same CSV and template match the saved checkpoint.
build/ Installer resources and signing entitlements
data/ Development-only sample input and temporary files
docs/ Release and product documentation
release/ Generated installers and packaged apps
scripts/ Build verification scripts
src/cli/ Original command-line adapter
src/core/ Campaign orchestration engine
src/desktop/ Electron main process, preload bridge, and desktop UI
src/infrastructure/ Browser, IO, runtime paths, and utility adapters
tests/ Unit and integration tests