Skip to content

TafadzwaD/artistaa-whatsapp-chatbot

Repository files navigation

Nest Logo

A production-ready Node.js WhatsApp chatbot built with NestJS, leveraging the WhatsApp Cloud API for direct integration with WhatsApp, GPT-4o for conversational intelligence and Redis (free tier from Upstash) for context management.

Step-by-Step Guide

For a detailed, step-by-step guide on building this chatbot, check out:

NestJS WhatsApp Chatbot with GPT-4o

WhatsApp AI Chatbot

Text-To-Image generation with Stable Diffusion model

WhatsApp AI Chatbot

Key Features:

  • GPT-4o Integration: Utilises the advanced capabilities of GPT-4o for natural language understanding and generation, ensuring engaging and intelligent conversations.
  • Text-To-Image Generation: Utilises Stability AI's Stable Diffusion model for text-to-image generation.
  • Redis for Context: Stores conversation context in Redis, enabling the chatbot to maintain a cohesive dialogue and provide context-aware responses.
  • NestJS Framework: Built on the robust and scalable NestJS framework, providing a well-structured and maintainable codebase.
  • Production-Ready: Designed with production environments in mind, ensuring security, stability, scalability, and reliability.

Getting Started:

  1. Install Node.js: Download and install the latest version of Node.js from https://nodejs.org/.

  2. Install Dependencies:

    npm install
  3. Configure Environment Variables:

    • Set up environment variables for API keys (OpenAI, WhatsApp API provider), database credentials (Redis), and other necessary configurations.
  4. Run the Chatbot:

    • Development Mode:

      npm run start:dev

      This command starts the chatbot in development mode with file watching for changes.

    • Debug Mode:

      npm run start:debug

      This command starts the chatbot in debug mode with file watching for changes, enabling you to use a debugger.

    • Production Mode:

      npm run start:prod

      This command starts the chatbot in production mode, optimized for performance and stability.

Connecting Your Backend To WhatsApp:

  • No third-party providers needed! You can directly integrate with the WhatsApp Cloud API by following these steps:
    1. Create a Facebook Developer account at https://developers.facebook.com/.
    2. Create a WhatsApp Business account and integrate it with your Facebook Developer account.
    3. Follow the official WhatsApp Cloud API documentation to configure your chatbot. (details to be saved to your environment file)

Testing (Contributions are welcome - running by grace, no tests):

  • Unit Tests:

    npm run test
  • End-to-End (E2E) Tests:

    npm run test:e2e

Support and Contribution:

We welcome contributions and feedback. If you encounter issues or have suggestions, please open an issue on GitHub.

Acknowledgements:

This chatbot is made possible by the incredible work of the following projects:

Join the Conversation:

More features to be added to the chatbot, stay in the loop:

Let's build a smarter and more engaging WhatsApp experience!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published