Ops Center & Deployments
Relevant source files
The following files were used as context for generating this wiki page:
The Ops Center serves as the central control plane for FusionOps, providing a unified interface for managing infrastructure, monitoring system health, and orchestrating the deployment of landing pages and backend workers. It integrates multiple cloud services, primarily Cloudflare and Neon, to ensure a seamless operational workflow from template selection to live production environments.
The deployment system is built on a modular architecture that supports multiple targets, with Cloudflare Pages serving as the primary host for frontend assets and Cloudflare Workers handling API logic and tracking. The system manages complex flows including environment variable injection, asset hashing, and DNS record synchronization to maintain high availability and performance across the PPC ecosystem.
Operations Control Plane
The Ops Center is organized into functional tabs that allow operators to manage different facets of the system. It acts as a wrapper for infrastructure management and deployment orchestration.
Key Functional Areas
- Deployments: Monitoring and triggering the rollout of landing pages and workers.
- Infrastructure: Managing connections to D1 databases and Neon Postgres instances.
- Diagnostics: Health checks for API endpoints and proxy services.
Sources: src/components/OpsCenter.jsx, INFRASTRUCTURE_SETUP.md
Infrastructure Architecture
The system relies on a distributed architecture involving multiple Cloudflare Workers and databases.
The diagram above illustrates the relationship between the Ops Center interface and the underlying cloud infrastructure services.
Sources: INFRASTRUCTURE_SETUP.md, scripts/deploy-all.js
Deployment System Architecture
The deployment logic is categorized into automated scripts for full-system rollouts and specific deployers for landing page instances.
Automated Full Deployment
The deploy-all.js script handles the build and push process for the entire monorepo. It performs pre-flight checks to ensure the environment is correctly configured before proceeding with the build and deployment of workers and the web application.
| Step | Component | Description |
|---|---|---|
| 1 | Pre-flight | Validates Node.js version, Wrangler auth, and dependencies. |
| 2 | Build Web | Executes npm run build within the apps/lander directory. |
| 3 | Deploy Workers | Iterates through api-worker, cf-proxy, pixel-worker, and worker to run wrangler deploy. |
| 4 | Deploy Pages | Deploys the built web application to the fusionops-web project on Cloudflare Pages. |
Sources: scripts/deploy-all.js:142-152
Cloudflare Pages Direct Upload Flow
For individual landing pages, the system uses a high-performance direct upload flow that minimizes bandwidth by only uploading modified assets.
The sequence above shows the MD5-based synchronization process used to deploy assets to Cloudflare Pages.
Sources: utils/deployers/cf-pages.js:127-233
Deployment History and Monitoring
The system maintains a persistent record of all deployment activities to facilitate auditing and rollbacks.
Data Model: Deploy History
The deployment history is stored in a table (likely in Neon Postgres) with the following schema:
| Field | Type | Description |
|---|---|---|
id | TEXT (PK) | Unique identifier for the deployment. |
site_id | TEXT (FK) | Reference to the site being deployed. |
target | TEXT | Deployment target (e.g., 'cloudflare', 'vercel'). |
url | TEXT | The live URL of the deployment. |
status | TEXT | current state: 'pending', 'success', 'failed'. |
created_at | TIMESTAMPTZ | Timestamp of the deployment event. |
Sources: INFRASTRUCTURE_SETUP.md:144-154, src/components/DeployHistory.jsx
Deployment Dashboard Features
The DeployDashboard.jsx component provides real-time visibility into the status of different system components.
- Active Projects: Displays a list of projects currently managed by the factory.
- Build Status: Shows whether project components are currently building, pending, or live.
- Quick Actions: Allows for immediate redeployment or configuration changes.
Sources: src/components/OpsCenter/deploy/DeployDashboard.jsx
Infrastructure Management
The Ops Center provides tools for setting up and verifying the underlying database infrastructure required for operations.
D1 Database Initialization
Cloudflare D1 databases are used for specialized tasks:
fusionops-main: Stores sites and application settings.fusionops-pixel: Handles high-volume tracking event logs.fusionops-callback: Manages lead callback webhooks.
Sources: INFRASTRUCTURE_SETUP.md:46-52
Verification Workflow
The system includes verification logic to ensure all databases and workers are responding correctly after a setup or update.
async function verifySetup(dbIds) {
// 1. List databases to confirm existence
const databases = execJson('wrangler d1 list --json');
// 2. Test queries against each database
exec(`wrangler d1 execute ${dbIds.main.name} --command="SELECT COUNT(*) FROM sites"`);
exec(`wrangler d1 execute ${dbIds.pixel.name} --command="SELECT COUNT(*) FROM pixel_events"`);
log.success('Verification complete!');
}
Sources: scripts/setup-infrastructure.js:338-360
Conclusion
The Ops Center & Deployments module constitutes the operational heart of FusionOps. By leveraging Cloudflare's edge computing and Pages' asset delivery system, it provides a robust, scalable environment for rapid PPC landing page deployment. The combination of automated build scripts, a sophisticated direct-upload mechanism, and integrated infrastructure management allows for high-velocity marketing operations with minimal manual overhead.