govard.
Discuss a project
Mass UI Generation & Conversion Engine

Page Generator v2.0

Multi-mode UI generation pipeline

Project Init sys_vars.json
Context
SYS>Page Generator shows how multimode UI generation becomes a working production system with clear responsibilities, constraints, and evidence.
Role
USR>Fullstack Architect / AI Tools Builder
Problem
ERR>The core problem is avoiding one-off AI output and keeping the workflow traceable, reviewable and production-oriented.
Goals and tasks
  • ■ Build a compact custom HTML-to-HBS converter that can survive deeply nested markup and special characters.
  • ■ Design eleven isolated generation modes, from element-level conversion to multi-page boards.
  • ■ Keep the visual editor, JSON data, HBS templates, media assets, and Directus storage synchronized.
  • ■ Automate screenshots and quality review across desktop, tablet, and mobile viewports with Puppeteer.
Server-Side Pipeline & Advanced Constructors

A transformation core connected to Directus: raw HTML, HBS templates, JSON models, screenshots, and generated combinations are handled as separate but synchronized layers.

A custom parser converts raw HTML into clean Handlebars templates after Pug proved unreliable for deeply nested markup and special characters.

Directus stores templates, JSON models, content primitives, and generation history so the frontend generator is backed by persistent data.

A background service renders generated combinations and captures screenshots in desktop, tablet, and mobile viewport sizes.

Advanced mapping functions replace classes, spacing, themes, and variants without breaking the underlying grid.

Maps JSON variables to HTML tags and can prepare draft media slots when a content primitive requires imagery.
Generation lifecycle in Page Generator

The system supports several entry points—raw HTML, HBS templates, blocks, or JSON content arrays—and routes each one through the right generation mode.

Step 01

Input injection

Imports raw HTML, selects a base HBS template, or loads intelligent content forms from the local JSON library.
Step 02

SMART build mode

Places blocks on page boards while JSON and HBS can be edited side-by-side in split panels.
Step 03

Matrix multiplication

Crosses every source HBS template with every JSON set to generate many unique block and page combinations.
Step 04

x3 viewport validation

Uses Puppeteer to render every combination in desktop, tablet, and mobile viewport sizes.
Step 05

Export and CMS handoff

Selects the best visual variants and saves artifacts into Directus and the local file system through MCP.

System architecture

Page Generator demonstrates multimode UI generation and conversion workflows through a controlled factory for generating, converting, and validating interface variants.

Page Generator section explains multimode UI generation and conversion workflows through a controlled factory for generating, converting, and validating interface variants.
Matrix Engine x3vp Render Content Primitives

Generator interfaces

From CLI utilities to full Web/GUI dashboards for controlling generation workflows and quality checks.

wpage-gen2.png
SMART page builder
Page Level

SMART page builder

Full-page workspace for assembling pages from blocks with a two-panel smart editor, source inspectors, JSON/HBS access, and media controls.

Technical specification

Key capabilities
x3 viewport structural preview JSON/HBS editing Artifact auto-download Two save modes
Architecture Layer: Smart Composition
wblock-page-gen3.png
HBS + JSON page builder
Data Level

HBS + JSON page builder

Data-driven constructor for assembling pages from atomic elements and blocks with direct HTML injection and CRUD operations.

Technical specification

Key capabilities
Element-based assembly Block CRUD HTML editing x3 viewport screenshotting
Architecture Layer: Data Injection
wblock-html-gen.png
HTML page and block builder
Low Level

HTML page and block builder

Low-level mode for strict control over raw markup, block CRUD, and DOM-tree structure.

Technical specification

Key capabilities
Direct markup editing Deep structure analysis Visual preview
Architecture Layer: DOM Manipulation
wblock-gen2-r2-combi.png
Mass pages from block combinations
Mass Generation

Mass pages from block combinations

Multi-page board mode where HBS blocks are crossed with JSON sets and reviewed in a fast visual grid.

Technical specification

Key capabilities
Multiple page assembly Board-level block management Preview grid Mass screenshotting
Architecture Layer: Multi-Board Engine
wblock-gen2-r4-sokr.png
Block page composer
Composition

Block page composer

Fast block-oriented constructor with move, duplicate, delete, split-view editing, and data_structure auto-substitution.

Technical specification

Key capabilities
Group operations Info fields CSS + JS preview Auto-substitution
Architecture Layer: Quick Actions
wblock-gen2-2.png
Mass blocks: JSON + HBS combinations
Cross-Gen

Mass blocks: JSON + HBS combinations

Cross-generation mode that mixes old/new HBS templates with JSON structures and presents generated blocks for visual selection.

Technical specification

Key capabilities
HBS x JSON crossing Selection grid Block previews
Architecture Layer: Matrix Combination
wblock-gen2-r3-content.png
Mass blocks from JSON/HBS sets
Fast Constructor

Mass blocks from JSON/HBS sets

Fast constructor that multiplies every source HBS template by every JSON set, adds suffixes, analyzes output, and builds a dataset library.

Technical specification

Key capabilities
ALL x ALL matrix Dataset library Separate selection grid
Architecture Layer: Bulk Processor
welem-gen2-r2-combi.png
Element block grid builder
Grid Builder

Element block grid builder

Bootstrap-style block builder for rows, columns, and atomic elements, including imported grid templates.

Technical specification

Key capabilities
Container management Grid templates x3 viewport preview Save with analysis
Architecture Layer: Structural Grid
welem-gen.png
Mass elements: JSON + HBS combinations
Micro-Gen

Mass elements: JSON + HBS combinations

Element-level cross-generation for buttons, cards, inputs, and other atomic components with wrapper previews.

Technical specification

Key capabilities
Element crossing Screenshots with wrappers Element grid
Architecture Layer: Component Level
welem-gen2.png
Mass elements from JSON/HBS sets
Live Preview

Mass elements from JSON/HBS sets

Fast element constructor that multiplies atomic templates by datasets and renders original/modified versions side by side.

Technical specification

Key capabilities
Live preview Auto suffixes Primitive library
Architecture Layer: Atomic Bulk
graphics.png
Content constructor and JSON/graphics library
Data Core

Content constructor and JSON/graphics library

Independent data core for content primitives, JSON editor, gallery assets, and intelligent content distribution forms.

Technical specification

Key capabilities
Content primitives JSON editor Graphics library Data-driven form distribution
Architecture Layer: Content Primitives

Generation mode

01

Conversion layer

Turns mass UI generation into an auditable workflow with concrete inputs, outputs, and validation steps.
02

Output surface

Keeps generated variants inspectable through screenshots, data mappings, and mode-specific interface modules.
03

Conversion layer

Links the backend contract, visual builder, and validation layer so generated UI can be reused safely.
04

Architecture view

Converts raw HTML into reusable HBS and JSON structures that can be rendered repeatedly.
05

Validation pass

Connects Directus-backed content primitives to visual generation modes and page variants.
Project Conclusion

What this proves

Backend contract

Uses Puppeteer-based x3 viewport checks to validate generated pages across real browser sizes.

Backend contract

Maps variations, themes, and content sources into controlled interface-generation batches.

Mass Validation (x3vp)

Separates page-level composition, block-level generation, and element-level conversion paths.

Data Core (Content Primitives)

Turns mass UI generation into an auditable workflow with concrete inputs, outputs, and validation steps.

Use the same approach for production systems that need AI acceleration without losing control.

Need a controlled UI generation factory instead of one-off prompts?

The same architecture can support page variants, import pipelines, Directus-backed content, QA checkpoints, and repeatable interface production.