SiteBuilder for Paymenter — v3.0.0
Customers build a single-page template website on their own hosted domain — without leaving Paymenter. Pick one of 8 templates, edit the page itself on a visual canvas — click text to change it, drag sections into place — press Publish, and the site goes live on their domain as static files.
Included with Starter/Plus hosting (owner decision 2026-11-19) — not a paid add-on, so there is no sale pricing in v1.
What v3 does (new in 3.0.0)
- Visual canvas builder: the editor page IS the builder — the
compiled page renders as the canvas, and customers click any text
to edit it in place, drag sections by their ⠿ handle, change
images from a popover, duplicate / hide / add sections, and add,
remove and move repeatable items — then Save + Publish from the
same page. Edits map back to the stored section+field content
(design §13.1), so template switching and the panel editor keep
working. The v2 panel editor stays as the fallback at
?editor=panel(it holds the design controls). - v3.0.1 fixes on dev (not deployed, version not bumped yet):
the canvas drag handle / item tools can no longer leak their
text ("⠿ drag", "↑↓×") into stored field values; the publish
badge flips to Published as soon as the files are live
(success is recorded before the stale-stylesheet cleanup);
the legacy
assets/style.cssis deleted directly by fixed name after a successful publish (design §13.9). - v3.1.0 "Clean Canvas" panel editor redesign on dev (not deployed, version not bumped yet): the template switcher is always visible as larger picture cards; sections are an accordion (one open at a time); "Show this section" is a proper on/off switch; an Undo button restores the previous saved state; publish progress is a slim non-blocking status line under the header. The canvas editor is unchanged (design §14).
- No daily publish limit (owner decision 2026-11-25): the
max_publishes_per_daycap (default 10) is removed entirely — a customer iterating on their site is never refused for publishing "too often". Thepublishes_todaycounter is kept as stats only and never blocks a publish. This also fixes the 2026-11-25 report that a template switch + publish did not change the live site: the publish was being refused by the cap, so the live site stayed on the old template (design §13.5).
What v2 does (new in 2.0.0)
- Template switcher: change template from inside the editor without losing content — words, photos and prices move into the matching sections of the new template; anything the new template has no place for (e.g. a gallery) is kept and comes back if you switch back. The accent follows the new template's look. The live site keeps the old template until you press Publish again.
- Drag-and-drop section reordering (SortableJS via CDN, no build step): drag sections by their grip into a new order; the order is saved with the draft and shows in the preview and the published page. Up/down buttons on every section are the phone-friendly fallback (and keep working if the CDN fails).
- Text & image design controls per section: heading and body text each get font family (6 web-safe stacks), size, weight, colour and alignment; images get fit (cover/contain), position and corner rounding; every section gets a background colour and background image. The settings render as appended CSS rules in the published stylesheet — no raw CSS from the customer.
- Preview now renders the stylesheet: the preview iframe inlines the compiled CSS, so the template and the design settings actually show in the preview (v1's preview loaded the page unstyled because the stylesheet link 404s — the extension's files are not web-accessible). Published files are unchanged (index.html + the content-hashed stylesheet).
What v1 does
- Builder inside Paymenter (client area, same sign-in): a "Website Builder" card on the hosting service page opens the template picker, then the section editor. No external app, no second login.
- 8 shipped single-page templates (original designs, no
third-party licensing): Business, Restaurant, Salon, Church,
Portfolio, Trades, Landing Page, Store Front. Each is a
schema.json(sections + defaults) +style.css+thumbnail.svgunderextensions/Others/SiteBuilder/templates/. - Form-based section editor with live preview (not drag-and-drop — phone-friendly): big fields, repeatable items with up/down/remove buttons, section on/off toggles, accent-colour picker. Autosave (debounced) with a "Saved" indicator; the preview iframe reloads after each save. On a phone the preview is an Edit/Preview toggle; on desktop it sits beside the form.
- API-only publish, static files only: the draft compiles to
index.html+ the content-hashed stylesheet (assets/style-<hash>.css, §13.8) and is pushed to the Hestia docroot (/home/<user>/web/<domain>/public_html/) through the panel API —v-make-tmp-file(stage content) +v-copy-fs-file(place it). There is no direct file-write API. Publish runs in a scheduled background job (every minute); the Publish button only queues it. Status showsdraft → publishing → published(orfailed+ error + Retry). - Publish safety rules (enforced at request time AND in the
job): owner + active service only; refused while a Quick Install
app owns the docroot (never clobbers WordPress etc.); no
executable content — customer input is tag-stripped at save and
escaped at compile, there is no raw-HTML field, image URLs must
be
https:(or root-relative); no daily publish limit since v3.0.0 (the old 10/day cap was removed by owner decision 2026-11-25); logs carry service ID + domain + template- file count only — never content or credentials.
- Lifecycle inherited from Hestia: suspend takes the site offline automatically (builder blocked with a notice while suspended); terminate deletes the Hestia user and the files with it, and the builder rows are deleted too (service FK cascade + hourly reconciliation fallback).
- Admin (Filament, under Extensions): Builder Sites (support list + Retry publish + View live site), Builder Templates (enable/disable per template — a disabled template stays usable by sites already using it), Stock Images (the admin-curated image library the editor's pickers offer).
- Images in v1 are URLs only: paste an image link, or pick from the stock library. No customer uploads — the Hestia API has no binary-upload path (uploads are v2, behind an SFTP proof).
What v2 does NOT do (yet)
Multi-page sites; customer image uploads; per-item design settings (design is per section); custom fonts (web-safe stacks only); drag-and-drop (GrapesJS advanced mode is still a later candidate — v2.0.0's SortableJS only reorders sections); e-commerce/cart on the customer site; contact forms (mail is excluded from the hosting scope — templates show contact details with tel:/mailto: links, not a working form); a blog on the customer site (separate blog extension); custom templates; admin editing of customer content.
Install
- Copy
extensions/Others/SiteBuilder/into your Paymenter install'sextensions/Others/directory. - In Paymenter admin → Extensions → Available Extensions, install
SiteBuilder and enable it. Install runs the migration
(four
sitebuilder_*tables) and seeds the template rows. - On the SiteBuilder extension record, set:
- Panel URL — the Hestia panel base URL (same value as the
Hestia server entry), e.g.
https://hestia.smithandtech.space. - API base URL (optional) — leave empty to use the Panel URL,
or set the panel's LAN address (e.g.
https://10.0.0.166:8083) to bypass Cloudflare's ~100 s proxied-request limit. - Access key / Secret key — a Hestia access-key pair for the
adminuser. Same key as the Hestia entry (or a second key with the same commands). It must grantv-make-tmp-file,v-copy-fs-file,v-move-fs-file,v-add-fs-file,v-delete-fs-file,v-delete-fs-directory,v-list-fs-directory(the existing full-access key covers them; a least-privilege key must grant them or publish fails withE_FORBIDDEN(10)). - Max publishes per service per day — default 10.
- Panel URL — the Hestia panel base URL (same value as the
Hestia server entry), e.g.
- Click Test Connection — it runs
v-list-user-packages jsonand must return a package list. - Optional: in admin → Extensions → Builder Templates, disable any template you don't want offered; in Stock Images, add the image URLs the editor's pickers should offer.
Use (customer)
Service page → Website Builder card → pick a template → fill in the sections (the preview updates as you type) → Publish. After publishing, the service page shows "View live site" and "Edit site". Editing a draft never touches the live files until Publish. A second publish after an edit replaces the content.
Use (admin)
- Builder Sites: every customer site (service, domain, template, status, last published). Retry a failed publish from the row action — it re-queues the site for the scheduled job.
- Builder Templates: toggle templates on/off for the picker.
- Stock Images: add/remove the URLs the editor offers.
Design deviations (design said one thing, the code does another — on purpose)
- Service-page entry is middleware injection, not
getActions()(design §7.3). Paymenter'sExtensionHelper::getActions()/getView()dispatch ONLY to the service's server extension (HestiaCP) — verified against the Paymenter 1.5.9 source (app/Helpers/ExtensionHelper.php,app/Livewire/Services/Show.php). An "Other" extension cannot add an action to a Hestia service page through that mechanism; doing so would mean editing HestiaCP.php, a different extension's code. The builder reaches the service page the proven no-core-edit way instead: theInjectSiteBuildermiddleware adds a "Website Builder" card to theservices.showresponse (same pattern as ShareButtons / LinkedProducts). The card is static HTML (the service page is Livewire) and links to the builder routes. - Templates live inside the extension directory
(
extensions/Others/SiteBuilder/templates/), not at the repo root as the design's §7 layout sketch shows — so the deployed extension is self-contained (the fork bundles extensions from theextensions/tree). - Templates share section renderers (
SiteCompilerrenders the 8 section types; templates differ in section set/order, defaults, and stylesheet). The design allows per-template markup; shared renderers keep v1 maintainable and make the data model editor-swappable (a future GrapesJS mode renders the same content through the same compiler). - Template placeholder images are picsum.photos URLs (schema defaults). They are placeholders the customer replaces; if the placeholder service is ever unreachable the images simply don't load — nothing breaks. The stock library is the admin-curated alternative.
- There is no daily publish limit (v3.0.0, owner decision
2026-11-25): the
max_publishes_per_daycap (default 10) was removed entirely — a customer iterating on their site must never be refused for publishing "too often". Thepublishes_todaycounter is kept as stats only (support diagnostics) and is never consulted by any refusal. - Delete-first before every copy (not "delete only if
overwrite is unproven"): since whether
v-copy-fs-fileoverwrites in place is unverified, the publish always deletes the target first (v-delete-fs-file, E_NOTEXIST ignored) and then copies. Safe under either behaviour.
Unverified items (flagged, not hidden — see DESIGN.md §11)
- Whether
v-copy-fs-fileoverwrites in place — coded delete-first (deviation 6 above); verify on the proof run and simplify if it does overwrite. - Whether "Other" extensions receive service-termination lifecycle events — the builder does NOT rely on them: the service FK cascade deletes builder rows with the service, and the hourly reconciliation deletes any orphans. If Paymenter ever delivers termination events to "Other" extensions, a hook can replace the reconciliation — it is not needed for correctness.
- The stage-then-rename atomic publish (
.new+v-move-fs-file) was NOT built — v1 stages all files, then copies CSS before HTML, and records the exact failing step. A mid-publish failure can leave a mix of old and new files; a retry completes it. - SFTP from CT 119 to CT 121 with panel credentials — unverified; it gates v2 image uploads, not v1.
- The Hestia API arg size limit for
v-make-tmp-filecontent — unverified. The client refuses files over 512 KiB with a clear error instead of risking a silent truncation. - The exact
v-list-fs-directoryoutput format across Hestia versions — unverified. The parser takes only entry basenames, and a parse miss cannot fail a publish (the assets-directory create is best-effort; the copy reports the real error). - The tmp-file + copy publish pattern is proven in-design (Hestia v0.4.0 uninstall staging) but has NOT been proven live against the panel yet — the proof run (§10 of the design) must exercise it on a throwaway service before v1 goes live.
- Filament auto-discovery of the three admin resources, the migration actually running, the middleware injecting into a real service page, and the editor/preview/publish flow end to end — NOT verified here (no live Paymenter in the build environment). See the proof plan in DESIGN.md §10.
Tests
Run from the repo root with plain PHP (no Laravel boot, no database, no web server):
php tests/sitebuilder_harness.php
What it proves: php -l clean on every PHP file; all 8 template
schemas parse and use only known section types; the compiler
renders a full page per template with escaped customer content
(<script> / javascript: / on* never survives); the validator
strips tags, enforces https-only image URLs, caps lengths and
item counts; the publish safety rules refuse suspended services,
missing mappings and Quick Install clobbers — and allow a clean
publish (there is no daily publish limit since v3.0.0); the
middleware only acts on services.show and never throws through;
the migration, routes, admin resources and extension class contain
the expected structure; every shipped stylesheet carries the
token and no leftover tokens survive a compile.
What it does NOT prove (needs a live Paymenter — see DESIGN.md §10): Filament auto-discovery, the migration running, middleware injection into a real service page, the editor/preview/publish flow, the Hestia API calls, or the scheduled job.