concept24 / nova-ai-pagebuilder
AI Page Builder tool for Laravel Nova — conversational agent that builds landing pages (Page + blockText bands) with product selection, generated copy and images.
v0.1.1
2026-08-26 06:30 UTC
Requires
- php: >=8.1
- laravel/framework: ^12.0
- laravel/nova: ^4.12|^5.0
README
AI Page Builder tool for Concept24 CMS — conversational multi-model agent that turns a natural-language brief into a complete draft landing page (Page + blockText bands, product selection, multi-locale copy, generated images), built on Laravel Nova.
Requirements
- PHP >= 8.1
- Laravel 12
- Laravel Nova 4.12+ / 5.x
- OpenRouter API key
- A C24CMS application — the package writes into the host app's
Page/BlockTextmodels and product catalog (not portable to other Laravel apps, same tradeoff asnova-ai-report)
Installation
composer require concept24/nova-ai-pagebuilder
The service provider is auto-discovered. Migrations run automatically via loadMigrationsFrom. Publish config manually:
php artisan vendor:publish --tag=nova-ai-pagebuilder-config
Register the tool in NovaServiceProvider::tools() and add a MenuSection pointing to /nova-ai-pagebuilder.
Configuration
config/nova-ai-pagebuilder.php:
| Key | Env var | Default |
|---|---|---|
openrouter.api_key | OPENROUTER_API_KEY | — |
models.coordinator | NOVA_AI_PB_MODEL_COORDINATOR | openai/gpt-5.4 |
models.sql | NOVA_AI_PB_MODEL_SQL | anthropic/claude-sonnet-5 |
models.copy | NOVA_AI_PB_MODEL_COPY | openai/gpt-5.4 |
models.image | NOVA_AI_PB_MODEL_IMAGE | google/gemini-3.1-flash-image |
model_options.* | — | per-role allowlists for the UI dropdowns |
max_tool_iterations | — | 30 |
page_defaults | — | draft (is_public=0, is_active=1), layout_default |
locales | — | null → config('app.allowed_languages') |
layouts.exclude | — | non-content bands excluded from the AI palette |
images.max_per_page | — | 12 |
rate_limit | NOVA_AI_PB_RATE_LIMIT | 30,1 |
Minimum .env:
OPENROUTER_API_KEY=sk-or-...
Features
- Conversational flow with consent gates: short interview → live layout catalog → proposed band structure (requires explicit user approval) → generation → data entry → links.
- Per-agent model dropdowns in the chat UI (Coordinator / DB queries / Copy / Images), config defaults + per-conversation override stored on the conversation (
modelsjson), validated server-side against per-role allowlists. - Product selection agent (
select_products): read-only SQL sub-agent (sanitizedSELECT/WITHonly, LIMIT cap, sensitive-column masking, session execution timeout). Supports curated pinned SKU selections (incl. best/worst-sellers viasite_orders_items) and dynamic filter specs (categories/brands/in_promo/last_added) consumed by the existingBlocktextRepositorypipeline. - Copy generation in all active locales (native per-locale writing, strict JSON, SEO meta limits enforced).
- Image generation via OpenRouter multimodal chat (
modalities: ['image','text']), persisted per-conversation to tmp storage and attached to bands via Spatie MediaLibrary by the applier. - Deterministic data entry (
LandingPageApplier): validates the full plan before any write (layouts on disk, min/max items, image refs, SKU existence), then creates the draft Page + bands + translations + media in one pass and flushescatalog/mediacache tags. Draft pages are previewable on the frontend by logged-in admins (Page::scopePublic). - Composition canvas (drag & drop): split view next to the chat — a layout palette (thumbnails + badges), band cards with per-band instructions, image toggle, variant select and product drop-zones; product chips from chat research are draggable onto bands; the agent's numbered structure proposals render as an importable card (layout choice stays with the user); "Generate page from composition" builds exactly the user's canvas (1:1 validation in the applier, pinned-product specs auto-filled from the canvas).
- Multi-conversation chat UI (SSE streaming, tool-call cards with image thumbnails, final page-result card with frontend + Nova links), per-phase cost logging (
coordinator/sql/copy/image).
Architecture
PageBuilderOrchestrator— coordinator tool loop (OpenAI-style function calling over OpenRouter, SSE).- Tools:
get_layout_catalog,select_products(modes: research/pinned/dynamic),generate_copy,generate_image(img2img with real product photos viaproduct_skus),create_landing_page,get_page_links,get_composition,propose_structure. LayoutCatalog— bands discovered fromresources/views/layouts_text/intersected with curated metadata (layout_catalog_meta.php).SqlToolRunner+QuerySanitizer— read-only SQL sub-loop.CopyGenerator,ImageGenerator— single-call sub-services with their own cost logging.LandingPageApplier— validation + transactional Page/BlockText creation.- Tables:
nova_ai_pagebuilder_conversations(incl.compositionjson — the canvas state, shared across users),nova_ai_pagebuilder_messages,nova_ai_pagebuilder_logs.
Changelog
| Version | Date | Notes |
|---|---|---|
| 0.1.1 | 2026-08-26 | No functional changes — release de verificare pentru auto-update-ul Packagist (webhook Bitbucket) |
| 0.1.0 | 2026-08-26 | Composition canvas: split view with layout palette, drag&drop band cards (instructions, image kind, variants, product drop-zones), draggable product chips from chat research, importable numbered structure proposals (propose_structure), get_composition tool + MODUL COMPOZIȚIE prompt stage, GET/PUT conversations/{id}/composition, 1:1 canvas↔plan validation with auto-filled pinned-product specs, single-hero guard (page banner dropped when the first band is a hero with image). Fixes: SSE client dropped streaming tokens equal to "0" (PHP empty()), copy generator delta retry for missing band keys, interrupted tool-calls get synthetic results on replay (conversations stay resumable). Coordinator default moved to GPT (gpt-5.4, gpt-5.5 in allowlists); 45 feature tests |
| 0.0.1 | 2026-08-25 | Initial release: conversational landing-page agent with a two-stage flow — research/analysis turns (analytical product questions answered as markdown tables via mode=research, iterative proposals) and build stage (interview → structure consent → generation → data entry → links); per-agent model dropdowns (Coordinator/SQL/Copy/Image) with per-conversation override; read-only SQL product selection (pinned SKU + dynamic filters, best-sellers); multi-locale copy; image generation with img2img composition integrating the selected products' real photos (media read through the media disk, S3/spaces included); deterministic applier with full pre-write validation; draft-only pages with admin frontend preview; conversations shared across all tool users (owner shown in sidebar); per-phase cost logging; 31 feature tests |