Skip to content

Site Constructor

Overview

A lightweight site builder to manage marketing pages (Home, About, Additional) with localized content, media, and SEO. Sites are stored in Prisma sites and edited via the Site screen in Settings.

Data model & service

  • Prisma model: sites
  • Service: services/global/SiteService.ts
    • createSite(site, tenantId, createdById) → also issues encrypted token
    • findById, findByDomain, getSitesByTenantId
    • SEO helpers: addMetaTag, deleteMetaTag, addScriptTag, deleteScriptTag
    • Domain ops: createDomain, getSiteDomain, verifyDomain

UI

  • Page: pages/site-constructor.js
  • Component: components/pages/Settings/Site/SiteConstructor.js
    • Fragments: HomeForm, AboutForm, AdditionalForm, SiteHeader, SiteSpeedDial
    • Uses local site state (activeTab, isLoading)
  • Messages: components/pages/Settings/Site/messages.js

Widget integration

  • The Site screen requires at least one widget: viewer.widgets.count drives availability of actions
  • See [Booking Widget](./widget.md) for embedding and configuration

Operations

  • Domain management via SiteService
  • Scripts and meta tags are persisted in JSON columns (scripts, metaTags)
  • Token is generated as encrypt(tenantId:siteId) and persisted on creation