Skip to content

A Node.js application that allows users to download media from YouTube, Instagram, Twitter, and TikTok using WhatsApp and create stickers from images.

Notifications You must be signed in to change notification settings

WhatsAppWizard/bot

Repository files navigation

WhatsAppWizard

A Node.js application that allows users to download media from YouTube, Instagram, Twitter, and TikTok using WhatsApp and create stickers from images.

Build Docker Image Version License

WhatsAppWizard empowers users to easily download online content and create personalized stickers directly through WhatsApp, enhancing their messaging experience.

Table of Contents

  1. Key Features ✨
  2. Demo 📸
  3. Technology Stack 🛠️
  4. Getting Started 🚀
  5. Usage Examples 💡
  6. Project Structure 📁
  7. Contributing 🤝
  8. Deployment 🚀
  9. API Documentation 📚
  10. Roadmap 🗺️
  11. Support & Contact 💬
  12. License 📄
  13. Acknowledgments 🙏

Key Features ✨

  • Media Downloading: Download videos and images from YouTube, Instagram, TikTok, Twitter, and Facebook directly via WhatsApp by simply sending a link.
  • Sticker Creation: Create personalized WhatsApp stickers from any image sent to the bot.
  • Telegram Bot: System administrators can monitor the server, manage broadcast messages, and handle unread chats.
  • Rate Limiting: Implemented to prevent abuse and ensure fair usage of the bot.
  • Analytics: Track usage and errors using PostHog to improve the bot's functionality and user experience.
  • Agent Service: Integrated with an agent to provide automated responses and support to users

Demo 📸

Post.-.Feed.mp4

Technology Stack 🛠️

  • Languages:
    • TypeScript
  • Frameworks:
    • Node.js
    • Express.js
    • whatsapp-web.js
    • Telegraf
  • Tools:
    • npm
    • Docker
    • Prisma
    • PM2
    • Eslint
  • Services:
    • PostgreSQL
    • Redis
    • Telegram Bot API
    • SnapSaver API
    • nayan-video-downloader API
    • PostHog

Getting Started 🚀

Prerequisites

  • Node.js (version 18 or higher)
  • Docker and Docker Compose (optional, for containerized deployment)
  • A Telegram bot token and chat ID (required for admin notifications)
  • Redis instance, A postgres instance (required)

Installation

  1. Clone the repository:

    git clone https://github.com/gitnasr/WhatsAppWizard.git
    cd WhatsAppWizard
  2. Install dependencies:

    npm install

Configuration

  1. Create a .env file based on the .env.example template and fill in the required values:

    cp .env.example .env
  2. Edit the .env file with your configuration:

    POSTGRES_DB=whatsappwizard
    POSTGRES_USER=postgres
    POSTGRES_PASSWORD=whatsapp123
    
    BOT_TOKEN=your_telegram_bot_token_here
    CHAT_ID=your_telegram_chat_id_here
    
    POSTHOG_API_KEY=
    POSTHOG_HOST=
    
    PGADMIN_EMAIL=admin@whatsappwizard.local
    PGADMIN_PASSWORD=admin123
    

Running the Project

Development

  1. Start the development server:

    npm run dev
  2. Alternatively, using Docker Compose for development:

    docker-compose -f docker-compose.dev.yml up --build

Production

  1. Build the application:

    npm run build

    or with docker

      docker-compose up --build
  2. if not using docker: Start built application

    npm start

Using Docker:

  1. Build and run the Docker container:
    docker-compose up --build

Usage Examples 💡

  1. Send a YouTube link to the WhatsApp bot:

    https://www.youtube.com/watch?v=dQw4w9WgXcQ
    
  2. Send an image to the bot to create a sticker.

  3. Send any message to the agent

Tell me a joke

Project Structure 📁

WhatsAppWizard/
├── .github/workflows/         # GitHub Actions workflows
├── .dockerignore               # Files to ignore in Docker builds
├── .env.example                # Example environment variables
├── ecosystem.config.js        # PM2 configuration file
├── nodemon.json                # Nodemon configuration file
├── package.json                # Project dependencies and scripts
├── prisma/                     # Prisma database schema
│   └── schema.prisma           # Prisma schema definition
├── src/                        # Source code
│   ├── errors/                 # Custom error classes
│   ├── routes/                 # Express routes
│   ├── services/               # Application services
│   ├── types/                  # TypeScript types
│   └── index.ts                # Main application entry point
├── tsconfig.json               # TypeScript configuration file
├── docker-compose.yml          # Docker Compose configuration

Contributing 🤝

We welcome contributions to WhatsAppWizard! Please follow these guidelines:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them with descriptive messages.
  4. Submit a pull request.

Deployment 🚀

Deploying to Production:

  1. Build the Docker image
docker build -t whatsapp-wizard .
  1. Push the Image Push the built image to a container registry like Docker Hub:
docker tag whatsapp-wizard:latest YOUR_DOCKERHUB_USERNAME/whatsapp-wizard:latest
docker push YOUR_DOCKERHUB_USERNAME/whatsapp-wizard:latest
  1. Deploy to your server Pull and start the Docker image on Your Server:
    docker pull YOUR_DOCKERHUB_USERNAME/whatsapp-wizard:latest
    docker run -d -p 3000:3000 <IMAGE_ID>
  1. Using docker compose
  • Configure environment variables: Pass environment variables required to configure the server.
  • Set up reverse proxy (Nginx): Configure Nginx as a reverse proxy to route traffic to containers.

Roadmap 🗺️

  • Implement additional media download sources.
  • Enhance sticker customization options.
  • Improve error handling and logging.
  • Add support for multiple languages.

Support & Contact 💬

For support, questions, or feature requests, please:

License 📄

This project is licensed under the ISC License - see the LICENSE file for details.

Acknowledgments 🙏

  • SnapSaver for the free API.
  • nayan-video-downloader for providing free API

About

A Node.js application that allows users to download media from YouTube, Instagram, Twitter, and TikTok using WhatsApp and create stickers from images.

Topics

Resources

Stars

Watchers

Forks