Introducing a new way to review your PRs.

Read the announcement

zipstack / unstract

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

View on GitHub

28 documents · Updated Nov 23, 2026

docs / frontend-ui-architecture

Frontend UI architecture

The frontend is the browser interface for building, configuring, and operating Unstract document workflows. It turns the active session and organization into a routed product experience. The source currently supports a v0 application and a separate v1 tree so pages can move to the newer product model one at a time. See Frontend application for the wider runtime and backend connection model, and Frontend v1 foundation for the newer frontend boundary.

Source layout

The source is arranged around user tasks and shared UI concerns. Route pages provide entry points. Feature areas manage a task. Shared components, hooks, stores, and services connect those tasks to session data, server data, and short-lived UI state.

Application shell

The application shell starts the React tree and places global concerns around the routed interface. It provides theme selection, document titles, notifications, confirmation, analytics, browser history, session-aware behavior, and loading surfaces before it renders the route tree.

The v0 shell uses the stored session theme as its source of truth. It mirrors that choice to the document class used by the shared light and dark tokens. It mounts one toast surface and one confirmation host. Alerts appear as toasts and are also written to the in-app log, with request or execution IDs when available.

The shell also listens for sign-out in another browser tab. This prevents the next user from seeing the previous user's pages or cached data in an open tab. The v1 tree has its own provider chain and notification surface when a v1 page is active.

References: frontend/…/App.jsx• L40-161 frontend/…/App.jsx• L170-183 frontend/…/index.jsx• L19-83 frontend/…/index.css• L1-15 frontend/…/V1App.tsx• L10-43

Feature areas

Feature work is grouped by user task rather than by one large page module. Workflow and Prompt Studio areas support creation and editing. Deployment areas expose API and pipeline operation. Settings areas prepare platform resources, API access, and organization access. Connector, input-output, logging, review, and dashboard areas support the work around those core tasks.

Prompt Studio treats a project as a resource that users can create, import, search, edit, share, and assign co-owners to. Its detail area lets users configure prompts, model profiles, retrieval choices, and custom synonyms before they run the project. Project import first checks an exported JSON file and then maps its requirements to usable organization adapters.

The document area supports the active project while a user prepares input. The workflow area joins source and destination connectors, a selected Prompt Studio project, execution, feedback, and deployment. Optional product features use the same route and menu model without becoming required for the core product.

The v1 source applies the same task-based model with a stricter boundary. Pages represent product screens. The shell represents shared navigation and context. UI components and patterns provide common interaction rules. Services provide typed server access. Stores and hooks hold shared client state. Pure helpers and assets remain below those layers.

References: frontend/…/useMainAppRoutes.jsx• L31-100 frontend/…/ListOfTools.jsx• L150-257 frontend/…/ImportTool.jsx• L13-139 frontend/…/Agency.jsx• L97-187 frontend/…/README.md• L215-235 frontend/…/index.ts• L1-24

State boundaries

Local component state controls short-lived choices such as open dialogs, selected rows, loading indicators, and search text. Shared stores hold context used by related screens, such as the session, active workflow, selected tool, socket messages, alerts, and token use.

Detail helpers load server data into the matching store before nested screens render. They clear that store when the user leaves the detail area. This prevents a later workflow or tool visit from showing data from the prior visit. Feature hooks sit between components and these state boundaries for requests, pagination, errors, confirmation, and common feedback.

The v1 data boundary is explicit. Pages use typed service functions through TanStack Query. Query keys include the organization so one organization's data cannot fill another organization's view. A shared query view separates loading, first-read failure, refresh failure, and successful data.

Edit access is separate from resource state. Shared resources expose ownership and collaboration status. The UI can show a read-only notice or disable a control before an edit that cannot succeed, while the backend remains the final authority.

References: frontend/…/ProjectHelper.jsx• L14-71 frontend/…/CustomToolsHelper.jsx• L35-169 frontend/…/usePaginatedList.js• L75-210 frontend/…/resourceAccess.js• L1-23 frontend/…/README.md• L18-55 frontend/…/adapters.ts• L73-99 frontend/…/QueryView.tsx• L14-42

v1 source boundary

The v1 frontend is built beside v0 until a page is retired from v0. v0 may use only the public @v1 entry. v1 does not use v0 components, stores, hooks, helpers, styles, or antd compatibility shims. This boundary lets a page migrate its UI and data rules without making the rest of the application depend on its internal modules.

The main v1 areas have these roles:

  • App: providers, route registry, version switch, and page selection.
  • Pages: one product page per folder.
  • Shell: shared product frame and organization context.
  • UI and patterns: reusable controls and task-level compositions.
  • Services: typed HTTP calls, resource contracts, and error conversion.
  • Stores and hooks: client state and shared behavior.
  • Lib, styles, and assets: pure helpers, design tokens, global styles, and static files.

References: frontend/…/README.md• L9-35 frontend/…/README.md• L215-235 frontend/…/index.ts• L1-7

Routing

Routing maps public entry points and organization-scoped product areas to the UI that can serve them. The v0 router owns the application-wide boundary. The main v0 route tree owns authenticated product areas under /:orgName. The v1 version switch decides whether a registered URL uses v1 or continues through v0.

Route groups

The route tree separates access and product context before it selects a feature. Public routes include the landing page and selected share, Prompt Studio, marketplace, and simple Prompt Studio entry points. Authenticated routes use the organization name in the path. Organization routes then group build, manage, configure, and review work.

The main route groups are:

  • Build: workflows, Prompt Studio tools, and optional lookup or agentic features.
  • Manage: dashboard metrics, API deployments, ETL and task pipelines, app deployments, and logs.
  • Configure: model, vector, embedding, extraction, OCR, and connector resources, plus platform access, API keys, and users.
  • Review: human review, approval, download, sync, and related screens when the feature is available.

The organization segment identifies the active account in the browser URL. Product-aware wrappers can add onboarding, subscription, or review checks around the organization tree. Marketplace entry points that must work without an organization remain at top-level paths.

References: frontend/…/Router.jsx• L48-112 frontend/…/Router.jsx• L184-309 frontend/…/useMainAppRoutes.jsx• L214-332 frontend/…/SideNavBar.jsx• L365-506

Version routing

The version switch is the migration boundary between v0 and v1. A registry entry declares the v1 paths for a page, the v0 paths it replaces, and the mapping between them. A page becomes the user-facing v1 page only when its key is registered. Unregistered paths continue to render v0.

When a v1 page is selected, v1 renders as its own tree with its own query client, theme provider, routes, and toaster. When v0 is selected, the v0 route tree is unchanged. Human Review can keep a per-user old-version choice, so the user can move between the mapped v1 and v0 screens without a full reload.

Development-only demo routes prove this switch. They are available only when the v1 development route flag is enabled. A v1 page failure stays inside the v1 boundary; a stale lazy chunk can cause one page reload, while a repeated failure shows a reload action.

This diagram shows how a browser URL reaches either the v1 page tree or the existing v0 routes.

flowchart LR
    URL[Browser URL] --> Registry[Live route registry]
    Registry -->|registered v1 page| V1[V1App providers and page]
    Registry -->|unregistered or v0 route| V0[v0 route tree]
    V1 -->|old-version choice| V0
    V0 -->|mapped switch back| V1

References: frontend/…/VersionSwitch.tsx• L7-22 frontend/…/VersionSwitch.tsx• L43-99 frontend/…/VersionSwitch.tsx• L108-137 frontend/…/entries.ts• L1-48 frontend/…/V1App.tsx• L20-43 frontend/…/README.md• L163-207

Access control

PersistentLogin checks the browser session before it releases the v0 route tree. RequireGuest limits guest-only pages. RequireAuth protects the organization tree and handles login, organization, onboarding, product, and review redirects. RequireAdmin checks the current backend role again before administrator content renders.

Guest routing keeps public paths available to signed-out users and sends signed-in users to the correct product home, onboarding, or review area. A product whose home belongs to another application uses a real browser navigation. An absent or invalid external destination produces no intermediate page and does not navigate to an invented URL. Relative paths served by a shared host remain valid external destinations for this purpose.

Menu visibility improves navigation, but route guards remain the access boundary. Resource ownership adds a second boundary inside a valid route, so shared users can see collaboration context while owner-only changes stay disabled or read-only.

References: frontend/…/PersistentLogin.jsx• L26-89 frontend/…/RequireGuest.jsx• L22-133 frontend/…/ExternalRedirect.jsx• L4-57 frontend/…/RequireAuth.jsx• L32-100 frontend/…/RequireAdmin.jsx• L9-61 frontend/…/resourceAccess.js• L1-23

Route loading

Large pages and optional product modules use lazy loading. Shared suspense boundaries show a loading surface during the transition. Error boundaries turn route or chunk failures into a visible recovery screen and reset route errors when the path changes.

Optional plugin entries load only when navigation needs them. An absent plugin behaves like a normal not-found result unless a shipped product-specific route can explain that the product is unavailable. A shipped plugin that fails to load remains a visible route-load error. The v1 boundary applies the same recovery goal to its page tree without unmounting the whole application.

References: frontend/…/Router.jsx• L24-45 frontend/…/Router.jsx• L101-112 frontend/…/pluginRegistry.js• L5-57 frontend/…/LazyOutlet.jsx• L23-91 frontend/…/VersionSwitch.tsx• L43-84

Session lifecycle

Session state controls which route tree and organization context the user can use. A normal logout clears session state, analytics identity, cookies, and browser data before leaving for the backend or identity provider. An expired session clears user data and dashboard metrics in the current tab before the app returns to an unauthenticated path.

Open tabs receive a sign-out message. They clear session storage and sign out or reload according to whether the message is current or stale. UI preferences such as theme, sidebar state, product choice, and the per-user old-version choice survive this cleanup; session and business data do not.

References: frontend/…/useLogout.js• L9-29 frontend/…/useUserSession.js• L15-41 frontend/…/browserStorage.ts• L4-14 frontend/…/browserStorage.ts• L48-106 frontend/…/browserStorage.ts• L108-160 frontend/…/session.ts• L29-44

Shared UI concerns

Shared UI components establish the visual and interaction rules that make different feature areas feel like one product. They provide page frames, navigation, resource lists, schema-driven forms, dialogs, notifications, loading states, and failure states. Feature pages pass their data and actions into these components instead of rebuilding the same interaction model.

The authenticated page frame combines a top bar, a collapsible side bar, a route outlet, and a persistent log and notification area. The side bar groups capabilities into Build, Manage, and Settings. It adds review, product, subscription, or plugin entries when the session and product allow them.

The top bar carries product identity and session controls. It shows the active organization beside the avatar and gives users access to the profile menu, organization switcher, login or logout action, and eligible plan or administration links. Workflow and Prompt Studio use narrower tool frames for back navigation, identity editing, search, sharing, export, and deployment actions.

References: frontend/…/PageLayout.jsx• L35-65 frontend/…/TopNavBar.jsx• L143-200 frontend/…/TopNavBar.jsx• L233-339 frontend/…/TopNavBar.jsx• L453-493 frontend/…/TopNavBar.css• L28-56 frontend/…/TopNavBar.css• L123-140 frontend/…/SideNavBar.jsx• L97-184 frontend/…/MenuLayout.jsx• L20-153 frontend/…/ToolNavBar.jsx• L14-140

Resource lists

Resource lists give users a shared way to find and manage platform objects. The list model covers search, sort, pagination, loading, empty results, retryable errors, row actions, sharing, co-owner work, identifier copying, and deletion. The parent feature owns the server request while shared list controls preserve the current view.

Resource tables keep owner identity and action availability consistent across workflows, tools, connectors, deployments, and adapter profiles. List pages can return from logs or detail screens to the right resource context. Co-owner edits stay staged until the user applies them, so partial success can be reported without losing the remaining changes.

References: frontend/…/usePaginatedList.js• L16-210 frontend/…/ResourceTable.jsx• L125-176 frontend/…/ResourceTable.jsx• L283-385 frontend/…/DataTable.jsx• L313-431 frontend/…/CoOwnerManagement.jsx• L24-101 frontend/…/useCoOwnerManagement.jsx• L57-91

Configuration forms

Configuration screens use schema-driven forms when the backend supplies a field model. A feature supplies the schema, current data, and save action. The shared form layout handles field display, validation, loading, and common errors.

Prompt Studio adds task-specific configuration around that form model. An LLM profile joins model and retrieval resources. Connector setup combines a connector with its schema and, when needed, a folder browser or review rules. OAuth state remains tied to the selected connector and is removed when the form closes. Notification setup shows only the credentials required by the selected authorization mode and keeps existing keys masked by default.

References: frontend/…/RjsfFormLayout.jsx• L34-94 frontend/…/RjsfFormLayout.jsx• L253-323 frontend/…/AddLlmProfile.jsx• L187-224 frontend/…/ConfigureConnectorModal.jsx• L307-396 frontend/…/ConfigureDs.jsx• L54-179 frontend/…/CreateNotification.jsx• L109-185 frontend/…/ReadOnlyNotice.jsx• L1-22

v1 interaction controls

The v1 UI provides one shared menu system for actions, row menus, context menus, searchable menus, and the command palette. It also provides one set of controls for checkboxes, switches, radio groups, and sliders. These controls keep keyboard use, focus behavior, names, and disabled states consistent across pages.

Text controls use the shared form field model. Labels, helper text, and errors stay tied to the control that needs them. Menus run actions; selection controls hold values. This distinction keeps a command such as “Delete” separate from a setting such as “Enable webhook.”

References: frontend/…/README.md• L1-19 frontend/…/README.md• L106-151 frontend/…/README.md• L1-22 frontend/…/README.md• L52-82 frontend/…/Label.tsx• L1-80 frontend/…/HelperText.tsx• L1-80

Compatibility controls

The v0 shared UI layer gives feature code a stable interaction contract while the product moves between component systems. Overlay, input, layout, and structure shims preserve common dialogs, menus, forms, tables, spacing, and responsive behavior for existing feature areas. v1 does not use these shims; it uses its own typed UI components and token rules.

References: frontend/…/calendar.tsx• L12-150 frontend/…/antd-inputs.tsx• L38-52 frontend/…/antd-layout.tsx• L5-24 frontend/…/antd-overlays.tsx• L50-63 frontend/…/antd-structure.tsx• L40-60 frontend/…/README.md• L27-35

Feedback surfaces

The v0 application sends request results through a shared alert store and one toast surface. Toasts can show formatted text plus a request ID or execution ID. The same messages also enter the in-app log view. A global confirmation host keeps a confirmation dialog alive when its trigger is inside a menu or other short-lived UI.

The v1 data layer reports failures centrally. A first failed read uses an inline alert with Retry. A failed refresh keeps existing data on screen and uses a toast. Mutations use a toast unless the form displays the error itself. Session expiry redirects once without adding a user-facing error, and cancelled requests produce no feedback.

References: frontend/…/App.jsx• L56-107 frontend/…/App.jsx• L122-141 frontend/…/useAppToast.jsx• L36-149 frontend/…/useConfirm.jsx• L33-95 frontend/…/query.ts• L12-67 frontend/…/QueryView.tsx• L14-61 frontend/…/README.md• L85-102

Theme and content

The v0 theme follows the session preference and the shared token set. The v1 theme is managed inside the v1 tree and stores its browser preference separately. Both trees provide light and dark presentation without using the operating system as an unseen second source of truth.

Markdown-like product content is rendered as safe styled text. Internal links keep the active organization context. External links must use an allowed URL scheme before they become browser actions. Unsupported or malformed links remain plain text.

References: frontend/…/App.jsx• L147-179 frontend/…/index.css• L1-15 frontend/…/README.md• L46-67 frontend/…/V1App.tsx• L30-42 frontend/…/CustomMarkdown.jsx• L9-123 frontend/…/urlSafety.js• L1-16

Platform operation

The UI presents the platform as a sequence of user tasks: prepare inputs and model access, build extraction logic, publish or schedule the result, then monitor or review its output. Each task has a route and a feature area. The active organization and shared state connect those tasks into one operating context.

Prompt configuration cards

Prompt cards are the per-prompt work unit inside Prompt Studio. They let users edit a prompt, choose an LLM profile, run it, inspect output, and set review or webhook options. The document parser keeps the cards connected to the active project and its saved prompt list.

Prompt execution is asynchronous. Socket results update output, progress, coverage, and indexing state only when the event belongs to the active project. A result without a payload causes a refresh rather than replacing existing output with an empty value. The project header also connects private project work to platform use through export, sharing, and API deployment actions.

This diagram shows how a prompt card connects user changes and run requests to saved project state and execution feedback.

flowchart LR
    User[User] --> Card[Prompt card]
    Card -->|edit or configure| Saved[Saved project state]
    Card -->|run| Execution[Prompt execution]
    Execution --> Feedback[Progress and output]
    Saved --> Card
    Feedback --> Card

References: frontend/…/DocumentParser.jsx• L53-150 frontend/…/PromptCard.jsx• L34-70 frontend/…/Header.jsx• L146-371 frontend/…/usePromptStudioSocket.js• L20-251 frontend/…/Header.jsx• L80-178

Workflow lifecycle

Users start with a workflow list where they can create, search, edit, share, assign co-owners, or remove workflows. The editor joins input and output setup, Prompt Studio selection, execution, and deployment work in one flow.

Opening a workflow loads its server state into the workflow context. The setup view presents connectors, the selected project, and deployment progress as related steps. A deployed workflow is treated as complete, so endpoint changes are no longer available. A run returns an execution ID and directs the user to logs while live messages keep progress current.

References: frontend/…/Workflows.jsx• L104-190 frontend/…/NewWorkflow.jsx• L10-129 frontend/…/Agency.jsx• L161-217 frontend/…/Agency.jsx• L271-369 frontend/…/SocketContext.jsx• L7-38

Platform setup

The Settings area prepares the shared resources that workflows need. It covers language models, vector databases, embeddings, text extraction, OCR, connector profiles, platform access, API keys, and organization access. Users can search, page, share, assign co-owners, copy adapter IDs, and remove resources when allowed.

Operational selectors use only non-deprecated adapters. Deprecated profiles remain visible for cleanup but do not become new choices. Organization defaults provide the baseline model, embedding, vector, and text extraction resources used by platform work.

Administrators can manage platform, deployment, and Agent-KV API keys through one shared key-management experience. Keys are masked by default and revealed or copied only on request. An Agent-KV key is shown in full after creation or rotation, while lists show only its last four characters. The key is then sent as a bearer credential when the user calls the Agent-KV extraction service. Shared users may read some deployment keys but cannot change their lifecycle.

References: frontend/…/ToolSettings.jsx• L132-239 frontend/…/DefaultTriad.jsx• L32-117 frontend/…/AgentKvKeys.jsx• L5-35 frontend/…/ApiKeyManager.jsx• L50-65 frontend/…/ApiKeyManager.jsx• L84-121 frontend/…/ApiKeyManager.jsx• L195-243 frontend/…/ManageKeys.jsx• L23-75 frontend/…/AdapterSelectionModal.jsx• L42-80 frontend/…/ConnectorsPage.jsx• L28-101 frontend/…/GetStaticData.js• L383-395

Deployment management

Deployment screens expose workflow results through API deployments, ETL pipelines, task pipelines, and optional app deployments. They share list and action patterns for search, paging, activation, editing, sharing, co-owner work, logs, history, keys, and notifications.

API deployments expose an endpoint and operational tools such as keys, code examples, notifications, and logs. Pipelines add schedules and show a human-readable summary before saving. Activation can remain available to a shared user, while creation, editing, deletion, and credential changes follow ownership rules.

This diagram shows how a configured workflow becomes an operational resource.

flowchart LR
    Config[Configured workflow] --> Choice[Valid deployment choice]
    Choice --> API[API deployment]
    Choice --> Pipeline[Scheduled pipeline]
    API --> Operate[Keys, endpoint, code, notifications, and logs]
    Pipeline --> Operate
    Operate --> Review[Run status and execution details]

References: frontend/…/Agency.jsx• L161-217 frontend/…/ApiDeployment.jsx• L38-197 frontend/…/DisplayCode.jsx• L13-185 frontend/…/Pipelines.jsx• L43-199 frontend/…/CreateNotification.jsx• L61-237

Metrics dashboard

The metrics dashboard gives users a view of platform activity after workflows or API deployments run. It combines a date-scoped overview, fixed 30-day activity views, recent activity, usage by deployment, and optional subscription content.

The browser keeps dashboard responses in per-tab session storage for short periods that match the server cache policy. A cache key includes the endpoint and request parameters. Expired entries are removed, manual refresh can clear them, and logout or an expired session clears the metrics cache so one user cannot inherit another user's business data.

References: frontend/…/MetricsDashboard.jsx• L95-339 frontend/…/metricsCache.js• L1-22 frontend/…/metricsCache.js• L24-101 frontend/…/metricsCache.js• L104-143 frontend/…/useUserSession.js• L25-32

Organization operation

The organization switcher gives users one place to change the account that supplies projects, workflows, deployments, members, logs, and plan context. It loads the organization list when opened, supports search, and asks for confirmation before replacing the current product context.

In the v0 top bar, the active organization appears beside the avatar. Its organization menu stays open while the user chooses another organization and supports both pointer and keyboard selection. Selecting the current organization reports the condition instead of starting a switch.

Some deployments change the current organization in the existing session. Others start a silent login that names the target organization so the identity provider creates the next session in that context. A full navigation clears the old organization state before the new one loads. If access disappeared or the session ended, the switcher reports the reason and reloads the relevant context.

The v1 services use the active organization to build organization-scoped resource paths. The v1 switcher keeps list failures, access removal, request IDs, and focus return inside the same user flow.

References: frontend/…/TopNavBar.jsx• L236-287 frontend/…/TopNavBar.jsx• L317-343 frontend/…/TopNavBar.jsx• L453-493 frontend/…/TopNavBar.css• L28-56 frontend/…/TopNavBar.css• L123-140 frontend/…/TopNavBar.test.jsx• L92-179 frontend/…/TopNavBar.test.jsx• L182-255 frontend/…/OrganizationSwitcher.tsx• L39-115 frontend/…/OrganizationSwitcher.tsx• L148-199 frontend/…/OrganizationSwitcher.tsx• L280-457 frontend/…/organizations.ts• L6-93 frontend/…/context.ts• L3-43 frontend/…/http.ts• L15-28

v1 server data

The v1 service layer is the one path from a v1 page to the backend. Resource modules define typed reads and writes. The shared HTTP client adds request identity and same-origin CSRF protection, converts failures to a common API error, and sends the user to sign-in once when the session expires.

TanStack Query keeps server state in one client for the v1 tree. Reads retry only transient failures. Mutations do not retry. Paged lists keep the prior page while the next page loads, but do not reuse data across organizations or filters. This gives configuration screens stable data while a user changes search, page, or organization.

References: frontend/…/query.ts• L12-67 frontend/…/README.md• L1-16 frontend/…/README.md• L58-102 frontend/…/http.ts• L64-101 frontend/…/adapters.ts• L49-99

Change checklist

When these files or sections are changed, remember to consider these:

  • Route paths in Router.jsx, useMainAppRoutes.jsx, and the v1 registry must stay aligned with side-bar paths, organization parsing, product wrappers, and v0-to-v1 mappings.
  • A new administrator or reviewer screen must update both menu visibility and the matching route guard. Hiding a menu item is not an access boundary.
  • Guest redirects must keep the selected product's home type aligned with the router. Homes served by another application must use safe real browser navigation.
  • Login, logout, session expiry, and cross-tab sign-out must clear user data before navigation while preserving only the documented UI preferences.
  • Theme changes must keep v0 session state, the v0 document class, and v1's separate theme preference from becoming competing sources of truth.
  • The v0 top bar must keep the displayed organization, organization list, confirmation step, pointer behavior, and keyboard behavior aligned with the session's active organization.
  • v1 service query keys must keep organization identity and request filters aligned. A list change must not show stale rows from another organization or filter.
  • v1 service changes must keep backend URLs inside services, typed response contracts beside their query options, and session-expiry handling on the shared HTTP path.
  • Query and notification changes must preserve the distinction between first-read errors, failed refreshes, mutation errors, session expiry, and cancellation.
  • A v1 page must remain reachable only through the registry and must mount its own providers, toaster, and error boundary rather than relying on v0 internals.
  • A v1 control change must preserve its accessible name, focus behavior, value shape, and keyboard contract across menu, toggle, and form consumers.
  • A workflow endpoint change must update deployment choices, progress state, endpoint lock, and deployment information shown in the editor.
  • Schema or widget changes must preserve non-visible instance data that the backend needs during an edit. Connector settings and changed review rules must remain on one save path.
  • Prompt card changes must keep prompt identity, selected document, profile, delayed saves, execution gates, and asynchronous output updates aligned.
  • Adapter filtering must keep deprecated entries out of new profile and import choices while preserving visibility of a current deprecated default.
  • Agent-KV key management must keep the organization-scoped settings resource separate from the public extraction service. Creation and rotation must preserve the full-key reveal contract, while list views must continue to show only the last four characters.
  • Metrics cache changes must keep keys scoped to request parameters and must preserve cleanup on logout and expired sessions.

Important failure modes

TriggerConsequenceGuard
A separate product home is treated as a local route.The user lands on this app's fallback instead of the selected product.RequireGuest resolves external product homes first and ExternalRedirect uses safe browser navigation.
An external destination is missing or malformed.The browser can leave for an invalid address or show a misleading intermediate page.ExternalRedirect accepts only HTTP(S) or safe root-relative addresses and renders nothing otherwise.
A v1 page is declared but not registered, or its v0 mapping is wrong.Users stay on v0 or a version switch sends them to the wrong screen.The registry and VersionSwitch resolve only registered entries and test both mapping directions.
A v1 request has no organization context.Resource queries cannot build a valid path or may fail before the page can render.Session setup sets the organization before org-scoped services run.
A v1 query key omits its organization or filter.Cached rows from another account or view appear in the current screen.Service query keys include organization and request parameters.
A refresh fails after data is visible.The screen can replace useful data with an error or duplicate toasts.createQueryClient keeps data visible and reports the refresh once.
A session ends in one tab while another tab stays open.The second tab can expose stale user data.Browser storage cleanup broadcasts sign-out and clears session data in other tabs.
A v1 lazy chunk fails after a deployment.The selected page cannot render.The v1 boundary reloads once for a stale chunk and shows a recovery action after repeat failure.
A shared user reaches an owner-only edit action.The UI can report a change that the user cannot make.Ownership checks disable or explain the action, while the backend remains authoritative.
A nested organization menu handles the click as a selection of its parent profile row.The profile menu closes and removes the organization list before the user can choose an organization.The top-bar organization trigger stops parent-menu propagation, and pointer and keyboard selection are covered together.
An Agent-KV key is sent to the settings resource instead of the extraction service, or its full value is treated as ordinary list data.Extraction calls fail, or a secret can be exposed in a list view.Keep management organization-scoped and session-authenticated. Use the bearer key for extraction and reveal the full value only after creation, rotation, or an explicit copy action.
A dashboard cache survives logout or session expiry.A later user can see the previous organization's metrics.Metrics use per-tab session storage and are cleared by logout and expired-session paths.

Key files

FileWhy to read it
frontend/…/App.jsxGlobal providers, theme synchronization, toast surface, confirmation host, and cross-tab sign-out hookup.
frontend/…/Router.jsxPublic, protected, marketplace, plugin, version, loading, and error route boundaries.
frontend/…/useMainAppRoutes.jsxOrganization-scoped product route structure and administrator boundaries.
frontend/…/README.mdv1 source boundary, UI rules, data-layer rules, version registry, and folder roles.
frontend/…/VersionSwitch.tsxv0/v1 selection, old-version preference, lazy loading, and v1 recovery boundary.
frontend/…/V1App.tsxv1 providers, route rendering, query client, theme, and toaster.
frontend/…/README.mdv1 service contract, typed data flow, query keys, and error presentation.
frontend/…/http.tsOrganization paths, request IDs, CSRF handling, and session-expiry behavior.
frontend/…/OrganizationSwitcher.tsxOrganization discovery, confirmation, switching modes, and failure recovery.
frontend/…/TopNavBar.jsxProduct-aware top bar, active organization display, profile actions, and organization switching.
frontend/…/TopNavBar.test.jsxPointer and keyboard organization-menu behavior, current-organization feedback, and switching contracts.
frontend/…/SideNavBar.jsxCapability grouping and role, product, subscription, and plugin-aware navigation.
frontend/…/AgentKvKeys.jsxOrganization-level Agent-KV key entry point and the credential-use guidance shown to administrators.
frontend/…/ApiKeyManager.jsxShared key list and create, edit, rotate, delete, and copy behavior used by API key settings.
frontend/…/ResourceTable.jsxShared resource list, ownership display, identifiers, actions, and row navigation.
frontend/…/RjsfFormLayout.jsxShared schema-driven configuration form behavior.
frontend/…/Agency.jsxWorkflow setup, execution, progress, live feedback, and deployment choices.
frontend/…/PromptCard.jsxPrompt editing, execution, feedback, and output state.
frontend/…/ApiDeployment.jsxAPI deployment list and operational actions.
frontend/…/MetricsDashboard.jsxActivity views, date ranges, refresh behavior, and empty-state guidance.
frontend/…/metricsCache.jsDashboard cache scope, expiry, and cleanup rules.
frontend/…/README.mdShared v1 action and command menu model.
frontend/…/README.mdShared v1 checkbox, switch, radio, and slider model.