An unofficial WhatsApp Gateway system for learning, internal testing, or company communication simulation. This project is built with a client-server architecture using Node.js + Baileys for the backend and React + Vite + TailAdmin for the frontend. It now includes integrations with Gemini, OpenAI, and Groq for AI chat functionalities.
IMPORTANT: This is an unofficial WhatsApp Gateway for learning purposes only. Do not use it for spam or any activities that violate WhatsApp's Terms of Service.
- Session management with QR code login
- Send text messages to any WhatsApp number
- Send media files (images, PDFs, documents)
- Receive and store incoming messages
- Auto-reply functionality
- Activity logging
- Configuration management
- AI Chat integration with:
- Google Gemini
- OpenAI (GPT models)
- Groq (LLaMA, Mixtral, etc.)
- QR code scanning interface
- Dashboard with connection status
- Send message form
- Media upload with preview
- Inbox viewer
- Settings management
- Log viewer with filtering
- Chat interfaces for Gemini, OpenAI, and Groq
- Node.js 16+ and pnpm
- Modern web browser
- WhatsApp account on your phone
- API keys for Gemini, OpenAI, and Groq (optional, for AI features)
git clone https://github.com/paijoe29/wa-gemini
cd wa-geminicd backend
pnpm installcd ..
pnpm install- Copy the example environment file and configure it:
cp backend/.env.example backend/.env- Edit the
backend/.envfile and add your API keys:
PORT=3002
NODE_ENV=development
# General API Key for the application (if needed for other purposes)
API_KEY=your-api-key-here
# Gemini API Key
GEMINI_API_KEY=your-gemini-api-key-here
# OpenAI API Key
OPENAI_API_KEY=your-openai-api-key-here
# Groq API Key
GROQ_API_KEY=your-groq-api-key-here
IMPORTANT: AI API keys (Gemini, OpenAI, Groq) can ONLY be set through the
backend/.envfile for security reasons. They cannot be set through the frontend interface.
- Copy the example config file and configure it if needed:
cp backend/config.json.example backend/config.jsoncd backend
pnpm devcd ..
pnpm dev- Open your browser and navigate to
http://localhost:5173 - Go to WhatsApp Gateway > QR Login
- Scan the QR code with your WhatsApp app (Menu > Linked Devices > Link a Device)
- Once connected, you'll be redirected to the dashboard. You can then access the AI chat pages from the sidebar.
- Navigate to "Send Message" page
- Enter the recipient's phone number with country code (e.g., 62812345678 for Indonesia)
- Type your message
- Click "Send Message"
- Navigate to "Send Media" page
- Enter the recipient's phone number
- Upload a file (image, PDF, or document)
- Add an optional caption
- Click "Send Media"
- Navigate to "Inbox" page
- View incoming messages
- Set auto-refresh interval if needed
- Navigate to "Gemini AI", "OpenAI Chat", or "Groq Chat" from the sidebar.
- Ensure the respective API key is set in
backend/.env. - Start chatting with the AI.
- Navigate to "Settings" page
- Configure auto-reply settings
- Set message limits
- Manage blocklist
- Navigate to "Logs" page
- Filter logs by type, number, or date
- Enable auto-refresh for real-time updates
whatsapp-gateway/
├── backend/ # Backend server
│ ├── controllers/ # API controllers (gemini, openai, groq, whatsapp, etc.)
│ ├── middleware/ # Express middleware
│ ├── routes/ # API routes
│ ├── services/ # Business logic (gemini, openai, groq, whatsapp, etc.)
│ ├── utils/ # Utility functions
│ ├── sessions/ # WhatsApp session storage
│ ├── logs/ # Activity logs
│ ├── config.js # Configuration
│ └── server.js # Main server file
│
├── src/ # Frontend React app
│ ├── components/ # React components
│ │ └── whatsapp/ # WhatsApp-specific components
│ ├── pages/ # Page components
│ │ └── WhatsApp/ # WhatsApp pages (GeminiAI, OpenAIChat, GroqChat, etc.)
│ ├── services/ # API services (gemini, openai, groq, whatsapp, etc.)
│ └── App.tsx # Main app component
│
└── README.md # Project documentation
└── AI_RULES.md # AI development guidelines
- This is for educational purposes only
- Do not expose this to the public internet
- Use only for internal testing or learning
- Respect WhatsApp's Terms of Service
- Do not use for spam or bulk messaging
- Protect your API keys: Store them securely in
backend/.envand never commit this file.
When uploading to GitHub, make sure to:
-
Never commit sensitive files:
.envfiles with API keysconfig.jsonwith actual API keys- WhatsApp session data in
backend/sessions/ - Log files in
backend/logs/
-
Use the provided templates:
- Use
.env.exampleinstead of.env - Use
config.json.exampleinstead ofconfig.json
- Use
-
Check the
.gitignorefile:- Make sure it includes all sensitive files and directories
- Verify that no sensitive files are being tracked by git
-
Before committing, run:
git status
to ensure no sensitive files are about to be committed
- If QR code doesn't appear, restart the backend server
- If messages fail to send, check the connection status
- If the session disconnects, try logging in again
- Check logs for detailed error messages
- Ensure API keys are correctly set in
backend/.envfor AI features. - Kalau ada bug fix sendiri ya hehe
This project is licensed under the MIT License - see the LICENSE file for details.
This project is not affiliated with, authorized by, maintained by, sponsored by, or endorsed by WhatsApp, Google, OpenAI, Groq, or any of their affiliates or subsidiaries. This is an independent project for educational purposes only.
Vibe Coding