Bulk Messaging System

An Electron Desktop app for marketing campaign & broadcast management, using either whatsapp, gmail or a SMTP server

Project overview

Introduction#

bulk-messaging-system is an Electron desktop app for bulk WhatsApp, Gmail, and SMTP sends. React 19 for the UI, Python for contact parsing, main-process handlers for the integrations.

In short:

  • One UI for WhatsApp, Gmail, and SMTP
  • Bulk send loops with delays and progress
  • Windows, macOS, and Linux builds
  • Contact import and phone cleaning
  • Live progress in the UI
  • Local credential and session storage

Repo: tashifkhan/bulk-messaging-system. Desktop code is electron/. Parsers are python-backend/.

Project structure#

Layout by layer:

On disk:

  • electron/ Electron 43 app. Main process in src/electron/ (main.js, preload.cjs, handlers). React UI in src/ui/ and src/components/. Shared parsers in src/shared/.
  • python-backend/ Flask on port 5000 (app.py, extract_contacts.py, parse_manual_numbers.py, validate_number.py).
  • localhost/ older local helpers. Not the packaged app.

Layers stay separate. Electron ships the desktop shell, React draws the UI, Python parses contacts, IPC ties them together.

Core components#

Desktop application foundation#

Electron hosts the shell. The main process owns lifecycle, windows, and security prefs. React renders the UI and status updates.

Communication infrastructure#

IPC is how the renderer asks the main process to talk to Gmail, SMTP, and WhatsApp without Node APIs in the page.

Utility processing engine#

The Python backend validates phones and pulls contacts out of CSV, TXT, and Excel. Parsing stays in Python so the UI process does not grow a spreadsheet library.

External service integration#

WhatsApp Web, Gmail API, and SMTP each keep their own auth. The UI talks to them through the same IPC-shaped handlers.

Architecture overview#

Layers in play:

Context isolation keeps the renderer away from Node. IPC carries auth and send calls. Each channel keeps its own credentials and pipeline.

Detailed component analysis#

WhatsApp messaging system#

WhatsApp sends go through whatsapp-web.js ^1.34:

Sends are delayed on purpose, errors are logged per recipient, and LocalAuth keeps the QR session until you logout.

Gmail API integration#

Gmail uses OAuth2 so the app never sees the account password (googleapis ^173):

HTML bodies work today. Attachments are not wired up yet. Errors and progress come back over IPC. Tokens stay in the main process store.

SMTP email processing#

SMTP is the generic provider path when you have host, port, and a password (nodemailer ^9):

SSL/TLS, username/password auth, verify-before-send, and per-recipient errors are all in the handler.

Contact processing pipeline#

Python turns files and pasted text into cleaned contact rows:

CSV, TXT, Excel, or paste. Numbers get cleaned, invalid rows drop out, and names come along when the file has them.

Dependency analysis#

Dependencies, grouped by layer:

Frontend and Python deps install separately. That keeps Electron packages smaller and lets you hack parsers without rebuilding the UI.

Performance considerations#

  • Long operations stay async so the UI does not freeze.
  • Fixed delays between sends to avoid provider bans.
  • Temp files and auth artifacts are removed when sessions end.
  • Forms load per channel instead of one giant screen.
  • Structured errors and retries on transient failures.

Troubleshooting guide#

Stuff that usually breaks first:

Authentication problems#

  • WhatsApp QR issues. Check network, restart the app, rescan. Install Chrome or Brave if Puppeteer cannot find a browser.
  • Gmail OAuth failures. Confirm Cloud Console credentials and that Gmail API is enabled.
  • SMTP connection errors. Recheck host, port, TLS, and firewall rules.

Performance issues#

  • Slow contact processing. Use smaller files or simpler formats; watch CPU while pandas runs.
  • Memory usage. Confirm temp files and auth folders are cleaned after sessions.
  • Network latency. Keep the send delay; retries help more than slamming the API.

Platform-specific issues#

  • Windows. Watch antivirus quarantining the binary.
  • macOS permissions. Grant whatever the OS asks for if Chromium/WhatsApp automation is blocked.
  • Linux deps. Install the usual GTK packages if the window will not start.

Conclusion#

Three channels, one desktop shell. The rest of these docs zoom into the IPC handlers, Python parsers, and auth paths that make that possible.