Web frontend architecture
The web frontend is a React single-page application that gives operators one browser workspace for Admin Console access, application delivery, cluster control, and operational support. It loads shared session and application context at the root, then uses URL routes and feature components to present the right operator task. See Web Admin Console for the product-level view and Web product workflows for the main user journeys.
Browser entrypoint
The browser entrypoint mounts the React application at the app element and places two route areas under a browser router. The normal Admin Console area is protected by an error boundary, while the separate upgrade-service area has its own top-level route. Global SCSS and CSS are loaded before the application renders, so all routes share the same base visual rules. [web/src/index.tsx#L1-L33]
The entrypoint establishes the following outer boundaries:
- Browser navigation: URL changes select the current screen without a full page change.
- Upgrade service:
/upgrade-service/*is reserved for upgrade-service views. - Admin Console: all other paths enter the shared
Rootcomposition. - Error recovery: unexpected errors in the Admin Console area show a recovery screen instead of leaving the operator with a blank page.
Root composition
The Root component is the application shell. It gathers metadata and application state, keeps the browser aware of backend health, supplies shared context, and composes the navigation frame around nested route content. This makes route components focus on an operator task while the shell owns concerns that span many screens. [web/src/Root.tsx#L114-L148] [web/src/Root.tsx#L663-L724]
The shell supplies these shared layers:
- Query client: shared server-data queries can cache and reuse results across feature screens.
- Theme context: application branding can change the navigation logo and inject approved font and style data from metadata.
- Toast context: feature screens can coordinate success, error, warning, and child content messages.
- Navigation frame:
NavBar, an optional first-install sidebar, the route outlet, andFooterform the common page frame. - Modal layer: upgrade progress and lost-connection states remain visible above route content.
The root also turns backend state into navigation choices. Metadata identifies the product mode and branding. The application list supplies capability flags such as GitOps, access, snapshots, and embedded-cluster support. The shell uses those flags to expose only the relevant top-level areas. [web/src/Root.tsx#L293-L328] [web/src/Root.tsx#L413-L431] [web/src/components/shared/NavBar.tsx#L142-L171] [web/src/components/shared/NavBar.tsx#L209-L290]
The main shell flow is shown below.
flowchart TD
A[Browser entrypoint] --> B[Browser router]
B --> C[Admin Console error boundary]
C --> D[Root shell]
D --> E[Metadata and application state]
D --> F[Shared providers]
F --> G[Navigation frame]
F --> H[Route content]
D --> I[Upgrade and connection modals]
E --> G
E --> H
Route composition
The route tree maps broad operator areas to feature and shared components. The root route redirects an authenticated operator to application content and an unauthenticated operator to secure-console access. Nested application routes keep the selected application in the URL, which lets dashboards, version history, configuration, troubleshooting, licensing, and registry screens share one application context. [web/src/Root.tsx#L724-L750] [web/src/Root.tsx#L975-L1011]
The /app/:slug/* area is coordinated by AppDetailPage. It resolves the application from the URL and the application list, repairs an old slug when only one application exists, and preserves the nested page during that repair. It also sends an empty or missing application state to the first application, the install flow, cluster loading, or secure-console access. Once an application is ready, it gives nested views the selected application, cluster state, refresh actions, and release actions through the outlet context. [web/src/components/apps/AppDetailPage.tsx#L78-L141] [web/src/components/apps/AppDetailPage.tsx#L413-L438] [web/src/components/apps/AppDetailPage.tsx#L440-L505]
The application version history screen is a feature-level coordinator within that context. It presents deployed and available versions, then connects update discovery to deployment, rollback, version comparison, release notes, logs, and offline bundle upload. Embedded-cluster applications can also start an upgrade service for a selected available update. [web/src/components/apps/AppVersionHistory.tsx#L1512-L1566] [web/src/components/apps/AppVersionHistory.tsx#L1961-L2141]
The route groups have these roles:
| Route area | Operator purpose |
|---|---|
/secure-console | Start or resume protected Admin Console access. |
/app/:slug/* | View and manage one application, including its dashboard, tree, versions, configuration, license, and support views. |
/cluster/* and /:slug/cluster/* | Manage the cluster and inspect embedded-cluster nodes when the product mode supports it. |
/snapshots/* | View snapshot and restore operations at the console or application level. |
/gitops | Manage GitOps settings and application selection. |
/access/* | Manage access-related settings when the required capabilities exist. |
/upload-license, /install-with-helm, and air-gap paths | Add an application or supply an offline release. |
/restore and /restore-completed | Enter and complete a restore operation. |
/unsupported and unmatched paths | Explain browser limits or an unknown route. |
The license view uses the application context to keep license changes tied to the selected application. It can sync a connected application's license, accept a license file for an air-gapped application, replace a community license, or replace a service account token when the current license uses one. After a change, it guides the operator to GitOps or version history when another step is needed. [web/src/components/apps/AppLicense.tsx#L72-L152] [web/src/components/apps/AppLicense.tsx#L154-L218] [web/src/components/apps/AppLicense.tsx#L240-L305] [web/src/components/apps/AppLicense.tsx#L364-L419] [web/src/components/apps/AppLicense.tsx#L576-L607]
The root checks session state and backend responses before it selects the next screen. A successful login refreshes the application list, then sends the operator to cluster management, an air-gap step, or the first application based on the current installation state. [web/src/features/Auth/components/SecureAdminConsole.tsx#L50-L88]
Shared components
Shared components provide the visual and interaction patterns used by several product areas. The navigation frame gives operators a stable way to switch between application, GitOps, cluster, snapshot, and access areas. Smaller shared controls handle forms, tabs, sidebars, loading, warnings, markdown, file trees, code, and dialogs. [web/src/components/shared/NavBar.tsx#L181-L310] [web/src/components/shared/ErrorBoundary.jsx#L33-L69]
The shared layer has two important roles:
- Frame components keep navigation, footer, errors, and page structure consistent.
- Task components give feature screens common controls for status, input, content display, and confirmation.
Feature modules remain the owners of product-specific behavior. Shared components receive data and callbacks from the shell or feature that uses them. For example, version history owns update and deployment state while AvailableUpdatesComponent renders the reusable available-update list and delegates actions back to the feature. [web/src/components/apps/AppVersionHistory.tsx#L2124-L2132] [web/src/components/apps/AvailableUpdatesComponent.tsx#L81-L188]
References: web/…/NavBar.tsx• L35-112 web/…/ErrorBoundary.jsx• L4-69 web/…/Root.tsx• L703-724 web/…/AvailableUpdatesComponent.tsx• L8-188
Contexts and hooks
Contexts carry state that many descendants need without passing it through every route. The root theme context exposes branding state actions. ToastContext exposes message state and controls for shared feedback. [web/src/Root.tsx#L73-L79] [web/src/Root.tsx#L696-L704] [web/src/context/ToastContext.tsx#L3-L51]
Hooks connect screens to route state and shared server data. The metadata and application hooks use React Query for cached reads. The selected-application hook combines the URL slug with the application list. Router support also gives older components a common set of location, navigation, parameter, outlet, selected-application, and refetch values. The upgrade-service preflight hook delegates result loading, response shaping, polling, and display state to the shared preflight hook, so upgrade views follow the same preflight contract as application views. [web/src/stores/getMetadata.jsx#L1-L25] [web/src/features/Gitops/hooks/useApps.tsx#L1-L36] [web/src/features/App/hooks/useSelectedApp.tsx#L9-L23] [web/src/utilities/react-router-utilities.tsx#L11-L41] [web/src/components/upgrade_service/hooks/getPreflightResult.tsx#L1-L13] [web/src/features/PreflightChecks/api/usePreflightResults.ts#L92-L131]
These hooks define the main direction of shared data flow:
- The URL identifies the current route and application slug.
- Query hooks obtain metadata or application data from backend services.
- Contexts and hook results make shared state available to route and feature components.
- Components use the data to render capability-aware controls and request updates.
References: web/…/ToastContext.tsx• L18-51 web/…/getMetadata.jsx• L3-25 web/…/useApps.tsx• L4-36 web/…/useSelectedApp.tsx• L9-23 web/…/react-router-utilities.tsx• L18-41 web/…/getPreflightResult.tsx• L1-13 web/…/usePreflightResults.ts• L92-131
Stores and services
The frontend uses React Query as its shared server-data store and keeps a small root state for cross-screen session, branding, capability, health, and progress information. The store entrypoint currently exposes the metadata query hook. The root also retains a local application list because navigation and installation decisions need it across routes. [web/src/stores/index.tsx#L1-L3] [web/src/Root.tsx#L87-L110]
Services group work that is shared but does not belong to one screen. ConfigService turns configuration groups into visible and usable configuration items by resolving nested items, filters, and conditional when rules. The tracking service connects navigation changes to page-view reporting when tracking is available. [web/src/services/ConfigService.js#L7-L131] [web/src/services/matomo.js#L5-L62]
The browser talks to backend services through authenticated requests. Root-level health checks use a timed fetch so the shell can show a connection-terminated state. The air-gap upload service adds chunk upload, progress recovery, release checks, and post-upload processing for large offline bundles. During an upgrade, UpgradeStatusModal separates temporary API failures from expired sessions: it keeps retrying after non-401 responses and resumes status polling after the API responds again, while a 401 logs the user out. [web/src/utilities/fetchWithTimeout.ts#L1-L21] [web/src/utilities/airgapUploader.js#L7-L31] [web/src/utilities/airgapUploader.js#L66-L174] [web/src/components/modals/UpgradeStatusModal.tsx#L19-L49] [web/src/components/modals/UpgradeStatusModal.test.tsx#L27-L65]
References: web/…/index.tsx• L1-3 web/…/Root.tsx• L226-291 web/…/ConfigService.js• L7-131 web/…/matomo.js• L38-62 web/…/fetchWithTimeout.ts• L1-21 web/…/airgapUploader.js• L66-254 web/…/UpgradeStatusModal.tsx• L19-49 web/…/UpgradeStatusModal.test.tsx• L27-65
Styling and branding
Styling combines shared SCSS rules, Tailwind utility classes, and styled-components primitives. SCSS supplies reset, base, type, form, button, icon, modal, utility, and feature-wide rules. Tailwind uses a tw- prefix so its utilities can coexist with the older class system. Styled components provide small typed layout and text primitives for code that needs styles from props. [web/src/scss/index.scss#L1-L15] [web/tailwind.config.js#L6-L101] [web/src/styles/common.tsx#L1-L148]
Branding is part of the runtime experience rather than only the build theme. Metadata can provide a logo, font faces, and CSS. The root places those values into the document and passes the selected logo to the navigation and login surfaces. [web/src/Root.tsx#L293-L328] [web/src/Root.tsx#L663-L695]
References: web/…/index.tsx• L7-10 web/…/index.scss• L1-15 web/tailwind.config.js• L6-101 web/…/common.tsx• L28-148 web/…/Root.tsx• L663-695
Types and shared utilities
Shared types describe the data contract between backend responses and feature views. The central type set covers applications, licenses, downstream versions, cluster and GitOps state, preflight results, snapshots, support bundles, charts, metadata, and configuration navigation. These types give feature modules a common vocabulary for capability flags and lifecycle state. [web/src/types/index.ts#L1-L31] [web/src/types/index.ts#L91-L170] [web/src/types/index.ts#L182-L278] [web/src/types/index.ts#L306-L366]
Shared utilities keep display and browser behavior consistent across features. They handle date and time display, route and provider links, status labels, preflight result summaries, configuration or deployment decisions, file-tree shaping, air-gap archive reads, browser storage, cookies, session roles, and logout redirects. Preflight notices count as warnings unless a failed check or collection error makes the overall state fail. A small repeater supports repeated async work, while usePrevious lets a component compare a value with its prior render. [web/src/types/index.ts#L1-L31] [web/src/utilities/utilities.js#L104-L221] [web/src/utilities/utilities.js#L328-L371] [web/src/utilities/utilities.js#L417-L447] [web/src/utilities/utilities.js#L605-L714] [web/src/utilities/utilities.js#L889-L1007] [web/src/utilities/repeater.js#L1-L30] [web/src/hooks/usePrevious.tsx#L1-L9]
References: web/…/index.ts• L1-31 web/…/index.ts• L91-170 web/…/index.ts• L182-278 web/…/index.ts• L306-366 web/…/utilities.js• L104-221 web/…/utilities.js• L417-447 web/…/utilities.js• L605-714 web/…/utilities.js• L889-1007 web/…/usePrevious.tsx• L1-9
Frontend build boundary
The build boundary turns the mixed JavaScript, TypeScript, JSX, SCSS, CSS, image, and font inputs into browser assets. It also injects environment values such as the API endpoint and selects development or enterprise build behavior. Import aliases keep feature, component, store, type, utility, and source references stable as the application grows. [web/webpack.config.js#L19-L77] [web/webpack.config.js#L79-L181]
The frontend is built and checked as a browser application. Development uses a webpack server. Unit tests, lint checks, and TypeScript checks run through the web package scripts. The browser target excludes Internet Explorer and supports current browsers defined by the package policy. [web/package.json#L7-L18] [web/package.json#L140-L144]
References: web/webpack.config.js• L19-77 web/webpack.config.js• L79-195 web/package.json• L7-18 web/package.json• L140-144
Change checklist
When these files or sections are changed, remember to consider these:
- Route changes in
Rootmust stay aligned with the navigation destinations and the selected-tab rules inNavBar. - Changes to metadata, application capability flags, or shared types must preserve the shell's feature gating and first-install redirects.
- Changes to API request behavior must preserve authenticated credentials and the root's distinction between an expired session and a lost backend connection.
- Changes to configuration group shape or conditional values must preserve the relationship between
ConfigService, configuration navigation, and rendered configuration fields. - Changes to branding fields must preserve both document-level style injection and the logo consumers in the navigation and login surfaces.
- Changes to version-history update state or available-update props must preserve the handoff between
AppVersionHistory,AvailableUpdatesComponent, and the upgrade-service status flow. - Changes to application route identity or outlet context must preserve
AppDetailPage's single-application slug repair, install redirects, and nested application actions. - Changes to license response fields or license credentials must preserve the sync, air-gap upload, license replacement, and service account token flows in
AppLicense. - Changes to class naming or the Tailwind prefix must account for the coexistence of SCSS utilities, feature SCSS, and Tailwind utilities.
- Changes to preflight response fields, notices, or polling rules must preserve the shared result shape used by application and upgrade-service views, including warning and failure states.
- Changes to upgrade status polling must preserve the distinction between temporary API errors, connection recovery, and
401session expiry.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
The app mount element is missing. | The browser cannot mount the Admin Console. | Keep the host page and the frontend entrypoint contract aligned. |
A protected API call returns 401. | The browser clears its local session marker and redirects to secure-console. | Preserve authenticated requests and session handling in shared request paths. |
| Root health checks fail after retries. | The shell stops polling and shows a connection-terminated modal. | Keep the health endpoint available and restore the connection before continuing. |
| Metadata or capability flags do not match the selected product mode. | Navigation can expose the wrong feature or hide the next installation step. | Keep metadata types, root gating, and backend response fields aligned. |
| A configuration condition is malformed or points to a missing item. | A configuration group can remain visible or become hidden incorrectly. | Preserve the when expression contract used by ConfigService. |
| An air-gap chunk upload loses its connection. | Upload progress can pause or restart until the client reconnects and resumes. | Keep resumable identifiers, progress queries, and bundle processing compatible. |
| Available-update data or upgrade-service status fails to refresh. | An embedded-cluster update can show stale choices or remain in a loading state. | Keep the available-update response and upgrade-service task status contracts aligned with the version history feature. |
| A preflight notice is dropped during result shaping. | The operator can see a passing result when the backend reports that some checks were not run. | Keep notice handling aligned across the shared preflight hook, display result shaping, and summary state helper. |
| A stale application slug remains in a single-application URL. | A direct link to a nested application page can fail to resolve the installed application. | Preserve the canonical slug redirect and its query and hash values. |
| A license or service account token response names another application. | The operator can remain on the wrong application's license page. | Keep response slugs and application license routes aligned. |
| Upgrade polling treats a temporary non-401 API error as session expiry. | The operator is logged out during a cluster update instead of waiting for recovery. | Keep UpgradeStatusModal retry behavior separate from its 401 logout path. |
Key files
| File | Why to read it |
|---|---|
| web/…/index.tsx | Shows the browser mount, outer routes, global style imports, and error boundary. |
| web/…/Root.tsx | Shows the shell state, providers, navigation frame, health behavior, and route composition. |
| web/…/NavBar.tsx | Shows how shared navigation reflects route and product capabilities. |
| web/…/AppDetailPage.tsx | Shows how application routes resolve the selected application and provide nested application context and actions. |
| web/…/AppLicense.tsx | Shows the license sync, upload, replacement, and service account token flows within application context. |
| web/…/AppVersionHistory.tsx | Shows how the application version screen joins version history, update discovery, deployment, diff, logs, and upgrade-service actions. |
| web/…/AvailableUpdatesComponent.tsx | Shows the reusable available-update display and action boundary used by embedded-cluster applications. |
| web/…/UpgradeStatusModal.tsx | Shows how upgrade progress distinguishes API recovery from session expiry. |
| web/…/ToastContext.tsx | Shows the shared feedback state available to feature screens. |
| web/…/getMetadata.jsx | Shows the cached metadata query used by the shared data layer. |
| web/…/useSelectedApp.tsx | Shows how route identity maps to an application. |
| web/…/usePreflightResults.ts | Shows the shared preflight data flow used by application and upgrade-service screens. |
| web/…/getPreflightResult.tsx | Shows how the upgrade-service route supplies its endpoint to the shared preflight hook. |
| web/…/ConfigService.js | Shows the shared rules that shape conditional configuration UI. |
| web/…/utilities.js | Shows common session, status, preflight, display, and browser data helpers. |
| web/…/airgapUploader.js | Shows the client-side boundary for large offline release uploads. |
| web/…/index.ts | Shows the shared vocabulary for backend data and feature state. |
| web/…/index.scss | Shows the global SCSS style layers. |
| web/tailwind.config.js | Shows the prefixed utility style boundary and shared color system. |
| web/webpack.config.js | Shows the browser asset and environment build boundary. |