File size: 1,732 Bytes
4ccc89a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4c34106
 
4ccc89a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# WPPConnect Hugging Face Deployment Status

## Status: SUCCESSFUL

The codebase has been successfully adapted for deployment on Hugging Face Spaces with a dual-service architecture.

### Architecture Overview
1. **Node.js Backend**: Runs WPPConnect (WhatsApp Web automation) and exposes a local REST API on port 3000.
2. **Python Frontend**: A Gradio application running on port 7860 (mandatory HF port) that provides a user-friendly interface.

### Key Features Implemented
- **Gradio Control Panel**:
  - Live status monitoring.
  - Interactive QR code display for easy authentication.
  - Tabs for sending text messages and polls.
  - Log streaming for debugging within the UI.
  - Browser screenshot tab for visual debugging of Puppeteer.
- **Resilient Backend**:
  - Background initialization to satisfy HF health checks.
  - DNS bypass strategy (manual IP resolution for web.whatsapp.com) to handle restricted network environments.
  - Automatic token cleanup to prevent browser lock issues.
- **Containerized Environment**:
  - Multi-runtime Dockerfile (Node.js + Python + Chrome).
  - Optimized Puppeteer flags for stable container operation.

### Access and Usage
- **URL**: `https://huggingface.co/spaces/AUXteam/wppconnect-api`
- **Frontend**: Accessible via the main URL.
- **API Endpoints**: 
  - `/health`: Check system status.
  - `/api-docs`: View available endpoints.
  - `/send-poll`: POST endpoint for automation.

### Notes for Future Deployment
- If the space is stuck on "Preparing", check the run logs. DNS resolution for WhatsApp can sometimes be delayed in new containers.
- Persistence is currently ephemeral; the QR code must be scanned on each new deployment/restart.

---
**Deployment Manager**: Jules