Skip to content

Deploy with Heroku

Tuhin Kanti Pal edited this page Dec 18, 2020 · 27 revisions

Deploy Whatsbot with heroku is very simple. It is fully comptible with Heroku

Requirements :

  • Heroku account
  • MongoDB
  • YouTube Data API Key
  • A Terminal (Gitpod \ GCP \ Local)

Deploy :

1. You Have to create a whatsapp session that Whatsbot can start. You can do it by cloning this repo and run genToken.js , You can follow these steps also 👇

  • Tap this button 👇
    Gitpod
  • After that when Terminal appeared run these commands
npm install

node genToken.js
  • You will see a QR code, scan this QR code from your phone.
  • After you successfully do that you will got a JSON output. Copy that it will be needed while you deploy.

2. Now you need a MongoDB, You can create it for free. Follow these steps 👇

  • Open https://cloud.mongodb.com
  • Tap the Sign Up Button
  • Now you can Fill the Form or Sign Up with Google
  • After Successfully Signed Up Type any Organization Name, Project Name and select any preferred language and tap Continue
  • You can see a Pricing Page select Free and tap Create a Cluster
  • Select AWS North Amarica or Europe server only because heroku's server are also located there and Tap Create Cluster
  • Now you will see a cluster is creating
  • Tap Network Access in Sidebar & Tap Add IP Address
  • Now Tap ALLOW ACCESS FROM ANYWHERE and Confirm that
  • Tap Database Access in Sidebar & Tap Add New Database User
  • Now in Password Authentication Method type an Username and a Password and tap Add User
  • Tap Clusters in Sidebar & Tap connect & Select Connect your application
  • Now you will see an url containing mongodb+srv:// Copy that and replace < password > to Your Previously chosen password (If you used any special character in password you have to url encode the password)
  • You need this MongoDB url to deploy Whatsbot

3. Now you need a Youtube Data API Key, Follow these steps 👇

  • Open https://console.cloud.google.com/ & create a project
  • Go to Apis & Services and search Youtube Data Api you will found YouTube Data API v3 select that and enable that
  • Now again go to Apis & Services tap Credentials and tap CREATE CREDENTIALS & select API Key
  • An API Key will be displayed Copy That it will need while you deploy Whatsbot

4. Now Everything is ready you can Deploy it, Follow these steps 👇

Clone this wiki locally