rmyndharis / OpenWA

rmyndharis / OpenWA

OpenWA Open Source WhatsApp API Gateway

OpenWA 开源 WhatsApp API 网关

Features • Quick Start • Docs • API • Contributing 功能 • 快速入门 • 文档 • API • 贡献指南

✨ Why OpenWA? ✨ 为什么选择 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. OpenWA 是一款免费、开源的 WhatsApp API 网关,专为需要完全掌控消息基础设施的开发者而设计,无需担心供应商锁定或隐藏的付费墙。OpenWA 基于插件化架构构建,允许你在不更改任何一行应用代码的情况下,自由切换数据库引擎(SQLite/PostgreSQL)、存储后端(本地/S3)和缓存层(内存/Redis)。

🔓 100% Open Source: No licensing fees, no feature locks, full source code access 🔓 100% 开源:无许可费用,无功能锁定,完全访问源代码

🏗️ Pluggable Architecture: Swap adapters for database, storage, and cache via config 🏗️ 插件化架构:通过配置即可切换数据库、存储和缓存适配器

🖥️ Full Dashboard: Modern React UI for session, webhook, and API key management 🖥️ 完整仪表盘:现代化的 React UI,用于管理会话、Webhook 和 API 密钥

🔹 Multi-Session Ready: Run multiple WhatsApp sessions concurrently on one instance 🔹 多会话支持:在单个实例上同时运行多个 WhatsApp 会话

🐳 Docker Native: Production-ready with zero configuration 🐳 Docker 原生:零配置即可投入生产环境

🔗 n8n Integration: Community nodes for workflow automation 🔗 n8n 集成:提供用于工作流自动化的社区节点


🎯 Features (功能列表)

Core FeaturesStatusDescription
核心功能状态描述
REST APIFull WhatsApp API via HTTP endpoints (通过 HTTP 端点提供完整的 WhatsApp API)
Multi-SessionManage multiple WhatsApp accounts (管理多个 WhatsApp 账号)
WebhooksReal-time events with HMAC signature (带 HMAC 签名的实时事件)
Web DashboardVisual management interface (可视化管理界面)
API Key AuthSecure API authentication (安全的 API 认证)
Swagger DocsInteractive API documentation (交互式 API 文档)
MessagingStatusDescription
消息功能状态描述
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 (追踪送达和已读回执)
AdvancedStatusDescription
高级功能状态描述
Groups APICreate, manage, and message groups (创建、管理及群组消息)
Channels/NewsletterWhatsApp Channels support (支持 WhatsApp 频道)
Labels ManagementOrganize chats with labels (使用标签整理聊天)
Proxy SupportPer-session proxy configuration (支持按会话配置代理)
Rate LimitingConfigurable request limits (可配置的请求限制)
CIDR WhitelistingIP-based access control (基于 IP 的访问控制)
Audit LoggingTrack all API operations (追踪所有 API 操作)
InfrastructureStatusDescription
基础设施状态描述
SQLiteZero-config embedded database (零配置嵌入式数据库)
PostgreSQLProduction-grade database (生产级数据库)
Redis CacheOptional performance caching (可选的性能缓存)
S3/MinIO StorageScalable media storage (可扩展的媒体存储)
DockerOne-command deployment (一键部署)
Health ChecksKubernetes-ready probes (支持 Kubernetes 健康检查)
Data MigrationExport/import between backends (后端间数据导出/导入)

🚀 Quick Start (快速入门)

Option A: Docker (Recommended) 选项 A:Docker(推荐)

# 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 选项 B:本地开发

# 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

🏭 Production Deployment (生产环境部署)

For production, use the main docker-compose.yml with optional services: 对于生产环境,请使用主 docker-compose.yml 并根据需要选择服务:

# 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

🛠 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

📚 Documentation (文档)

Comprehensive documentation is available in the docs/ folder: 详细文档可在 docs/ 文件夹中查看:

  • Project Overview: Introduction and goals (项目概述:介绍与目标)
  • Requirements: Feature specifications (需求:功能规格)
  • Architecture: System design (架构:系统设计)
  • Security: Security implementation (安全:安全实现)
  • Database: Data models and migrations (数据库:数据模型与迁移)
  • API Spec: Complete API documentation (API 规范:完整 API 文档)