Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WhatsApp Registration Chatbot

A WhatsApp chatbot that handles user registration through a conversational interface.

Features

  • Step-by-step registration process
  • Data validation for email and dates
  • MongoDB integration for data storage
  • WhatsApp Cloud API integration
  • Error handling and user feedback

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB
  • WhatsApp Business API account
  • Facebook Developer account

Setup

  1. Clone the repository:
git clone <repository-url>
cd whatsapp-chatbot
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory with the following variables:
PORT=3000
MONGODB_URI=mongodb://localhost:27017/whatsapp-chatbot
WHATSAPP_TOKEN=your_whatsapp_token_here
WHATSAPP_PHONE_NUMBER_ID=your_phone_number_id_here
VERIFY_TOKEN=your_verify_token_here
  1. Set up WhatsApp Business API:

    • Create a Facebook Developer account
    • Set up a WhatsApp Business API account
    • Get your WhatsApp token and phone number ID
    • Configure your webhook URL
  2. Start the server:

npm start

For development with auto-reload:

npm run dev

Usage

  1. Users can start the registration process by sending any message to your WhatsApp business number
  2. The bot will guide them through the registration process step by step
  3. Each step includes validation and error handling
  4. The registration data is stored in MongoDB

Registration Flow

  1. Welcome message and start confirmation
  2. Company name
  3. Business license number
  4. Registration date
  5. Primary contact name
  6. Email address
  7. Username
  8. Password
  9. Password confirmation
  10. Phone number
  11. Website (optional)
  12. Street address
  13. City
  14. Completion message

Security Considerations

  • In production, implement proper password hashing
  • Add rate limiting
  • Implement session management
  • Add input sanitization
  • Use HTTPS for webhook endpoints
  • Implement proper error handling and logging

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a new Pull Request

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages