Demo Builder for Perfex CRM Project Hub

Automated 28-Entity Data Generator, Sandbox Reset Engine, Permission Gate & Live Tracking Suite for Perfex CRM

260.73 ms

The Demo Builder for Perfex CRM Project Hub manages central technical specifications, release roadmaps, database architecture, and subsystem integration guides for the demo_builder module suite.

Engineering Architecture & Tech Stack

Demo Builder is built on top of CodeIgniter 3.x (Perfex CRM core architecture) using a Vue.js 3.4.27 single-page admin interface, SweetAlert2, and SortableJS. It manages 9 relational database tables:

  1. tbldemobuilder_demo_accounts: Staff and contact demo credentials, sort orders, and post-login redirect targets.
  2. tbldemobuilder_data_configs: Entity generation configuration JSON specifications.
  3. tbldemobuilder_backups: Database SQL dumps, file archive sizes, and excluded table manifests.
  4. tbldemobuilder_live_users: Real-time visitor session heartbeats and active module tracking.
  5. tbldemobuilder_webhook_data: Summary statistics ingested from external demo sites.
  6. tbldemobuilder_webhook_logs: Detailed visitor logs synced via cross-site webhooks.
  7. tbldemobuilder_page_views: Page navigation history and per-page duration logs.
  8. tbldemobuilder_webhook_page_views: External page view logs received via webhooks.
  9. tbldemobuilder_daily_stats: Aggregated daily traffic stats per domain and module slug.

Subsystem Execution Workflows

1. Data Generation & Safe Mode Pipeline

  • 28 Entity Generators: Populates complex Perfex CRM datasets with topological dependency resolution.
  • Protected Tables Guard: Prevents accidental truncation of core system tables (tblstaff, tbloptions, tblmodules).
  • SMTP Email Suppression: Intercepts before_email_template_send to block outbound emails during batch generation.

2. Permission Gate & Security Safeguards

  • Global Filter (demobuilder_check_permission): Grants full bypass to SuperAdmin ID 1 while restricting demo accounts.
  • External Module Integration Trait (Demo_restriction_trait): Enables third-party modules to enforce demo write restrictions effortlessly.
  • Granular Operation Blockers: Blocks module upload, uninstall, activation, deactivation, and staff profile edits for restricted users.

3. Memory-Safe Backup & Scheduled Restoration

  • Low-Memory Streaming: Uses 1-2MB HTTP output buffers for downloading multi-gigabyte archives.
  • WP-Cron Automation: Performs automated backups and periodic site restorations at configurable intervals.
  • Telegram Bot Notifier: Transmits real-time alerts for backup creation, scheduled restore cycles, and error events.