STAGE 1 – General Project Structure Objective Create a WhatsApp BOT platform that: Receives automatic notifications from Moni (PSIM). Converts these notifications into personalized and organized messages. Sends them to the end customer via WhatsApp. Has multi-company logic (each company has its own number and configuration). Offers basic automatic responses and customer service routing. Confirms Moni information as the keyword. STAGE 2 – System Architecture 1. Notification Source Source: Moni (via webhook, email, API, or other output method). Function: Trigger an event (e.g., alarm, arming, disarming, arming failure). Action: Sends this event to the BOT via the internal API. The BOT returns a scheduled message. Before integrating, the BOT can simulate receiving these messages manually. 2. BOT Server (Backend) Main Functions: Receive messages from Moni. Interpret and format notifications. Manage sending queues (to avoid WhatsApp blocking). Record logs and histories. Offer API endpoints to partner companies. (You can enter the ADM number or create a queue to be redirected to another number if needed.) Suggested Technologies: Node.js (Express or NestJS) – lightweight and ideal for integrations. Database: PostgreSQL or MongoDB. Messaging: RabbitMQ or Redis (for sending queues, if scaling significantly). Multi-company authentication and control: JWT and API key per company. 3. WhatsApp Integration Options: Official WhatsApp Business API (Meta Cloud API) — more stable and professional. Venom-Bot / Baileys (unofficial libraries) — cheaper, but with risk of blocking. External gateway (such as Z-API, WPPConnect, Twilio, etc.) — reduces initial complexity. BOT Functions: Send personalized messages. Respond to basic customer commands. Redirect messages according to company or service type (according to each company's procedures) 4. Web Panel Users: Managers of each partner company. Functions: View recent conversations. View history of sent notifications. Reply to messages (if authorized). View integration status with Moni. Edit automatic messages and templates. Suggested technologies: Frontend: React + Tailwind + shadcn/ui (for a clean and lightweight interface). Backend: Same server as the BOT. Authentication: login via email/password or internal SSO. Access control: multi-user, multi-company. STEP 3 – BOT Functions Automatic Messages "Hello! This number is only used for automatic notifications from your alarm center." "For support, please contact your monitoring company: (XX) XXXX-XXXX." Simple Client Commands Command Function "last event" Returns to the last event received for the account. "address" Returns to the account's registered address. "account" Returns the account number.