$ show felipeDS91/whatsapp-api
This is a WhatsApp messaging API built with Node.js, TypeScript, and Express. The system provides REST endpoints for user authentication, WhatsApp number registration (via QR code), message sending (with scheduling and media support), and user/token management. Architecture follows a layered approach: API controllers delegate to service classes, which use TypeORM repositories for data access. A separate worker process continuously polls the database for pending messages and sends them via WhatsApp using a sophisticated custom client manager that handles multiple WhatsApp sessions, QR code authentication, session persistence, and connection recovery. The WhatsApp client implementation (src/whatsapp/client/index.ts) demonstrates significant skill in managing the complexities of the whatsapp-web.js library, including proper resource cleanup, timeout handling, and state management across multiple concurrent connections.
The LLM identified 1 files worth highlighting for reuse:
This WhatsApp client manager handles multiple concurrent WhatsApp web sessions with robust lifecycle management. It implements QR code-based authentication, session persistence, automatic reconnection, and proper resource cleanup. The component demonstrates non-obvious skill in managing the complex state transitions of whatsapp-web.js connections, handling timeouts for QR scanning, and isolating WhatsApp-specific logic from the rest of the application. While it has some coupling to the token storage mechanism and configuration, the core connection management logic is highly reusable and could be extracted with minimal changes to interface with different storage mechanisms or configuration systems.