S400 ENGINE ONLINE
πŸŽƒ CALCULATING HALLOWEEN...
βš”οΈ Salem 400 Quadricentennial (1626–2026) Architecture

Witch City Exchange

An autonomous architectural audit and feature manual for Salem's decoupled spatial heritage platform. Unifying WordPress headless data services, dynamic Leaflet cartography, real-time meteorological shelter intelligence, crowdsourced 2026 memory curation, and street performer micro-economies.

3 CPTs
Custom Post Types
Nodes, Supporters, Buskers
1 Taxonomy
Legacy Era Engine
slug: legacy_era
13 Routes
REST API Endpoints
s400/v1 & witchcity/v1
7 Modules
Subsystem Cores
Spatial, Archive, SaaS
32+ Graves
Memorial Database
Charter, Memorial, Broad
100% Headless
Decoupled Stack
WP Engine β†’ Leaflet PWA
Interactive Codebase Sandboxes

Live Platform Simulator Benches

Three functional micro-demos simulating the specialized engineering engines powering the Salem 400 spatial ecosystem β€” test shelter advisories, virtual grave offerings, and 2026 capsule memory records in real-time.

β›… Weather & Shelter Simulator

Simulating fetchWeather() & meteorological shelter logic

ENGINE: JS CLIENT
🌧️
Salem Rain Advisory Active Rain over Salem. Head indoors β€” museums, coffee shops, and historic houses are waiting.
AUTOMATED MAP FILTER REACTION:
House of Seven Gables (Indoor) Peabody Essex Museum (Indoor) Gulu-Gulu Cafe (Coffee) ⚑ SHELTER FILTER APPLIED
// Client Engine State currentWeather = { wxKey: "rain", temp: "52Β°F", banner: "indoor", shelterTrigger: true }

πŸ•―οΈ Cemetery Memorial Dispenser

Simulating POST /witchcity/v1/graves/token

REST API: WITCHCITY/V1
Giles Corey
Witch Trials Memorial (WTM-002) β€’ Executed Sept 19, 1692 β€’ "More Weight"
πŸ•―οΈ 24 Candles 🌹 18 Flowers πŸͺ™ 31 Coins πŸ“œ 12 Notes
πŸ•―οΈ 🌹 πŸͺ™ πŸ•―οΈ 🌹
// POST /wp-json/witchcity/v1/graves/token { "grave_id": "WTM-002", "token_type": "candle", "status": "200 OK", "tokens_updated": true }

🎭 Capsule & Performer Terminal

Simulating snapshot_2026 & Busker Hub tipping

REST API: S400/V1
1626 / Colonial Anchor

The House of the Seven Gables (1668). Built by Capt. John Turner, featuring hidden chimneys and secret staircases.

2026 Modern Snapshot

Artifact: Museum Tour Pass & Gables Blend Coffee ($24.50 USD). Preserved for the 400th Quadricentennial time vault.

// Resolved GraphQL & REST Schema { "node_id": "h7g_01", "snapshot_2026_product": "Historic Preservation Pass", "snapshot_2026_price": "$24.50", "moderation_status": "published" }
πŸ”
Showing all 28 audited architectural features ⚑ Instant Client Matching
01

Spatial Cartography & Map Engine

Leaflet.js β€’ Geocoding β€’ Layering

πŸ—ΊοΈ Nautical Dark Cartography

CORE

High-performance decoupled Leaflet map engine rendering a stylized colonial harbor basemap with custom bounds, smooth deceleration zooming, and geocoded pins for 400-year historical sites.

Leaflet 1.9.4 Custom Bounds 42.52Β° N
L.map('map', { zoomControl: false, minZoom: 13 })

πŸ“ Specialized Pin Taxonomy

CORE

A 10-tier dynamic pin asset pipeline rendering gold sponsors, historic landmarks, cemetery markers, restrooms, civic halls, and busker stages with retina DPI scaling and custom anchor offsets.

assets/pin-*.png L.icon Retina DPI
L.icon({ iconUrl: 'assets/pin-gold.png', iconSize: [36, 44] })

🎯 "Find Me" GPS Triangulation

Real-time HTML5 Geolocation Watcher with user proximity accuracy bounds, pulsating radar animation, and automatic pan-to-viewport for tourists walking the Salem Heritage Trail.

Geolocation API watchPosition Pulse Radar
navigator.geolocation.getCurrentPosition(success, error, opts)

πŸ“± Slide-Over Drawer Sheet

CORE

Mobile-first responsive drawer component providing fluid thumb-friendly inspection of landmark history, audio narratives, sponsor badges, and directions without leaving the spatial map canvas.

Touch Events Backdrop Blur CSS Clamp
document.getElementById('location-drawer').classList.add('open')
02

Time Capsule & 2026 Snapshot

Crowdsourcing β€’ Moderation β€’ Snapshots

πŸ“¬ Memory Submission Pipeline

CORE

Public REST endpoint accepting citizen memories, geo-coordinates, and stories for Salem's 400th anniversary. Submissions are queued with pending status for editorial review.

POST /s400/v1/submit-memory Pending Queue wp_insert_post
POST /wp-json/s400/v1/submit-memory

πŸ›‘οΈ Spam Honeypot & Media Ingestion

Silent trap field (engine_security_check) rejecting bot vectors alongside automatic WordPress media ingestion (media_handle_upload) for high-resolution 2026 photo uploads.

Honeypot Shield media_handle_upload Strict Mime
media_handle_upload('image', $post_id);

πŸ’° 2026 Economic Snapshot Meta

CORE

Structured meta schema recording landmark offerings in the quadricentennial year (product name, price, description) allowing future generations to inspect 2026 economic life in Salem.

snapshot_2026_* GraphQL Field Time Vault
register_rest_field('h7g_legacy_node', 'snapshot_2026', ...)

πŸ“– "Step into the Past" Narratives

Archival multi-century timeline engine linking 1626 Naumkeag founding, 1692 hysteria, and 1819 maritime trade into first-person historical storytelling cards stored in history_json.

history_json 10 Landmarks 1626–2026 Timeline
json_decode(get_post_meta($post->ID, 'history_json', true))
03

Salem Busker Hub & Performers

Custom Role β€’ QR Tipping β€’ Drag & Drop

🎭 Busker Custom Post Type

CORE

Dedicated CPT (s400_busker) and isolated WordPress user role giving street magicians, living statues, and musicians full profile control while sandboxing administrative backend access.

s400_busker Role: busker menu_order
register_post_type('s400_busker', $args);

πŸ” Brute-Force Rate-Limited Auth

CORE

Self-service REST login endpoint (/s400/v1/busker-login) with transient IP lockout: 5 failed attempts trigger a 15-minute 429 cooldown, issuing 64-character bearer tokens on success.

POST /s400/v1/busker-login Transient Lockout X-Busker-Token
set_transient($transient_key, $fails + 1, 15 * MINUTE_IN_SECONDS)

πŸ“² Standalone Busker Hub PWA

Independent client web app running under /exchange/busker-hub/ enabling performers to edit stage names, update bios, link social channels, and upload photo galleries directly from mobile.

Busker PWA /my-busker-profiles manifest.json
POST /wp-json/s400/v1/my-busker-profiles/(?P<id>\d+)

πŸ’Έ Dynamic Tip QR & Link Matrix

CORE

Direct performer compensation architecture generating scan-ready QR code attachments and deep links for Venmo and CashApp, allowing tourists on the Essex Street Mall to tip instantly.

Venmo / CashApp busker_tip_qr_code_id Micro-Donations
get_post_meta($id, 'busker_venmo_link', true)

πŸ”— Social Share Interceptor

Custom server interceptor for /busker/{slug} generating dynamic OpenGraph & Twitter Card headers from performer character data, resolving smooth previews across social networks.

busker_share_redirect Open Graph 301 Redirect
add_action('init', array($this, 'busker_share_redirect'), 10)
04

Witch City Cemetery & Memorials

Virtual Offerings β€’ Moderation β€’ IP Banning

πŸͺ¦ Historical Grave Index DB

CORE

Curated JSON cemetery registry serving 32+ prominent graves and witch trial victims across Charter Street (1637), the Witch Trials Memorial (1992), and Broad Street Cemetery (1655).

GET /witchcity/v1/graves 3 Cemeteries 32 Verified Biographies
GET /wp-json/witchcity/v1/graves

πŸ•―οΈ Virtual Memorial Offerings

CORE

Interactive digital tribute API permitting visitors to place candles, black roses, copper coins, or heartfelt notes (capped to 150 chars) on tombstones with atomic count increments.

POST /witchcity/v1/graves/token 4 Token Types Atomic Storage
POST /wp-json/witchcity/v1/graves/token

βš–οΈ Tribute Moderation & IP Banning

Full WordPress administrative moderation page (cemetery-tokens) providing one-click deletion of inappropriate notes and instant IP banning with 403 Forbidden enforcement.

Admin Menu (65) IP Blacklist wp_nonce_field
add_menu_page('Cemetery Tokens', 'Cemetery Tokens', 'manage_options', ...)

πŸ•ŠοΈ 1692 Memorial Tribute Benches

High-fidelity digital preservation of all 20 victims of the 1692 hysteria with execution dates, biographical narratives, and their famous final words carved into the stone UI.

WTM-001 to WTM-020 Cutler & Smith 1992 Historical Archive
array('id' => 'WTM-002', 'name' => 'Giles Corey', 'lifespan' => 'Executed 1692')
05

Salem Weather & Shelter Engine

Real-Time Forecast β€’ Dynamic Filtering

🌦️ Real-Time Meteorological Sync

CORE

Non-blocking async weather client polling conditions over Salem Harbor with 8-second abort controllers, categorizing weather into 9 distinct atmospheric behavioral states.

fetchWeather() AbortController 9 Weather Types
fetchWeather() // Non-blocking async atmospheric engine

β˜” Automated Shelter Advisories

CORE

Contextual alert banner automatically triggered by rain, storms, or sub-freezing temperatures directing visitors to indoor destinations (Peabody Essex Museum, House of the Seven Gables).

Dynamic Banner renderRainAdvisory() UX Context
if (['rain', 'storm', 'snow'].includes(wx)) renderRainAdvisory();

πŸ§ͺ URL Testing Overrides & Filter

Built-in QA testing hooks allowing developers to test any weather condition via URL query parameter (?weather=rain), automatically injecting the "Indoor Shelter" map filter pill.

?weather=rain injectShelterFilter() QA Debug Hook
const overrideWx = new URLSearchParams(window.location.search).get('weather');
06

Headless WordPress Core & GraphQL

Engine Core β€’ GraphQL β€’ 301 Protection

βš™οΈ Salem 400 Master Engine

CORE

Central orchestrator class (Salem_400_Engine) autoloading modular dependencies: CPTs, REST endpoints, WPGraphQL types, image compressors, CORS handlers, and analytics tables.

salem-400-engine.php Singleton Pattern v1.0.0
new Salem_400_Engine(); // Core Engine Orchestrator

πŸ”’ Strict Headless 301 Firewall

Anti-scraping frontend protection redirecting all web traffic to the static showcase site while whitelisting REST API routes (/wp-json/), GraphQL, and WP-Admin.

template_redirect 301 Permanent API Whitelist
wp_redirect('https://witchcitywebsites.com/salem400', 301);

πŸ•ΈοΈ WPGraphQL Schema Extensions

CORE

Native GraphQL schema definitions creating Snapshot2026 and resolving linked LegacySupporter sponsor relationships for modern JAMstack frontend architectures.

graphql_register_types LegacyNode Type Schema Binding
register_graphql_object_type('Snapshot2026', $args)

⏳ Legacy Era Chronological Engine

Custom hierarchical taxonomy (legacy_era) categorizing heritage nodes into historic epochs (1626 Settlement, 1692 Trials, Golden Age of Sail, 2026 Quadricentennial).

legacy_era Historical Taxonomy REST & GraphQL
register_taxonomy('legacy_era', array('h7g_legacy_node'), $args);
07

SaaS Dashboard & Infrastructure

SaaS Curation β€’ WebP β€’ Caching β€’ Analytics

πŸ’Ό Showcase Sync SaaS Dashboard

CORE

Custom administrative interface (s400-showcase-dash) allowing curators to pick which businesses appear on the public showcase, instantly publishing to /showcase-sponsors.

S400_Sponsor_Dash GET /showcase-sponsors One-Click Sync
GET /wp-json/s400/v1/showcase-sponsors

πŸ“Š Spatial Engagement Analytics

CORE

Dedicated telemetry subsystem logging landmark clicks and merchant conversions into a custom MySQL table (wp_s400_analytics) with a real-time admin leaderboards.

POST /s400/v1/track dbDelta Table Click Telemetry
POST /wp-json/s400/v1/track // { location_id, title }

⚑ Transient REST Cache Engine

High-speed WordPress transient caching layer (s400_main_map_data) serving cached spatial payloads in sub-50ms with automatic cache purging hooked into save_post_h7g_legacy_node.

HOUR_IN_SECONDS rest_pre_dispatch Sub-50ms TTFB
get_transient('s400_main_map_data')

πŸ–ΌοΈ Automated WebP Compression

Automatic image optimization pipeline hooked into wp_generate_attachment_metadata generating WebP formats with full alpha transparency preservation and automated deletion cleanup.

imagewebp() Alpha Channel delete_attachment
imagewebp($image, $webp_file, 80);
Developer Quick Reference

Full Platform Technical Cheatsheet

Complete dictionary of all discovered REST API endpoints, post types, taxonomies, and core architectural hooks across the Salem 400 Legacy Engine.

Type / Method Endpoint / Identifier Auth / Role Primary Payload / Meta Technical Purpose & Architecture
GET /s400/v1/map-data Public Unified Node & Supporter Array Aggregates all directory pins, geocodes, sponsor tiers, and historical chronologies.
POST /s400/v1/submit-memory Public (Honeypot) title, description, lat, lng, image Crowdsourced 2026 digital time capsule memory submission queue.
GET /s400/v1/buskers Public preview=buskers optional Returns street performers, social handles, gallery attachments, and tip QR codes.
POST /s400/v1/busker-login Rate-Limited username, password Performer authentication with transient IP rate-limiting lockout (5 fails / 15m).
GET /s400/v1/busker-verify Bearer Token X-Busker-Token header Verifies 64-char performer session token validity.
GET /s400/v1/my-busker-profiles Busker Role Header Auth Fetches performer's assigned profile records for mobile editing.
POST /s400/v1/upload-busker-media Busker Role Multipart file Performer media upload sandboxed to current user's author library.
GET /s400/v1/showcase-sponsors Public Synced Sponsor Array Feeds curated merchants from the SaaS sync dashboard to the static showcase.
POST /s400/v1/track Public location_id, location_title, type Logs tourist interaction telemetry to wp_s400_analytics table.
GET /witchcity/v1/graves Public 32+ Grave Bios & Offerings Serves historical cemetery records and live memorial token totals.
POST /witchcity/v1/graves/token IP Checked grave_id, token_type, note Virtual memorial token offering with IP abuse blocking and note moderation.
CPT h7g_legacy_node Admin snapshot_2026_*, history_json Core historical landmark and directory point of interest post type.
CPT h7g_legacy_supporter Admin supporter_tier, supporter_type Commercial sponsor & merchant registry profiles (Gold, Silver, Bronze, Merchant).
CPT s400_busker Busker / Admin busker_venmo_link, tip_qr Performer post type with drag-and-drop sort order (menu_order).
TAX legacy_era Admin Hierarchical Epochs Chronological era taxonomy binding nodes to 1626, 1692, 1799, and 2026.