Demo Builder Module: Managing Software Previews

Last updated on May 17, 2026 20:49

The Demo Builder is an advanced, enterprise-grade module designed for software companies and agencies that sell complex SaaS products or web applications (like Perfex CRM or specialized WordPress themes).

Instead of giving all potential customers access to the same shared "demo" website—which often results in messy, conflicting data—the Demo Builder automatically provisions a fresh, isolated instance (both Database and Filesystem) for every single visitor.

How It Works

When a visitor requests a demo on your PolyCMS site:

  • Request Handling: The Demo Builder catches the request.

  • Database Cloning: It duplicates a "master" database template into a new, unique database specific to that user's session.

  • Filesystem Isolation: It creates a symlinked or isolated storage directory so user uploads do not mix.

  • Redirection: The user is seamlessly redirected to their private instance (e.g., demo123.<a href="//polycms.org" target="_blank" rel="nofollow">polycms.org</a>).

  • Garbage Collection: After a set period (e.g., 2 hours), a cron job automatically destroys the isolated database and filesystem, freeing up server resources.

Key Features

  • GeoLite2 Database Integration: Built-in IP Geolocation support to track where demo requests are originating from.

  • Analytics Dashboard: A comprehensive UI inside the PolyCMS Admin Panel showing demo conversion rates, geographic distribution, and resource usage.

  • Configurable Lifespans: Set exactly how long a demo instance should live before the cleanup script deletes it.

  • Security Restrictions: Lock down specific administrative settings within the demo instances to prevent malicious configurations.

Configuration Guide

To set up the Demo Builder:

  • Enable the Module: Go to Settings > Modules and activate the Demo Builder.

  • Server Requirements: Ensure your server allows dynamic database creation via the MySQL/PostgreSQL user assigned to PolyCMS.

  • Master Template: Define the connection details to your "Master" database. This is the clean slate that will be cloned for every user.

  • Cron Job Setup: You must configure the Laravel Scheduler (Cron) on your server. Without it, expired demo instances will never be deleted, eventually crashing your server due to storage exhaustion!

For detailed API documentation on how to trigger a demo build programmatically, please refer to the Developer API section within the module's internal dashboard.