Key Architectural Outcomes & Engineering Deliverables
Core verification criteria and mission milestones established by this document
- Eliminates all PHP runtime vulnerabilities, SQL databases, and plugin bloat by converting dynamic sites to pure static edge assets.
- Achieves global sub-50ms Time to First Byte (TTFB) leveraging Cloudflare Anycast CDN edge caching.
- Preserves 1:1 design fidelity and interactive micro-animations using lightweight vanilla JavaScript and CSS Grid/Flexbox.
- Provides a deterministic, zero-error CI/CD pipeline using Cloudflare Workers static assets architecture.
1. Purpose & Scope
Legacy Content Management Systems (WordPress, Drupal, Joomla) are responsible for the vast majority of web application security vulnerabilities, maintenance overhead, and latency bottlenecks.
This Standard Operating Procedure (SOP) defines the protocol for reverse-engineering dynamic CMS templates and compiling them into zero-dependency, ultra-fast Astro static sites deployed to the Cloudflare Global Edge Network.
2. The Cloudflare Workers Assets Configuration
When deploying pure static assets via Cloudflare Workers Git integration, adhere strictly to the modern assets-only configuration:
// wrangler.jsonc
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "joeyajones-site",
"compatibility_date": "2024-10-01",
"build": {
"command": "npm run build"
},
"assets": {
"directory": "./dist"
}
}
CRITICAL RULE: Do NOT specify
"binding": "ASSETS"unless the project includes a custom JavaScript worker script entrypoint (main: "./src/worker.ts"). Declaring a binding in an assets-only worker triggers a fatal Cloudflare CI build error.
3. Legacy CSS De-Floating & Flex Centering
Legacy themes commonly employ floated columns that collapse when placed into responsive flex layouts. Apply the following modern flex centering standard:
/* Replace legacy float: left; width: 50%; */
.media-grid,
.portfolio-items {
display: flex !important;
flex-wrap: wrap !important;
justify-content: center !important;
gap: 24px !important;
float: none !important;
width: 100% !important;
}
.media-grid .media-cell {
float: none !important;
margin: 0 !important;
flex: 0 1 calc(50% - 16px) !important;
max-width: 400px !important;
width: 100% !important;
box-sizing: border-box !important;
}
4. Keyless Vector Maps Migration
Eliminate heavy Google Maps JavaScript API SDKs (~400kB overhead, tracking cookies, and credit card API keys) with a lightweight, color-matched Leaflet vector tile map:
<link rel="stylesheet" href="/leaflet/leaflet.css" />
<div id="map-canvas" style="width: 100%; height: 360px; border-radius: 8px;"></div>
<script src="/leaflet/leaflet.js"></script>
<script>
const map = L.map('map-canvas', { zoomControl: false, scrollWheelZoom: false })
.setView([18.2013, -67.1452], 12);
L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png', {
attribution: '© OpenStreetMap © CartoDB',
maxZoom: 18
}).addTo(map);
L.marker([18.2013, -67.1452]).addTo(map);
</script>
5. Deployment Verification Checklist
- Project contains
.nvmrcspecifying Node 20 LTS (20) in repository root. - Local
npm run buildcompiles 100% static routes intodist/with exit code 0. - Run
npx wrangler deploy --dry-runto verify Cloudflare assets manifest without errors. - Zero external remote hotlinks to legacy WordPress directories (
/wp-content/or/wp-includes/). - High-performance WebP/PNG images have explicit
widthandheighttags to eliminate Cumulative Layout Shift (CLS).