Portal System
The portal runtime serves a project's installed apps/forms to guests, attendees or supported readers. Configuration separates reusable plugin definitions, project installations, portal links, themes, domains, login methods and widgets. Multiple portals can present the same project through different routes and audiences.
This reference describes Experience Portal 7f2ea7c1635fea7ebc975abe31d895d51b6aa6f3. Use Portal Configuration for dashboard setup and Install an App on a Portal for a complete assembly procedure. Detailed infrastructure deployment/recovery stays in separate operator runbooks.
Models and ownership
| Model | Runtime role |
|---|---|
| ProjectPortal | Project-owned theme selection/fallback, settings, active/default flags, login/code/PWA configuration and relationships |
| TopLevelDomain | Domain inventory, team/global/mask availability, DNS/SSL readiness, wildcard/single-use configuration and reservations |
| ProjectPortalDomain | Exact hostname attachment to a portal, default and stored active/confirmed/redirect attributes |
| ProjectPage | Installed reusable app with a plugin version or current-version fallback, settings, strings, assets and dependency bindings |
| ProjectForm | Project form; can be plugin-backed or use supported native registration rendering |
| ProjectPortalPage | Polymorphic page/form route link, single-segment path, title/order, active/login/code and inherited/override audience behavior |
| ProjectPortalWidget | Portal widget installation, version/fallback, settings/assets/trigger/security state and its distinct token principal |
| ProjectPortalAuthenticationMethod | Configured portal login method, field/provider settings, priority, registration and login group restrictions |
| ProjectPortalAccessCode | Portal-owned hashed access code and active state; successful validation stores its ID in the session |
A project's default portal is created only when a plan provisions one or an administrator creates it. The first manual portal becomes default. This default drives the app installer's optional navigation attachment; it is not the same as the default hostname or page.
Installation and routing lifecycle
The current App Store modal submits the selected app, name, resolved dependencies and optional navigation/shortcut/tile placement. It does not submit an arbitrary version selector.
- A regular app installs as ProjectPage pinned to
PluginPage.current_version_id. - A form-template app installs as ProjectForm with version ID zero, so its relation falls back to the plugin's current version; the form service seeds its template fields/sections.
- Optional portal navigation targets the project's default portal. With no default portal it logs the missing target and returns without adding a route; successful installation therefore does not prove route creation.
- Explicit existing page/form/widget version-ID updates are super-admin restricted. A valid pin and current-version fallback have different upgrade behavior.
Portal route allocation is serialized through ProjectPortalService::savePage: it locks the portal, scopes an existing link to it, rejects a new/changed path already used there, and appends a new link after the largest order. An existing legacy duplicate can retain its path during an unrelated edit. Reorder/normalization paths have their own ordering and cache behavior.
The portal editor's path rule accepts one alphanumeric/underscore/hyphen segment, rejects slashes and reserved names such as auth, api, code and gxp-diagnostics, and supplies / in the control. App installation slugifies its optional portal path before the same allocation check. The stored app slug and route path are different identifiers.
Host and domain resolution
ProjectPortalService::normalizeDomain lowercases/trims a lookup, removes a scheme when supplied and strips a trailing numeric port. findByDomainLookup joins the exact attachment to portal/project/team IDs. The ordinary page call omits activeOnly; the optional active-only variant is used by flows such as the SSO return-host check.
The ordinary lookup does not filter attachment active/confirmed state. PortalConfig does not apply a found attachment's redirect_to. Those stored columns alone do not establish revocation or matched-host redirect behavior. The portal API lookup independently reads an exact hostname and likewise does not add those attachment predicates. Test the supported detach/portal-access paths at both browser and API endpoints.
With no exact attachment, wildcard fallback selects a matching TLD. A reserved subdomain with a redirect URL returns 302; an explicit reservation without a URL returns 404. Otherwise the TLD's root redirect is used, with 404 if unset. A matching attached portal takes precedence over that fallback. A page slug does not change domain ownership or reservations.
Attachment and provisioning
The existing custom-domain attachment service requires ready DNS/SSL, appropriate team/global ownership, eligible/reserved-name handling and wildcard/single-use availability. Available selectors are also mask-filtered. A single domain in use is not silently transferred; a wildcard requires a subdomain.
The special system/default choice builds a subdomain under the configured default portal TLD, checks format/reservations/collisions and creates a preconfirmed active attachment. Other system rows are selected separately from the offered inventory.
Creating a new custom hostname through the portal creates a TopLevelDomain and a pending ProjectPortalDomain immediately, reserves single use, sets displayed verification records and schedules verification. Provisioning/status handlers later activate/confirm pending attachments. This path does not set a default-domain replacement in the reviewed handlers. Readiness is a provisioning state, not a proven application-layer pending-domain denial, because the ordinary host lookup omits those flags.
Existing/system attachment makes the first domain default if needed. The default toggle chooses another attached domain and refuses turning the current default off without a replacement. Detach does not automatically repair the default. The default-portal URL helper returns the active default portal's first default domain; it does not independently validate all domain readiness/uniqueness flags. Confirm the resulting real URL.
Use Custom Domains for customer configuration and diagnostics. GCP credentials, deployment topology and recovery commands belong in operator documentation.
Browser request pipeline
The portal middleware group includes stateful/cookie/session handling, preview-administrator rejection and attribution, then PortalConfig, activity recording, shared errors/CSRF, route binding, team scope and Inertia props. Per-route authentication/rendering follows. Do not equate dashboard and attendee sessions.
PortalConfig resolves host/project/portal state, assembles widgets and login methods, loads the pinned/current theme, sets request/session configuration and binds portal/project/domain attributes. It signs asset context for the serving portal hostname and adds the frame/content policy to supported responses.
Ordinary page requests to an inactive portal redirect to the closed view; an active portal's closed route returns to the root. CSS/manifest/discovery/service-worker and signed-login handling have explicit exceptions, so portal closure is not a promise that every infrastructure endpoint returns the same page status.
Portal-wide code requirements take precedence over a page code flag. A session code ID must belong to this portal's active-code list. The middleware records the intended destination from the validated attachment before redirecting to the code screen. This gate does not create attendee identity or dependency authorization.
Page selection, audience and navigation
The root uses getDefaultPage:
- Return an explicitly stored active default page, before the viewer audience check.
- Otherwise batch-evaluate active pages in portal order and select the first permitted for that attendee or guest.
- If none qualifies, the controller returns the system code-authentication view.
An explicitly configured inaccessible default can lead to a subsequent login/404 rather than another permitted landing page. Test root entry for each audience.
The current Page List editor does not expose dedicated route Active, navigation-enabled or default-page toggles. Ordinary dashboard setup uses ordering, audience rules and the detach/delete-link flow, with plugin-defined navigation flags where supplied. Stored runtime flags must not be presented as universally available UI controls. The super-admin Is Default Portal setting chooses the project-level installation target, not a default page.
PageController::show resolves the link within the portal, rejects missing/inactive links, authenticates through the portal/reader guard when required and evaluates audience access. Denied audiences return 404. A native plugin-free active registration form uses the registration view service; its update-only mode redirects a guest to login. Other supported plugin-backed page/form content uses the shared plugin renderer.
Navigation caches active navigation-enabled links, then batch-evaluates rules per viewer. Denied entries are removed, including their titles/slugs; the unfiltered administrative navigation list is hidden from portal props. A link with its own rules replaces inherited page/form rules, otherwise its model supplies them. System login/logout entries are added separately. Portal-visible tags can support the theme's filteredNav function.
Plugin rendering and API context
PluginPageRenderService supplies the installed version's bundle/style, merges default config with custom settings and default strings with language overrides, resolves project/static asset URLs and sets:
| Runtime value | Meaning |
|---|---|
| projectId | Team slug/project slug context |
| apiBaseUrl | Serving domain used for portal API requests |
| apiPageAuthId | Browser-visible portal-page key for page context |
| injectDataStore | The version's requested runtime store injection |
| formId / formSchema | Additional context for plugin-backed forms |
| dependencyPermissions / navConfig | Prepared effective app scope/navigation behavior |
Language strings can determine the content/browser title, while a portal link title overrides navigation labeling. App style fallback is applied when no installed style override exists; theme styles are separate. Test actual styling rather than assuming every value is appended identically.
A draft version with an active healthy variant development session can replace its bundle URL with the Vite source preview and omit the style bundle. That path is development behavior; it does not establish publication or production availability.
Page render authorization and API authorization remain separate checks. Portal page context is resolved from X-Portal-Page-Token or a supported bearer-only page key. Cross-portal keys are rejected; an individual attendee bearer belongs in Authorization. Page-key handling checks active/login/audience and same-project principal context before declared dependency access.
An active same-project reader can satisfy the general login requirement but evaluates audiences as a guest; attendee-only quiz operations still need an attendee. Widget principals do not supply independent project API permission through the base page branch. Project-token scope/serialization limits are documented separately in Authentication Overview. Do not place project/admin credentials in static apps or widgets.
Theme and widget runtime
New portal creation without a theme-version ID chooses the most recently updated theme version. Changing the theme through the update handler resets the pin to current-version fallback. A usable published/immutable theme release is therefore something to inspect and accept, not infer from the selection control.
PortalInertiaRequests supplies legacy Public/Private/System templates or signed compiled JS/CSS libraries. The frontend AppLayout compiles legacy templates with a default slot; a compiled layout is dynamically imported and receives layoutType and filteredNav with page content through its slot.
The portal widget parser merges installed settings/assets with legacy portal-level fallback, substitutes library configuration and assembles output. It does not filter is_enabled. Supported removal should be verified through detach/reload, not that flag alone. The document template emits widget libraries/scripts/meta/link tags. Global-component widgets reference a project app/form and get separate rendering props.
The reviewed legacy Private branch automatically mounts those global components. Public/System and the compiled branch do not contain that same automatic loop. A theme/widget integration must establish its intended surfaces explicitly. Widget keys remain distinct from page keys even when a global component exposes similarly named API props.
Theme colors and settings/font values are applied separately from app overrides. The Global Theme App Icon / Logo path copies a selected project asset into public icon variants, generated asynchronously; manifest requests can fall back to the original or bundled icons while variants are unavailable. Acceptance needs real asset loading and target mobile/PWA rendering, not just a saved selector.
Sessions and caches
PortalConfig stores attendee_auth_config with session timeout and remember settings. AttendeeSessionTimeout currently records activity instead of performing its old explicit threshold logout. CustomRedisSessionHandler reads configured minutes from serialized session data and applies TTL when writing; CustomSessionStore applies cookie lifetime/SameSite overrides. Confirm the deployed driver, remember behavior and real idle/reload result. SSO provider Session Duration and an issued API bearer's duration are separate contracts.
| Cache layer | Reviewed lifetime |
|---|---|
| Assembled portal_config for page hostname | 5 seconds |
| Host → project/portal/team lookup | 24 hours |
| Cached domain by ID | 1 hour |
| Unmatched wildcard-host fallback | 1 hour |
| Portal object and default-portal URL | 24 hours |
| Page/code map, widget list, login methods, navigation and page-by-slug data | 5 minutes |
| Portal API hostname/domain model lookup | 1 second, separate path |
Audience evaluation occurs after cached navigation, so one cached list is not one shared attendee verdict. Observers/update services invalidate scoped portal/page/widget/domain data; bulk reorder invalidation is deferred to commit. Short assembled-cache expiry and a full reload still matter. Cache invalidation does not revoke an already-established identity/session.
Portal commands and browser targeting
A command is separate from page/widget trigger state. At reviewed platform revision 7d7becc8f4317fe5949ff9f8b5ed97535c318b79, PortalCommandDispatched selects either portal.Portal.{portalId} or, when clientId is non-null, portal.Portal.{portalId}.client.{clientId}. The command store listens to both for the current portal and leaves previous subscriptions on reinitialization. Do not create another command listener inside each App.
The browser client ID is normally retained in localStorage, with a per-load generated fallback when storage fails. It identifies a browser context, not an attendee, permission grant or durable device identity; shared-origin tabs can share it. Both selected channel callbacks return true under Sanctum/web/admin/portal guards without a portal-owner or client-ID ownership check. Target isolation and the intended page-token/client configuration require acceptance; knowing or selecting a client ID is not proof of authorization.
The inspected handlers forward pwa-config-changed epochs to the host's PWA refresh method, reload for refresh, and assign accepted paths for navigate. Unknown commands are recorded locally and warned about; that is not a durable server acknowledgement. The navigation guard rejects ordinary absolute/protocol-relative URLs, but its path regex is not a complete same-origin check for malformed slash/backslash input. Do not rely on it as an origin-security boundary or provide untrusted destinations; owner-side validation/repair and real browser acceptance remain required.
The portal observer emits PWA configuration commands after changed PWA columns, but event receipt alone does not prove service-worker cache invalidation or a target kiosk reload. This review used synthetic command/navigation/PWA/storage/Echo doubles and did not issue live commands, clear browser caches or navigate a real portal. Default event serialization, real transport/reconnect, multiple-tab targeting and device outcomes remain unverified. Detailed operator command/recovery procedures stay separate.
Acceptance and diagnostics
Verify the actual default domain, root entry and direct page paths as guest, allowed/excluded attendee and different-project principal. Check code/login flags, same-project reader behavior when supported, page-key API denials, published versus preview bundles, bindings/assets and widget removal/surfaces. Test actual session expiry/logout and desktop/mobile/PWA behavior.
The retained repository evidence covers synthetic default-page, URL, routing, navigation, widget ordering/assets and page-context behavior. It does not certify real DNS/certificates, every theme/widget implementation, ordinary-account permissions, live IdP or target devices. Use Project Acceptance and Project Troubleshooting; record failing acceptance instead of interpreting a saved configuration as success.
Source evidence
The portal audit records hashes and inspected scope for ProjectPortal/Page/Domain/Widget models, configuration/installation requests/controllers, domain attachment/provisioning, portal configuration/Inertia/API middleware, page rendering, session/cache and frontend layout code. Executed source tests and their dependency/environment limits are recorded separately. The guide describes reviewed application behavior; its presence does not establish whole-hub or production acceptance.