Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

OpenWA Logo

OpenWA

Open Source WhatsApp API Gateway

FeaturesQuick StartDocsAPIContributing

Version License Node NestJS Docker TypeScript


✨ Why OpenWA?

OpenWA is a free, open-source WhatsApp API Gateway designed for developers who need full control over their messaging infrastructure—without vendor lock-in or hidden paywalls.

Built on a pluggable architecture, OpenWA lets you swap database engines (SQLite/PostgreSQL), storage backends (Local/S3), and cache layers (Memory/Redis) without changing a single line of application code.

🔓 100% Open SourceNo licensing fees, no feature locks, full source code access
🏗️ Pluggable ArchitectureSwap adapters for database, storage, and cache via config
🖥️ Full DashboardModern React UI for session, webhook, and API key management
🔹 Multi-Session ReadyRun multiple WhatsApp sessions concurrently on one instance
🐳 Docker NativeProduction-ready with zero configuration
🔗 n8n IntegrationCommunity nodes for workflow automation

🎯 Features

Core Features

FeatureStatusDescription
REST APIFull WhatsApp API via HTTP endpoints
Multi-SessionManage multiple WhatsApp accounts
WebhooksReal-time events with HMAC signature
Web DashboardVisual management interface
API Key AuthSecure API authentication
Swagger DocsInteractive API documentation

Messaging

FeatureStatusDescription
Text MessagesSend/receive text messages
Media MessagesImages, videos, documents, audio
Message ReactionsReact to messages with emoji
Bulk MessagingSend to multiple recipients
Message StatusTrack delivery and read receipts

Advanced

FeatureStatusDescription
Groups APICreate, manage, and message groups
Channels/NewsletterWhatsApp Channels support
Labels ManagementOrganize chats with labels
Proxy SupportPer-session proxy configuration
Rate LimitingConfigurable request limits
CIDR WhitelistingIP-based access control
Audit LoggingTrack all API operations

Infrastructure

FeatureStatusDescription
SQLiteZero-config embedded database
PostgreSQLProduction-grade database
Redis CacheOptional performance caching
S3/MinIO StorageScalable media storage
DockerOne-command deployment
Health ChecksKubernetes-ready probes
Data MigrationExport/import between backends

🚀 Quick Start

Option A: Docker (Recommended)

# Clone and start git clone https://github.com/rmyndharis/OpenWA.git cd OpenWA docker compose -f docker-compose.dev.yml up -d # Access # Dashboard: http://localhost:2886 # API: http://localhost:2785/api # Swagger: http://localhost:2785/api/docs

Option B: Local Development

# Clone repository git clone https://github.com/rmyndharis/OpenWA.git cd OpenWA # Install dependencies (includes dashboard) npm install # Start API + Dashboard (config is auto-generated on first run) npm run dev # Access # Dashboard: http://localhost:2886 # API: http://localhost:2785/api # Swagger: http://localhost:2785/api/docs

🏭 Production Deployment

For production, use the main docker-compose.yml with optional services:

# Basic production (SQLite, local storage) docker compose up -d # With PostgreSQL database docker compose --profile postgres up -d # Full stack (PostgreSQL, Redis, Dashboard, Traefik) docker compose --profile full up -d
ProfileServices
postgresPostgreSQL database
redisRedis cache
minioS3-compatible storage
with-dashboardWeb dashboard
with-proxyTraefik reverse proxy
fullAll services above

Development vs Production

  • Development (docker-compose.dev.yml): SQLite, local storage, both API & Dashboard included
  • Production (docker-compose.yml): Configurable database, profiles for optional services

🔌 Ports

ServicePortDescription
API2785REST API endpoints
Dashboard2886Web management interface
Swagger2785/api/docsInteractive API docs

📡 API Examples

Create a Session

curl -X POST http://localhost:2785/api/sessions \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_API_KEY" \ -d '{"name": "my-bot"}'

Start Session & Get QR Code

# Start the session curl -X POST http://localhost:2785/api/sessions/{sessionId}/start \ -H "X-API-Key: YOUR_API_KEY" # Get QR code (scan with WhatsApp) curl http://localhost:2785/api/sessions/{sessionId}/qr \ -H "X-API-Key: YOUR_API_KEY"

Send a Message

curl -X POST http://localhost:2785/api/sessions/{sessionId}/messages/send-text \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_API_KEY" \ -d '{ "chatId": "628123456789@c.us", "text": "Hello from OpenWA!" }'

Setup Webhook

curl -X POST http://localhost:2785/api/sessions/{sessionId}/webhooks \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_API_KEY" \ -d '{ "url": "https://your-server.com/webhook", "events": ["message.received", "session.status"], "secret": "your-hmac-secret" }'

🛠 Tech Stack

LayerTechnology
RuntimeNode.js 22 LTS
FrameworkNestJS 11.x
LanguageTypeScript 5.x
WA Enginewhatsapp-web.js
DatabaseSQLite / PostgreSQL
CacheRedis (optional)
StorageLocal / S3 / MinIO
ORMTypeORM
ContainerDocker + Docker Compose

📁 Project Structure

openwa/
├── src/
│   ├── main.ts                 # Application entry point
│   ├── app.module.ts           # Root module
│   ├── config/                 # Configuration
│   ├── common/                 # Shared utilities
│   │   ├── cache/              # Redis caching
│   │   └── storage/            # File storage (Local/S3)
│   ├── core/                   # Core systems
│   │   ├── hooks/              # Plugin hooks
│   │   └── plugins/            # Plugin system
│   ├── engine/                 # WhatsApp engine abstraction
│   └── modules/
│       ├── session/            # Session management
│       ├── message/            # Message handling
│       ├── webhook/            # Webhook management
│       ├── group/              # Groups API
│       ├── contact/            # Contacts API
│       ├── auth/               # API key authentication
│       ├── infra/              # Infrastructure management
│       └── health/             # Health checks
├── dashboard/                  # React web dashboard
├── docs/                      # Documentation
├── docker-compose.yml
├── Dockerfile
└── package.json

📚 Documentation

Comprehensive documentation is available in the docs/ folder:

DocumentDescription
Project OverviewIntroduction and goals
RequirementsFeature specifications
ArchitectureSystem design
SecuritySecurity implementation
DatabaseData models and migrations
API SpecComplete API reference
DevelopmentCoding standards
Migration GuideDatabase & storage migration

🤝 Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please read our Development Guidelines for coding standards and best practices.


📄 License

This project is licensed under the MIT License – free for personal and commercial use.

See LICENSE for details.


OpenWA – Free, Open Source WhatsApp API Gateway

📖 Documentation · 🔌 API Docs · 🐛 Report Bug · 💡 Request Feature


Made with ❤️ by Yudhi Armyndharis and the OpenWA Community

关于 About

Free, Open Source, Self-Hosted WhatsApp API Gateway
apigatewaywhatsapp

语言 Languages

TypeScript86.3%
CSS11.8%
Shell0.8%
Python0.5%
Dockerfile0.3%
JavaScript0.2%
HTML0.0%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
93
Total Commits
峰值: 53次/周
Less
More

核心贡献者 Contributors