Skip to content

icekidtech/whatsapp-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

53 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WhatsApp Bot with Web and Mobile Control Interface

A comprehensive WhatsApp automation bot with a beautiful web interface, built with TypeScript and modern web technologies.

πŸš€ Features

Simple Features

  • βœ… Auto-Reply to Messages
  • βœ… Welcome/Goodbye Messages
  • βœ… Keyword-Based Commands
  • βœ… Message Forwarding
  • βœ… Scheduled Messages
  • βœ… Basic Moderation
  • βœ… Media Sharing
  • βœ… Basic Scam/Spam Detection
  • βœ… Auto-View Status
  • βœ… Download Status to Device

Intermediate Features

  • πŸ”„ User Profile Analysis
  • πŸ”„ Multi-Language Support
  • πŸ”„ Interactive Menus
  • πŸ”„ Group Event Notifications
  • πŸ”„ Message Analytics
  • πŸ”„ Integration with External APIs
  • πŸ”„ Role-Based Access
  • πŸ”„ Automated Group Invites
  • πŸ”„ Save View-Once Media to Device
  • πŸ”„ Turn View-Once Media into WhatsApp Sticker

Complex Features

  • πŸ”„ Advanced Scam/Spam Detection
  • πŸ”„ Database Integration
  • πŸ”„ Webhook-Based Automation
  • πŸ”„ Multi-Group Management
  • πŸ”„ AI-Powered Chatbot
  • πŸ”„ User Behavior Profiling
  • πŸ”„ Automated Moderation Actions
  • πŸ”„ Custom Interactive Flows
  • πŸ”„ Real-Time Dashboard
  • πŸ”„ Cross-Platform Notifications
  • πŸ”„ Scalable Infrastructure

πŸ—οΈ Architecture

whatsapp-bot/
β”œβ”€β”€ bot/                    # Core WhatsApp bot (whatsapp-web.js)
β”œβ”€β”€ backend/               # REST API (Express.js)
β”œβ”€β”€ frontend/              # Web interface (React + Chakra UI)
β”œβ”€β”€ mobile/                # Future mobile app (React Native)
└── docs/                  # Documentation

πŸ› οΈ Technology Stack

  • Bot: whatsapp-web.js, wa-sticker-formatter, sharp
  • Backend: Node.js, Express, mongoose, redis, jsonwebtoken
  • Frontend: React, TypeScript, Chakra UI, recharts, axios
  • Database: MongoDB Atlas
  • Deployment: Heroku/AWS, Netlify/Vercel, Redis Cloud

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • MongoDB
  • Redis (optional)
  • WhatsApp account for testing

Installation

  1. Clone and setup:

    git clone https://github.com/icekidtech/whatsapp-bot.git
    cd whatsapp-bot
    pnpm install
  2. Setup bot:

    cd bot
    pnpm install
    pnpm run build
  3. Setup backend:

    cd ../backend
    pnpm install
    pnpm run build
  4. Setup frontend:

    cd ../frontend
    pnpm install
    pnpm run build
  5. Environment variables: Create .env files in each module with required configurations.

Running the Application

  1. Start all services:

    pnpm run install:all
    pnpm run dev
  2. Or run individually:

    # Terminal 1 - Bot
    cd bot && pnpm run dev
    
    # Terminal 2 - Backend
    cd backend && npm run dev
    
    # Terminal 3 - Frontend
    cd frontend && npm start
  3. Access the web interface:

πŸ“± Web Interface

The web interface provides:

  • Dashboard: Real-time bot status and analytics
  • Feature Management: Toggle features on/off
  • Log Viewer: Monitor bot activity and messages
  • Analytics: Detailed usage statistics
  • Settings: Configure bot parameters

Demo Credentials

  • Username: admin
  • Password: admin

πŸ”§ Configuration

Environment Variables

Bot (.env)

BOT_NAME=WhatsApp Bot
BOT_PREFIX=!
MONGODB_URI=mongodb://localhost:27017/whatsapp-bot
REDIS_URL=redis://localhost:6379
SESSION_PATH=./.wwebjs_auth

Backend (.env)

PORT=3001
MONGODB_URI=mongodb://localhost:27017/whatsapp-bot
REDIS_URL=redis://localhost:6379
JWT_SECRET=your-secret-key

πŸ“Š API Endpoints

Configuration

  • GET /api/config/status - Get bot status
  • POST /api/config/toggle-feature - Toggle feature
  • POST /api/config/restart - Restart bot
  • GET /api/config/features - List features

Logs

  • GET /api/logs - Get logs
  • GET /api/logs/messages - Get message logs
  • DELETE /api/logs - Clear logs

Analytics

  • GET /api/analytics - Get analytics
  • GET /api/analytics/messages - Message analytics
  • GET /api/analytics/features - Feature analytics

πŸ”’ Security & Compliance

WhatsApp Terms Compliance

  • Limited automation frequency
  • Transparent user notifications
  • Secondary phone number recommended
  • Regular session refresh

Privacy Protection

  • Encrypted media storage
  • GDPR/CCPA compliance
  • User consent for data collection
  • Secure API endpoints

πŸš€ Deployment

Development

pnpm run dev

Production

pnpm run build
pnpm start

Docker (Future)

docker-compose up -d

πŸ“ˆ Implementation Phases

Phase 1 (Current) - Simple Features βœ…

  • Basic bot functionality
  • Web interface with toggles
  • Local testing

Phase 2 - Intermediate Features πŸ”„

  • Enhanced features
  • Analytics dashboard
  • Cloud deployment

Phase 3 - Complex Features πŸ”„

  • AI integration
  • Advanced moderation
  • Multi-group management

Phase 4 - Mobile App πŸ“±

  • React Native implementation
  • Push notifications
  • Mobile-specific features

🀝 Contributing

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

πŸ“ License

MIT License - see LICENSE file for details.

⚠️ Disclaimer

This project uses whatsapp-web.js which may violate WhatsApp's Terms of Service. Use at your own risk and ensure compliance with WhatsApp's policies. The developers are not responsible for any account bans or violations.

πŸ“ž Support

For support and questions:

  • Create an issue on GitHub
  • Check the documentation in /docs
  • Review the PRD for detailed specifications

Version: 1.0 Author: Udoh, Idopise Edwin Date: September 2025

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published