How quincy-dev/monitoring_web works
Project type and purpose
• This is an open-source, single-service Node.js monitoring tool (“WhatsApp Monitoring Tool”) that checks website HTTP statuses on a schedule and pushes notifications to WhatsApp via a Baileys bot.
File structure
• Top level:
• auth/ – stores WhatsApp credentials and session data
• settings.js – user-editable configuration (URLs, interval, bot name)
• connection.js – handles Baileys connection, QR code, session persistence
• function.js – core logic to perform HTTP checks (using Axios) and format messages
• monitor.js – orchestrator: imports settings, initializes connection, schedules jobs
• credit.md, package.json, LICENSE – metadata and dependencies
README
• Confirms tech stack: Node.js ≥16, @whiskeysockets/baileys for WhatsApp, axios for HTTP, qrcode-terminal for QR display.
• Describes configurable monitoring interval and multiple URLs.
• Lists usage steps and folder overview.
Main components
a. Configuration Layer (settings.js)
b. Orchestration Layer (monitor.js) – scheduler (setInterval or cron)
c. HTTP Monitoring Module (function.js with Axios)
d. WhatsApp Connection Module (connection.js using Baileys + qrcode-terminal)
e. Credentials Store (auth/ directory)
f. External Systems:
• Target Websites (HTTP endpoints)
• WhatsApp Service (via Baileys over WebSocket/Signal)
Relationships and interactions
• monitor.js reads settings → schedules periodic “check” events
• At each interval, monitor.js calls function.js to perform HTTP GETs to target URLs
• function.js returns status codes & messages → monitor.js hands these to connection.js
• connection.js sends formatted messages via Baileys to WhatsApp contacts
• auth/ provides persistent session so reconnection skips QR scan
Architectural patterns & principles
• Modular separation: config ↔ scheduling ↔ business logic ↔ transport
• Event-driven: scheduled tasks trigger HTTP checks and message dispatch
• Single-process, in-memory orchestration
Final checklist
• Clearly labeled components
• Brief callout notes for extensibility points