A bot builder on top of puppeteer's headless web browser mimicing your web.whatsapp.com functionalities.

Overview

Welcome to the BizBook365 WhatsApp bot project

A bot builder on top of puppeteer's headless web browser mimicing your web.whatsapp.com functionalities.

Demo

wabot.bizbook365.com

Video explanation in Bangla

Watch the video

Technology stack

This repository is built on top of Express.js, React.js, MongoDB and venom library, however in the implementation detail, we will find other supporting technologies as well.

Client side

  • React - A JavaScript library for building user interfaces
  • Ant Design Pro - A design system for enterprise-level products. Create an efficient and enjoyable work experience
  • Testing Library - React Testing Library
  • Umi Request - HTTP client for the executing HTTP request from browser to server.

Server side

  • Node.js - evented I/O for the backend
  • Express.js - Fast, unopinionated, minimalist web framework for Node.js
  • MongoDB - The application data platform for NoSQL databases
  • Mongoose - mongoose
  • Swagger - Swagger (Not done yet)
  • Jest - JavaScript testing framework
  • Super Test - Super test API testing framework
  • venom-bot - Venom is the most complete javascript library for Whatsapp

Details frameworks and packages can be found in the package.json files in server and client directory.

Running the application

Visual Studio Code

Prerequisites

  • Node.js : To run npm packages
  • MongoDB : As a database for the application
Steps
  • To run via vscode, we should run the server and client side projects separately, and also make sure mongodb is up and running.
  • Create a .env file inside of the server directory. Add the below entries or change accordingly. You can follow the .env.sample file to see the format.
DB_HOST=localhost
DB_PORT=27017
DB_NAME=appdb
JWT_SECRET=secret
JWT_EXPIRES_IN=100
PORT=5000
IS_MONGODB_CLOUD_URL=false
MONGODB_CLOUD_URL=mongodb+srv:// <USER >: <PASSWORD >@cluster0.abcd.mongodb.net/myFirstDatabase?retryWrites=true
DEFAULT_PAGE_SIZE=10
SENDGRID_API_KEY=123
FRONTEND_URL=http://localhost:8000
[email protected]
[email protected]

Server commands

We assume we run the MongoDB in the docker container.

cd server
npm i
npm run db:up
npm start

Client commands

cd client-pro
nvm use --lts
yarn
yarn start

Data seeding

To seed the database, we need to run the following commands in the server directory.

npm run db:seed
npm run db:migrate

You should be able to see the username and password in the /server/setup/users.json file. You can change these as you see fit.

Permission management ui

I have introduced a permission management ui for the application. Sample image is given below.

Product List Page

Centralized log to Sentry.io

We can also send the logs to sentry.io. To use this feature, we need to add the dsn entry into client/src/env.config.js. Setup snippet is like below in index.js file

Sentry.init({
  dsn: Config.dsn,
  integrations: [new Integrations.BrowserTracing()],
  tracesSampleRate: 1.0,
});

Test server API (NOT DONE YET)

To view the api, open your browser and visit http://localhost:5000/api-docs Ideally we should add all of the API endpoints into the swagger, but for the demo purpose, we only added Products API endpoint.
To test the APIs, we can reuse the postman collection. Open docs/rbac-mern-boilerplate.postman_collection.json into Postman and you should see the endpoints with appropriate payloads.

Scripts

Project Command Task
root npm run build Builds the containers
root npm run start Start the projects and database in docker containers
root docker exec -it appserver /bin/sh then npm run db:seed Executes seed products inside container
server npm i Install server side dependencies
server npm run db:up Start the database in a docker container
server npm run test Execute tests using jest
client npm i Install client side dependencies
client npm run start Start the react app
client npm run build Build the react app in production mode
client npm run test Execute tests using Testing Library

Types of testing

In this repository, we have included both unit testing and integration testing. For now, the code coverage is very low, but we are working on it to make it more than 90% somewhere in the future

Client side

  • We incorporated only unit tests in client side, and mock all the externals dependencies like localStorage and axios.

To run the tests, we can run npm run test command.

Server side

  • Integration testing: We have integrated the Jest as the testing library, and we have added supertest and mongodb-memory-server packages to make the integration testing easier.
  • Unit testing: We have used Jest to test the service layers and mock the external dependencies like MongoDB.

To run the tests, we can run npm run test command.

License

This project is [MIT licensed](https://github.com/facebook/react/blob/main/LICENSE. However other open source projects used in this repository contains their own license.

Contribution

For now, I am not taking any community contritutions in terms of code. But if you have any suggestions or you found any bugs, please feel free to open an issue or a pull request.

On the other hand, if you want to know something, or want to start a discussion about this project, please start a discussion in our GitHub's discussion board.

You might also like...

An Awesome WhatsApp Bot To Jumpstart Your Projects

An Awesome WhatsApp Bot To Jumpstart Your Projects

WhatsApp Bot An Awesome WhatsApp Bot To Jumpstart Your Projects! Table Of Contents Table Of Contents About The Project Docker Deploy to Heroku Built W

Nov 1, 2022

Hisoka-waweb.js: Script WhatsaApp Bot Multi Device Using Lib whatsapp-web.js

Rules read the rules at term-of-service hisoka-waweb.js Script Bot WhatsApp Multi Device dengan menggunakan Library whatsapp-web.js Config Isi semua y

Dec 24, 2022

Queen Amdi is a chat bot for WhatsApp.

Queen Amdi is a chat bot for WhatsApp.

👸 💎 QUEEN AMDI BOT 💎 👸 Whatsapp භාවිතා කිරීම පහසු සහ විනෝදජනක කරයි. Whatsapp සඳහා පළමු සිංහල පරිශීලක බොට් ද වේ. Whatsapp Group | Youtube Channel Q

Dec 28, 2022

whatsapp bot build with nodejs

A whatsapp bot made using adiwajshing/Baileys library Install ⬇️ git clone https://github.com/justpiple/whatsapp-bot/ cd whatsapp-bot npm i For

Nov 23, 2022

stikerinbot adalah pengodean ulang bot whatsapp dari wabot-aq

stikerinbot adalah pengodean ulang bot whatsapp dari wabot-aq

stikerinbot Simple WhatsApp Bot UNTUK PENGGUNA WINDOWS/VPS/RDP Unduh & Instal Git Klik Disini Unduh & Instal NodeJS Klik Disini Unduh & Instal FFmpeg

Oct 31, 2022

xvoid whatsapp bot

xvoid whatsapp bot

xvoid-bot xvoid-bot : a oriented bot for whatsapp How To Install? update && apt upgrade apt install git -y apt install nodejs -y apt install f

Apr 24, 2022

This Is A Simple WhatsApp Bot Mode From *DhaniGans* Repo Hope you guys Will like it Repo Updates in Every Two Days

This Is A Simple WhatsApp Bot Mode From *DhaniGans* Repo Hope you guys Will like it Repo Updates in Every Two Days

ALIEN ALFA BOT Contact Me: Scan QR Code For Session FORK THIS BEFORE PROCEEDING Use This Button To Fork Now THINGS TO CHANGE IN HEROKU 𝘾𝙃𝘼𝙉𝙂𝙀 𒆜

Dec 21, 2022

Bot Whatsapp Multi-Device Using Javascript

Bot Whatsapp Multi-Device Using Javascript

Rzky Multi Device Gunakan dengan risiko Anda sendiri! Dibuat dengan Baileys dan Map() ( sebagai command handler ) Options Options pada command, yang a

Dec 20, 2022

WhatsApp bot multi device kitagawa-md by FERDIZ AFK plis star repo and Fork

WhatsApp bot multi device kitagawa-md by FERDIZ AFK plis star repo and Fork

kitagawa-md Base WhatsApp Bot Multi Device NOTE This Script is for everyone, not for Sale Ngejual SC ORI jahanam brader, neraka menunggumu kitagawa-md

Nov 1, 2022
Owner
Foyzul Karim
Technology Explorer, Software Maker, Entrepreneur, Technology Coach.
Foyzul Karim
Whatsapp Bot with multi-device support Your Personal Assistance on Whatsapp

BotsApp-MD Whatsapp Bot with multi-device support Your Personal Assisstant, on WhatsApp! Deployment Easiest Way Head over to botsapp-md to deploy. Tak

Peter Dorglo 14 Jan 1, 2023
Simple WhatsApp Bot Script using WhatsApp Web Multi-Device API

Shiina Mashiro MD Shiina Multi Device Using NodeJS Framework & Baileys WhatsApp Web API Information WhatsApp Bot using WhatsApp Web API. If you find a

Hafidz Al-Ghifari 3 Feb 4, 2022
World first fully customizeble user bot for Whatsapp 😎 With enjoyable ththings and fun to use Whatsapp ✨️

⚡ The Alpha-X Whatsapp User Bot ?? ~ ᴡᴏʀʟᴅ ꜰɪʀꜱᴛ ꜰᴜʟʟ ᴄᴜꜱᴛᴏᴍɪᴢᴀʙʟᴇ ᴜꜱᴇʀ ʙᴏᴛ ꜰᴏʀ ᴡʜᴀᴛꜱᴀᴘᴘ ~ ?? What is Alpha-X ?? Alpha-X , is a WhatsApp helper bot wr

Official Alpha-X-Team Account 17 Jul 29, 2022
Ini Adalah Tools Bot WhatsApp,Pengodean Ulang Dari Sc Bot Kanna Bot

Node Modules Belum Selesai Unduh File Bot Lengkap Node Modules Click Here Lord Bot FOR DEPLOY HEROKU USER Instal Buildpack heroku/nodejs https://githu

Creator Lord-Botz 8 Jul 1, 2022
whatsapp api to remote your whatsapp device. Support multi device, multi client. Still update to more feature. Please fork, star, donate and share.

Ndalu-wa-client DEPENDENCIES : { "@adiwajshing/baileys": "^4.2.0", "@adiwajshing/keyed-db": "^0.2.4", "axios": "^0.27.2", "body-parser

null 29 Jan 4, 2023
A multipurpose bot, a clan bot, a all in one bot. The one bot u need for ur server originally made as Milrato discord Bot and by Tomato6966.

Public Bot and Support Server! Invite the Public Version of this Bot so you don't need to host it by yourself or join my Discord server to get a custo

Tomato6966 472 Dec 25, 2022
Um sistema de tickets muito simples baseado em mensagens do WhatsApp, que permite multiusuários na mesma conta do WhatsApp.

Press-Ticket Manual de Instalação INSTALL.md Changelog 05/04/2022 Iniciar com o menu lateral fechado 30/03/2022 Atualização da lib wwebjs para a versã

Robson Tenorio 93 Dec 27, 2022
nganu bot, multi device based simple whatsapp-bot with social media downloader

nganu A Simple Multi-Device WhatsApp Bot simple whatsapp-bot using baileys-md to download social media post and many features Install set instagram se

Muhamad Ristiyanto 28 Nov 20, 2022
Vio-MD is multi-device whatsapp bot using library @adiwajshing/baileys and example bot of Violetics API

Vio Multi Device WhatsApp Bot Use at your own risk! Build with Baileys and JavaScript's native Map class ( as a command handler ), using https://viole

Violetics 4 May 31, 2022
a customizable bot that takes top memes of the day from any r/subreddit and posts them on your instagram page

TAEWONSU a customizable bot that takes top memes of the day from r/subreddit and posts them on your instagram page SetUp install any LTS nodejs (lates

Nukala Suraj 8 Oct 23, 2022