{"id":14987014,"url":"https://github.com/felipeds91/whatsapp-api","last_synced_at":"2025-04-12T22:21:35.253Z","repository":{"id":50288547,"uuid":"305561098","full_name":"felipeDS91/whatsapp-api","owner":"felipeDS91","description":"Rest API to send messages through whatsapp","archived":false,"fork":false,"pushed_at":"2025-03-17T17:03:00.000Z","size":647,"stargazers_count":221,"open_issues_count":1,"forks_count":63,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-04T01:28:51.549Z","etag":null,"topics":["bot","heroku","nodejs-api","qrcode","whatsapp","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felipeDS91.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-10-20T01:52:17.000Z","updated_at":"2025-04-03T11:43:33.000Z","dependencies_parsed_at":"2024-09-19T20:00:51.162Z","dependency_job_id":"3397af10-7598-4414-80bf-9484e26bc7ac","html_url":"https://github.com/felipeDS91/whatsapp-api","commit_stats":{"total_commits":116,"total_committers":2,"mean_commits":58.0,"dds":"0.48275862068965514","last_synced_commit":"d671d6d5b3e1aa3729ceb779fac154f123626507"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipeDS91%2Fwhatsapp-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipeDS91%2Fwhatsapp-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipeDS91%2Fwhatsapp-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipeDS91%2Fwhatsapp-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felipeDS91","download_url":"https://codeload.github.com/felipeDS91/whatsapp-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247107826,"owners_count":20884797,"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":["bot","heroku","nodejs-api","qrcode","whatsapp","whatsapp-web"],"created_at":"2024-09-24T14:13:57.264Z","updated_at":"2025-04-04T02:04:38.427Z","avatar_url":"https://github.com/felipeDS91.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg\n    alt=\"Logo\"\n    src=\"https://res.cloudinary.com/dixtjpk8s/image/upload/v1603667524/API%20WhatsApp/whatsapp-2842640_1280_rfptim.png\" width=\"800px\"\n  /\u003e\n\u003c/h1\u003e\n\n\u003ch3 align=\"center\"\u003e\n  API to send messages through WhatsApp\n\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"GitHub top language\" src=\"https://img.shields.io/github/languages/top/felipeDS91/whatsapp-api\"\u003e\n\n  \u003ca href=\"https://www.linkedin.com/in/felipe-douglas-dev/\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n    \u003cimg alt=\"Made by\" src=\"https://img.shields.io/badge/made%20by-felipe%20douglas-%20\"\u003e\n  \u003c/a\u003e\n\n  \u003cimg alt=\"Repository size\" src=\"https://img.shields.io/github/repo-size/felipeDS91/whatsapp-api\"\u003e\n\n  \u003ca href=\"https://github.com/felipeDS91/whatsapp-api/commits/main\"\u003e\n    \u003cimg alt=\"GitHub last commit\" src=\"https://img.shields.io/github/last-commit/felipeDS91/whatsapp-api\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://github.com/felipeDS91/whatsapp-api/issues\"\u003e\n    \u003cimg alt=\"Repository issues\" src=\"https://img.shields.io/github/issues/felipeDS91/whatsapp-api\"\u003e\n  \u003c/a\u003e\n\n  \u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/felipeDS91/whatsapp-api\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#-about-the-project\"\u003eAbout the project\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#-technologies\"\u003eTechnologies\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#-getting-started\"\u003eGetting started\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#-how-to-contribute\"\u003eHow to contribute\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#-license\"\u003eLicense\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp id=\"insomniaButton\" align=\"center\"\u003e\n  \u003ca href=\"https://insomnia.rest/run/?label=Whatsapp-API\u0026uri=https%3A%2F%2Fgithub.com%2FfelipeDS91%2Fwhatsapp-api%2Fblob%2Fmain%2FInsomnia.json\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://insomnia.rest/images/run.svg\" alt=\"Run in Insomnia\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## 👨🏻‍💻 About the project\n\nThis API allow send messages using whatsapp through an API Rest. The project is separated by two main process, one for the API Rest and other responsible for check if there is new messages to send in the queue.\nRemember: This software is only for study purposes and you have to be careful to not be banned for sending spam using whatsapp. (Send spam through Whatsapp is illegal).\n\n## 🚀 Technologies\n\nTechnologies that I used to develop this api\n\n- [Node.js](https://nodejs.org/en/)\n- [Typescript](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html)\n- [Express](https://expressjs.com/pt-br/)\n- [TypeORM](https://typeorm.io/#/)\n- [JWT-token](https://jwt.io/)\n- [MySQL](https://dev.mysql.com/doc/)\n- [Date-fns](https://date-fns.org/)\n- [Babel](https://babeljs.io/setup)\n- [Whatsapp-web.js](https://pedroslopez.me/whatsapp-web.js/)\n- [Eslint](https://eslint.org/)\n- [Prettier](https://prettier.io/)\n- [EditorConfig](https://editorconfig.org/)\n\n## 💻 Getting started\n\nImport the `Insomnia.json` on Insomnia App or click on [Run in Insomnia](#insomniaButton) button\n\n### Requirements\n\n- [Docker](https://www.docker.com/)\n- [Node v14+](https://nodejs.org/en/download/)\n- [Yarn](https://classic.yarnpkg.com/en/docs/install#windows-stable)\n\n**Clone the project and access the folder**\n\n```bash\n$ git clone https://github.com/felipeDS91/whatsapp-api.git \u0026\u0026 cd whatsapp-api\n```\n\n**Follow the steps below**\n\n```bash\n# Install the dependencies\n$ yarn\n\n# Creates a docker container or use your own mysql installation (changes the password)\n$ docker run --name \"whatsapp\"  -e MYSQL_ROOT_PASSWORD=\"mysql_password\" -p 3306:3306 -d mysql:5.7.30\n\n# Creates a new mysql user (changes the username and password)\n# To connect with mysql database you can use a tool like DBeaver for example\n$ CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';\n\n# Make a copy of '.env.example' to '.env'\n# and set with YOUR environment variables\n$ cp .env.example .env\n\n# Run the migrations and seeds\n$ yarn typeorm migration:run\n\n# Run this command to start the server in development mode\n$ yarn dev:server\n\n# Or you can run separately the API/WhatsApp message client\n$ yarn dev:api\n$ yarn dev:whatsapp\n\n# Default credentials:\n# username: admin\n# password: 123456\n\n# Well done, project is started!\n```\n## 👨🏻‍💻 Endpoints\n\n- /sessions: Sign in to get the access token .\n- /message: Send message to the queue.\n\n##### Admin routes\n- /users: Manage the access to the API.\n- /tokens: Return a qrCode image and also render this QrCode on command line prompt to be read using an whatsapp and record that number to send new messages.\n\n## 😖 Troubleshooting\n- Paas hosting (Heroku): This project uses whatsapp-web.js package that uses Puppeter and it is based on chrome. So if you are getting some log like this \"...loading shared libraries: libnss3.so: cannot open shared object file...\" you will have to install a \"Buildpack\" in your app. To do it, you have to access the app on Heroku and go to the menu \"Settings\" --\u003e \"Buildpacks\" --\u003e \"Add buildpack\", fill out the Buildpack URL with \"jontewks/puppeteer\" and click in \"Save changes\" button. And after your next deploy, this buildpack to use puppeter will be installed with your app.\n\n- Installation of linux dependencies:\n`sudo apt install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget build-essential apt-transport-https libgbm-dev`\u003cbr/\u003e\n`curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -`\u003cbr/\u003e\n`sudo apt install git nodejs yarn`\n\n\n## 🤔 How to contribute\n\n- **Make a fork of this repository**\n\n```bash\n# Fork using GitHub official command line\n# If you don't have the GitHub CLI, use the web site to do that.\n\n$ gh repo fork felipeDS91/whatsapp-api\n```\n\n```bash\n# Clone your fork\n$ git clone your-fork-url \u0026\u0026 cd whatsapp-api\n\n# Create a branch with your feature\n$ git checkout -b my-feature\n\n# Make the commit with your changes\n$ git commit -m 'feat: My new feature'\n\n# Send the code to your remote branch\n$ git push origin my-feature\n```\n\nAfter your pull request is merged, you can delete your branch\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\nMade with 💜\u0026nbsp; by Felipe Douglas 👋 [See my linkedin](https://www.linkedin.com/in/felipe-douglas-dev/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipeds91%2Fwhatsapp-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelipeds91%2Fwhatsapp-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipeds91%2Fwhatsapp-api/lists"}