Giter Club home page Giter Club logo

whatsapp-chatbot's Introduction

๐Ÿฑ Winnie - WhatsApp AI Chatbot

๐Ÿค– AI Powered Chatbot using GPT-3

Chat on WhatsApp with an AI

Demo

image

๐Ÿ”จ Tech Stack

Server: Node.JS, Express

Database: Redis

API: WhatsApp Business Cloud API, OpenAI GPT-3

Deployment: Docker, Nginx, Linode

Misc: ElasticSearch, Kibana

โš™๏ธ Project Structure

whatsapp-connector: Whatsapp connector is a microservice which connects a bot to WhatsApp API, handles messaging and incoming requests from WhatsApp

chatbot: Chatbot is a microservice which will connect to OpenAI GPT-3 model to answer user queries based on prompt

๐Ÿฅฃ Meta Configuration

Multiple prerequisites and configuration needs to be done on the Meta Developers, please follow my below guide for details: https://blog.amitwani.dev/create-a-chatbot-using-whatsapp-cloud-api

๐Ÿƒโ€โ™‚๏ธ Running Application

  • Run the application using docker-compose

    • Update Environment Variables

      • Fill necessary values in docker-compose-local.yml file inside docker folder for below environment variables:
        • VERIFY_TOKEN - Verify Token for WhatsApp Webhook
        • OPENAI_API_KEY - OpenAI API Key
        • WHATSAPP_TOKEN - WhatsApp Business Permanent/Temporary Authentication Token with whatsapp_business_messaging permission
        • WHATSAPP_SEND_MESSAGE_API - WhatsApp Cloud API Send Message API End Point with Phone Number ID
        • CHATBOT_URL - Chatbot microservice api url
    • Run command docker-compose -f docker-compose.local.yml up -d inside docker folder

  • Run using npm

    • Install Dependencies

    Navigate to whatsapp-connector and chatbot to install their dependecies.

      npm install

    or

      yarn add
    • Update Environment Variables

      • Create .env file by copying .env.sample in both microservices
      • Fill necessary values for below environment variables:
        • VERIFY_TOKEN - Verify Token for WhatsApp Webhook
        • OPENAI_API_KEY - OpenAI API Key
        • WHATSAPP_TOKEN - WhatsApp Business Permanent/Temporary Authentication Token with whatsapp_business_messaging permission
        • WHATSAPP_SEND_MESSAGE_API - WhatsApp Cloud API Send Message API End Point with Phone Number ID
        • CHATBOT_URL - Chatbot microservice api url
    • Run the Server

        npm run start

๐Ÿ›ณ๏ธ Deployment

Deploy with Docker easily using the Dockerfile provided in the respective services folder or the docker-compose.yml in the docker folder

๐Ÿ‘ท CI/CD

GitHub Actions is used to create a CI/CD workflow specified in the workflow.yml.

Workflow

  • On every commit on main branch
  • Build Docker Images of both microservices
  • Push Docker Images of both microservices to docker repository
  • Update docker-compose.yml by replacing environment varibles from GitHub secrets
  • Copying docker-compose.yml and nginx.conf to the server
  • Running docker-compose command to recreate containers
  • Deployment is done

Acknowledgements

Feedback

If you have any feedback, please reach out to me at [email protected]

whatsapp-chatbot's People

Contributors

mtwn105 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

whatsapp-chatbot's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.