{"id":17712581,"url":"https://github.com/brunosobraldev/whats-sender","last_synced_at":"2026-05-07T06:37:10.045Z","repository":{"id":259088035,"uuid":"875239839","full_name":"BrunoSobralDEV/whats-sender","owner":"BrunoSobralDEV","description":"This project sends WhatsApp messages using whatsapp-web.js","archived":false,"fork":false,"pushed_at":"2024-10-21T13:47:17.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-22T09:11:15.254Z","etag":null,"topics":["api","bot","bull","express","node","prisma","rabbitmq","whatsapp","whatsapp-api","whatsapp-web"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BrunoSobralDEV.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-19T13:09:56.000Z","updated_at":"2024-10-21T17:05:53.000Z","dependencies_parsed_at":"2024-10-22T10:51:19.390Z","dependency_job_id":null,"html_url":"https://github.com/BrunoSobralDEV/whats-sender","commit_stats":null,"previous_names":["brunosobraldev/whats-sender"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunoSobralDEV%2Fwhats-sender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunoSobralDEV%2Fwhats-sender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunoSobralDEV%2Fwhats-sender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunoSobralDEV%2Fwhats-sender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrunoSobralDEV","download_url":"https://codeload.github.com/BrunoSobralDEV/whats-sender/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246450476,"owners_count":20779421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","bot","bull","express","node","prisma","rabbitmq","whatsapp","whatsapp-api","whatsapp-web"],"created_at":"2024-10-25T09:05:37.819Z","updated_at":"2026-05-07T06:37:09.983Z","avatar_url":"https://github.com/BrunoSobralDEV.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WhatsApp Send Message\n\nThis project is a solution for sending messages via WhatsApp, using the whatsapp-web.js library. For queue management, it employs RabbitMQ and Bull. Additionally, Prisma is used for persisting messages in a database.\n\n# :pushpin: Table of Contents\n\u003cimg align=\"right\" src=\"https://github.com/wwebjs/logos/blob/main/4_Full%20Logo%20Lockup_Small/small_banner_blue.png?raw=true\" alt=\"WWebJS logo\" width=\"500\" /\u003e\n\u003ca href=\"https://wwebjs.dev/\"\u003e\u003cimg align=\"right\" src=\"https://wwebjs.dev/images/logo.png\" alt=\"WWebJS logo\" width=\"100\" /\u003e\u003c/a\u003e\n\n- ⚡ [Technologies](#technologies)\n- ⚙️ [Features](#features)\n- ⚠️ [Requirements](#requirements)\n- 🛠️ [Installation](#installation)\n- 🤔 [How It Works](#how-it-works)\n- 📁 [Folder Structure](#folder-structure)\n- 🪪 [License](#license)\n\n## ⚡ Technologies\n\n- **Node.js**: Runtime environment.\n- **Express**: Framework for REST APIs.\n- **TypeScript**: Superset of JavaScript for static typing.\n- **RabbitMQ**: Messaging system.\n- **Bull**: Queue processing library for Node.js.\n- **Prisma**: ORM for database interaction.\n- **whatsapp-web.js**: Integration with WhatsApp.\n\n## ⚙️ Features\n\n- **Message sending via WhatsApp**: Messages are queued and sent through WhatsApp using whatsapp-web.js.\n- **Data persistence**: All successfully sent messages are saved in the database using PostgreSQL.\n- **Queue management**: Utilizes RabbitMQ to manage the message queue and Bull to reprocess messages in case of failure.\n- **Automatic retries**: If sending a message fails, Bull attempts to reprocess the message with exponential backoff.\n\n## ⚠️ Requirements\n\u003e [!NOTE]\n\u003e **Node ``v18+`` is required.**\n\u003e \n\u003e **Docker**\n\u003e \n\u003e **Docker Compose**\n\n## 🛠️ Installation\n1. Download or clone this repo.\n   ```bash\n   git clone https://github.com/BrunoSobralDEV/whats-sender.git\n   ```\n2. Enter to the project directory.\n    ```bash\n   cd whats-sender\n   ```\n3. Execute npm or yarn install to install the dependencies.\n   ```bash\n   npm install\n   ```\n   ou\n   ```bash\n   yarn\n   ```\n4. Copy .env.example to .env and set the environment variables.\n5. Docker, execute:\n   ```bash\n   docker compose up -d\n   ```\n6. Run migration\n   ```bash\n   npx prisma migrate dev --name init\n   ```\n7. Start project\n   ```bash\n   npm run server\n   ```\n8. 📱 Authenticate with WhatsApp\nWhen the project starts, it will display a QR Code in the console to authenticate WhatsApp. Scan this QR Code with your WhatsApp application to connect.\n\n## 🤔 How It Works\n1. **POST /send-message route**: receives the request and adds the message to the queue (Bull);\nExample of request:\n```bash\nPOST /send-message\n{\n  \"phone\": \"+5571987654321\",\n  \"message\": \"HI, this is a test message!\"\n}\n```\n2. The message is processed and published to RabbitMQ;\n3. The RabbitMQ consumer sends the message via WhatsApp;\n4. The result is stored in PostgreSQL and errors are logged in the console.\n\n### 📁 Folder Structure\n```bash\n├── prisma                 # Prisma configuration and database schema\n├── src\n│   ├── controllers        # Route controllers\n│   ├── middlewares        # Middlewares\n│   ├── routes             # Route definitions\n│   ├── services           # Messaging and WhatsApp services\n│   ├── utils              # Utility functions\n├── .env                   # Environment variables configuration file\n└── package.json           # Project settings and dependencies\n```\n## 🪪 License\nThis project is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunosobraldev%2Fwhats-sender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrunosobraldev%2Fwhats-sender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunosobraldev%2Fwhats-sender/lists"}