Skip to main content

Ops automation system for web property monitoring, GA4 analytics, and scheduled reporting with Telegram notifications

Project description

DEX Bot Automation

Ops automation system for managing and monitoring web properties. Runs 15+ scheduled tasks via macOS launchd, covering site health checks, GA4 analytics, competitor tracking, SSL/domain monitoring, and daily/weekly reporting — all with Telegram push notifications.

Features

  • Site Health Monitoring — every 5 min checks with alert silencing and recovery notifications
  • GA4 Analytics — daily/weekly/monthly reports, real-time anomaly alerts (spike/drop detection)
  • Lighthouse Audits — automated performance scoring with CSV history tracking
  • Competitor Watch — sitemap diffing against competitors with false-positive filtering
  • SSL & Domain Expiry — early warnings before certificates or domains expire
  • Broken Link Scanner — weekly crawl with concurrent link validation
  • Cross-Site Funnel — traffic funnel analysis across properties
  • Daily/Weekly Reports — structured ops reports with strict submission standards
  • Morning Briefing — consolidated daily summary pushed before standup
  • Dashboard — hourly auto-generated HTML dashboard integrating 5 data sources
  • Log Rotation — 7-day cleanup + 1MB truncation

Monitored Sites

Site URL
小黃書 xhslink.com
51漫畫 51acgs.com

Tech Stack

  • Runtime: Node.js (ESM)
  • Analytics: Google Analytics Data API (@google-analytics/data)
  • Google APIs: googleapis (Gmail, Sheets, etc.)
  • Notifications: Telegram Bot API
  • Scheduling: macOS launchd (15 plist configs in launchd/)
  • AI Agents: Claude Code subagents + external AI dispatch (Gemini, Codex, OpenCode)

Project Structure

├── config.mjs              # Shared config: sites, thresholds, GA4 settings
├── automation-cron.sh       # Unified cron entry point for all tasks
├── ai-dispatch.sh           # Multi-AI agent dispatcher
├── team-dispatch.sh         # Multi-agent parallel workflow
├── dispatch-task.sh         # Background task launcher
│
├── site-health.mjs          # Site uptime monitoring
├── ga4-alert.mjs            # Real-time GA4 anomaly detection
├── ga4-daily-report.mjs     # Daily GA4 analytics report
├── ga4-weekly-insight.mjs   # Weekly GA4 insights
├── ga4-monthly-summary.mjs  # Monthly GA4 summary
├── ga4-utils.mjs            # GA4 API helpers
│
├── lighthouse-audit.mjs     # Lighthouse performance audits
├── competitor-watch.mjs     # Competitor sitemap monitoring
├── ssl-domain-check.mjs     # SSL cert & domain expiry checks
├── broken-links.mjs         # Broken link scanner
├── cross-site-funnel.mjs    # Cross-site traffic funnel
├── smoke-test.mjs           # Quick smoke tests
│
├── morning-briefing.mjs     # Daily morning briefing
├── daily-work-report.mjs    # Daily work report generator
├── weekend-review.mjs       # Weekend review digest
├── weekly-ops-report.mjs    # Weekly ops summary
├── generate-dashboard.mjs   # HTML dashboard generator
│
├── tg-utils.mjs             # Telegram push utilities
├── email-utils.mjs          # Email utilities
├── notify-telegram.mjs      # Telegram notification hook
├── log-rotate.mjs           # Log rotation
├── backup-data.sh           # Data backup script
│
├── launchd/                 # macOS launchd plist configs (15 schedules)
└── .claude/agents/          # Claude Code subagent definitions

Setup

# Install dependencies
npm install

# Required: GA4 service account key (not committed)
# Place your key file as: openclaw-ga4-488308-b099b607405b.json

# Required: Telegram bot config
# Create hooks-config.json with your bot token and chat ID

# Install launchd schedules
cp launchd/*.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.dex.*.plist

Usage

Run any task manually via the unified entry point:

./automation-cron.sh <task-name>

Available tasks: health, ga4-alert, ga4-daily, ga4-weekly, ga4-monthly, lighthouse, competitor, ssl, morning-briefing, daily-report, ops-report, weekend-review, funnel, broken-links, dashboard, log-rotate, backup, smoke-test

AI Agent Dispatch

# Single agent
./ai-dispatch.sh <agent> "<prompt>" [timeout]

# All agents in parallel
./ai-dispatch.sh all "<prompt>"

# Smart routing
./ai-dispatch.sh best "<prompt>"

# Multi-agent code review
./team-dispatch.sh multi-review

Schedule Overview

Schedule Frequency Task
Site Health Weekdays every 5 min Uptime monitoring
GA4 Alert Weekdays hourly (after 09:00) Anomaly detection
GA4 Daily Weekdays 09:00 Daily analytics
GA4 Weekly Monday 09:30 Weekly insights
Morning Briefing Weekdays 09:50 Daily summary
Daily Report Weekdays 17:50 Work report
Lighthouse Weekdays 06:00 Performance audit
Competitor Weekdays 07:00 Competitor tracking
SSL Check Weekdays 08:00 SSL/domain expiry
Dashboard Hourly HTML dashboard
Log Rotate Daily 03:00 Log cleanup
Broken Links Wednesday 04:00 Link validation
Funnel Monday 10:00 Traffic funnel
Ops Report Friday 18:00 Weekly ops summary
Weekend Review Monday 08:00 Weekend digest

All weekday-only tasks are silenced on weekends (both at plist level and in-script skipWeekend()).

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dex_bot_claude-2.0.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dex_bot_claude-2.0.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file dex_bot_claude-2.0.0.tar.gz.

File metadata

  • Download URL: dex_bot_claude-2.0.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for dex_bot_claude-2.0.0.tar.gz
Algorithm Hash digest
SHA256 52bd9f2c6be0c2b9e114a6e70eafd4f225f08fffb181e0999a980e332ea2ed55
MD5 05aefa3ef1ff816bcbd164810026b0f7
BLAKE2b-256 6dad564edc126c35595c6b02f1dae3d1d06b6ea8602d361b7c1ff06650b4db92

See more details on using hashes here.

File details

Details for the file dex_bot_claude-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: dex_bot_claude-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for dex_bot_claude-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e10afcce8a2053e84a4d3a0855df9ea65c5261ee7e29bf8d2e783f270f78e6e5
MD5 2e55e90f9d91753a20e52f91f3529546
BLAKE2b-256 9659e44101cf957d976afad91d27ee0769ca67ce3ae097c08e27cbdb9ba2a68b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page