Introducing a new way to review your PRs.

Read the announcement

capsoftware / cap

Open source Loom alternative. Beautiful, shareable screen recordings.

View on GitHub

31 documents · Updated Nov 23, 2026

docs / web-application-routes

Web application routes and components

The web application is Cap's browser product. Its routes move people from public product pages and account access to workspace media, sharing, review, editing, support, billing, and developer media delivery. Page shells, client views, server actions, and API boundaries join these journeys to the account, billing, media, and policy services described in Web API and domain services. The wider product model is described in Web product and collaborative workspace, while developer and agent views are covered in Developer infrastructure platform and Infrastructure MCP tooling.

Route organization

The route tree separates public pages, account pages, workspace pages, media views, the Cap Infra console, and external client contracts. Server routes establish identity, access, and initial data first. Client components keep active work responsive while a person records, watches, edits, selects, purchases, transcribes, or asks for help.

Route groups and shells

The root shell provides the document, shared styles, theme setup, and optional product analytics. Public pages add site navigation and footer content. Organization pages add account and session state. The dashboard shell adds the active organization, spaces, uploads, navigation, presence, permission-aware workspace state, pending-invite routing, onboarding checks, and an optional passkey prompt. Public purchase pages use a smaller provider set so they can collect plan intent before sign-in. Cap Infra uses separate public and signed-in shells because it has its own product surface and app navigation.

Shared providers expose session, query, billing, toast, purchase, public-auth, and analytics state only to the routes that need them. This keeps public pages light while preserving one shared state model for the signed-in product.

References: apps/…/layout.tsx• L75-118 apps/…/layout.tsx• L8-21 apps/…/layout.tsx• L6-14 apps/…/AppProviders.tsx• L16-57 apps/…/PublicPageProviders.tsx• L8-21 apps/…/layout.tsx• L46-143 apps/…/layout.tsx• L1-15 apps/…/layout.tsx• L14-39

Route families

Each route family serves a different product job and viewer type. Public visitors, workspace members, Cap viewers, native clients, developers, and external agents therefore enter through different boundaries even when they use the same media and access rules.

Route familyProduct jobTypical viewer
/, /(site), and /blackfridayExplain Cap, show plans, provide downloads, tools, help, updates, blog posts, seasonal offers, documentation, and public contentPublic visitor
/checkout and /checkout/completeStart, confirm, and recover a Cap Pro purchaseGuest or signed-in purchaser
/(org)/login, /(org)/signup, /verify-otpCreate or restore an account through email, passkey, OAuth, or SSONew or returning user
/(org)/onboarding and /(org)/inviteSet up an organization or accept membershipAuthenticated user joining a workspace
/(org)/dashboardManage Caps, folders, spaces, settings, billing, imports, referrals, support, and allowed developer accessWorkspace member
/infraExplain Cap Infra and its prepaid media serviceDeveloper or public visitor
/dashboard/infraCreate and manage developer apps, keys, videos, transcripts, usage, webhooks, domains, and prepaid billingApproved developer
/dashboard/developers/*Preserve old developer links by sending them to the matching Cap Infra pageExisting developer
/api/*, /api/mobile/*, /api/v1/*, and /api/developer/*Serve browser, mobile, agent, developer, and approved external clientsNative client, developer, or integration
/.well-known/*, /openapi.json, /mcp/authorize, and /api/mcp*Describe and connect approved external agents to CapAgent client and signed-in user
/s/[videoId]Watch and discuss one CapPublic or signed-in viewer
/c/[id]Browse a public collection of Caps and foldersCollection viewer
/embed/[videoId], /dev/[videoId], and /dev/[playbackId]Play a Cap or developer video inside another product or SDK flowExternal site or integration
/download/*, /cli/*, /messenger/*, and /redeemDistribute clients, deliver download links, redeem licenses, and connect support or terminal accessNew or existing user

The Cap Infra console is app-scoped. /dashboard/infra selects the most recent or remembered app, while /dashboard/infra/[appId] keeps videos, audio, usage, billing, API keys, webhooks, allowed embed sites, and settings under one app. The old developer dashboard does not own a second product model. Its catch-all route maps old sections to these app-scoped destinations.

References: apps/…/page.tsx• L1-12 apps/…/Items.tsx• L71-143 apps/…/page.tsx• L1-53 apps/…/page.tsx• L1-20 apps/…/page.tsx• L50-68 apps/…/page.tsx• L15-49 apps/…/page.tsx• L9-35 apps/…/route.ts• L1-9 apps/…/page.tsx• L1

Public product surfaces

Marketing pages turn interest in Cap into a next step such as recording, downloading a client, reading product information, or starting a purchase. The download page reports whether the current native desktop release is live. Feature pages explain recording modes such as Instant Mode, where upload runs during recording so a share link is ready when recording stops.

Public tools provide browser-only paths for media work. Format converters turn AVI, MOV, WebM, or MP4 files into a chosen output without sending the source to Cap. The Loom downloader resolves public Loom links for direct MP4 download and points workspace owners to the separate migration path. Pricing presents Cap Pro, the desktop license, and other self-serve choices through plan controls that lead into checkout.

The public surface also carries use-case and search pages, student offers, storage guides, feature explanations, help links, comparison content, download completion, license redemption, open-source community links, Cap Infra education, and Infra articles. A seasonal /blackfriday page uses the public provider set and adds a time-limited Pro offer that opens yearly checkout with a promotion code while the offer is active. The sitemap discovers physical public pages and combines them with blog, documentation, changelog, and SEO registry routes while excluding private or operational paths.

References: apps/…/page.tsx• L8-59 apps/…/page.tsx• L5-18 apps/…/page.tsx• L154-228 apps/…/page.tsx• L154-228 apps/…/page.tsx• L145-220 apps/…/page.tsx• L155-230 apps/…/page.tsx• L64-180 apps/…/Header.tsx• L111-217 apps/…/index.tsx• L10-30 apps/…/page.tsx• L4-32 apps/…/sitemap.ts• L12-34

Documentation and support

The documentation route turns stored MDX into a browsable product guide. It gives readers metadata, headings, code blocks, breadcrumbs, a table of contents, and previous or next links so product knowledge forms one navigable flow. A matching markdown route gives agents and other tools the same document content without the page shell. Cap Infra also publishes a compact markdown description for machine readers.

Support uses one conversation model in two views. The messenger widget restores a recent conversation or starts one in a compact panel. The full-page messenger route gives that conversation more room and supports agent replies, human handoff, suggested prompts, polling, and optimistic message display. Both views refresh through a no-store updates endpoint so agent or human replies can arrive without a page reload.

References: apps/…/page.tsx• L18-60 apps/…/page.tsx• L87-123 apps/…/route.ts• L5-22 apps/…/route.ts• L4-8 apps/…/docs-config.ts• L11-81 apps/…/MessengerWidget.tsx• L617-739 apps/…/ChatWindow.tsx• L132-229 apps/…/route.ts• L13-47

Product flows

The route families form one content journey. A person can create or import media, place it in a personal or shared library, publish it through a controlled link or collection, review it with others, edit eligible video Caps, buy the plan or add-on needed for team use, or deliver developer-owned media through Cap Infra.

Authentication and onboarding

Authentication supports email-code sign-in and sign-up with passkeys, Google, Apple, and available SAML or OIDC SSO paths. Google One Tap uses a short-lived server-issued nonce before the browser submits a Google credential. The shared email flow normalizes addresses, limits repeat requests, and preserves a safe return path through login and code verification.

The login flow can resume a purchase that started before account creation. The authentication boundary rate-limits email-code, passkey, and Google One Tap requests. SSO callbacks bind to a short-lived browser intent and actor. After authentication, onboarding guides the user through organization setup, optional domain setup, team invites, and download. The dashboard then checks pending invites and required profile setup before it loads the workspace. A matching invite route verifies the signed-in email before it creates membership and applies any available Pro seat.

This flow moves a person from identity proof to an organization that can own Caps and shared access.

References: apps/…/form.tsx• L61-125 apps/…/form.tsx• L262-321 apps/…/form.tsx• L43-99 apps/…/form.tsx• L76-154 apps/…/google-one-tap.ts• L60-205 apps/…/route.ts• L19-61 apps/…/route.ts• L121-225 apps/…/route.ts• L228-325 apps/…/route.ts• L40-158 apps/…/OrganizationSetupPage.tsx• L14-81 apps/…/InviteTeamPage.tsx• L19-104

Account security and identity changes

Account settings let a signed-in user manage the profile used in shared Caps, choose a default organization, change a non-managed sign-in email, manage passkeys, and revoke credentials across devices. Sensitive changes use a step-up grant: the user proves identity with a passkey or a time-limited email code before the change proceeds.

Changing an email sends a code to the new address and signs the user out of the web session after success. Passkeys can be added or removed from Account settings, and the dashboard can offer registration after sign-in when the browser supports it. The all-devices action also revokes desktop, CLI, and passkey credentials, so these controls form one account-wide security boundary rather than separate browser settings.

References: apps/…/page.tsx• L14-44 apps/…/Settings.tsx• L36-42 apps/…/Settings.tsx• L317-381 apps/…/ChangeEmail.tsx• L61-160 apps/…/Passkeys.tsx• L43-181 apps/…/VerifyIdentityDialog.tsx• L26-133 apps/…/server.ts• L91-205 apps/…/PasskeyPrompt.tsx• L27-92 apps/…/layout.tsx• L51-72

Billing and checkout

Checkout gives guests and signed-in users a controlled path to Cap Pro. A plan and seat choice becomes either an in-app purchase or a hosted payment session. Optional organization add-ons remain separate from the base Pro entitlement.

The public pricing controls and signed-in purchase controls share plan intent and return paths. This lets a new user choose a plan before account creation without losing the purchase context. Organization settings then expose plan status, seat changes, billing management, and eligible add-ons such as directory sync and a Signed BAA.

This diagram shows how a plan choice becomes an account or organization entitlement.

flowchart LR
    A[Plan or add-on choice] --> B[In-app or hosted checkout]
    B --> C[Payment event]
    C --> D[Account or organization billing state]
    D --> E[Dashboard or sign-in]

References: apps/…/page.tsx• L32-80 apps/…/page.tsx• L29-194 apps/…/checkout.ts• L83-201 apps/…/route.ts• L18-117 apps/…/route.ts• L26-161 apps/…/StripeContext.tsx• L5-31 apps/…/CommercialCard.tsx• L35-62 apps/…/ComparePlans.tsx• L240-319 apps/…/page.tsx• L8-37

Workspace dashboard

The dashboard is the signed-in control surface for the active organization. It brings together owned Caps and folders, shared spaces, notifications, account and organization settings, billing, imports, referrals, support, and the allowed Cap Infra entry point.

The navigation lets a member switch organizations, open the library, record or import media, browse spaces, reach allowed settings, and open Cap Infra when the account and deployment allow it. Dashboard search provides quick links to common work and searches Caps and screenshots. The title area adapts to folders and spaces so the current location remains visible when the search control must become compact. The notification panel filters the active organization's feed and links events back to the related share page. The shell also presents account security prompts without taking ownership of the settings flow.

References: apps/…/layout.tsx• L74-143 apps/…/Items.tsx• L71-143 apps/…/DashboardSearch.tsx• L123-201 apps/…/DashboardSearch.tsx• L283-351 apps/…/Top.tsx• L62-223 apps/…/TopBarTitle.tsx• L13-53 apps/…/index.tsx• L26-144

Personal library and shared spaces

The personal library organizes videos and screenshots into folders. Members can record, upload, import, select, delete, move, rename, share, download, duplicate, archive, and open analytics for Caps without leaving the library.

Folders can be nested, colored, reordered, moved by drag and drop, and published as collections. The library supports page-size preferences, page selection, select-all across the current view, and an archived view that removes Caps from the active library without breaking their links, comments, or existing space shares. Shared spaces and the organization collection reuse the same content model with member lists, roles, viewer rules, folders, public collection links, custom ordering, and add-video flows.

References: apps/…/caps-page-data.tsx• L134-204 apps/…/page.tsx• L4-14 apps/…/Caps.tsx• L88-157 apps/…/Caps.tsx• L289-471 apps/…/CapListHeader.tsx• L60-117 apps/…/QuickActions.tsx• L105-135 apps/…/useArchiveCaps.ts• L19-99 apps/…/useCapSelection.ts• L22-170 apps/…/SharedCaps.tsx• L203-282 apps/…/SpaceOrderSelect.tsx• L32-105

Organization management

Organization settings control the rules that shape new Caps and shared access. Managers can set viewer defaults, playback speed, AI language, email restrictions, link overrides, branding, custom domains, members, roles, Pro seats, compliance terms, billing, directory sync, and organization deletion.

Preferences make the product rules visible at workspace level. They can set private-by-default recordings, viewer features, playback speed, AI language, a default call to action, and share-page brand color. Content management also supports a reviewed transfer from an organization or space folder to a member's personal library. The settings UI keeps organization-wide rules distinct from Cap-level overrides.

References: apps/…/layout.tsx• L9-49 apps/…/page.tsx• L6-17 apps/…/DefaultVideoVisibility.tsx• L15-67 apps/…/CapSettingsCard.tsx• L282-395 apps/…/DefaultCallToAction.tsx• L32-142 apps/…/ShareableLinkBrandColor.tsx• L36-243 apps/…/ContentManagement.tsx• L83-217 apps/…/AccessEmailDomain.tsx• L9-58 apps/…/update-details.ts• L11-68 apps/…/settings.ts• L67-129

Capture and import

Capture intake gives users several ways to create a Cap. The record route can open Cap Desktop, start a browser recorder, or use a browser extension. The library accepts video and image files. Import also accepts a Loom link or a CSV for bulk Loom migration. A dashboard-wide paste listener turns supported clipboard media into an import when the user is not typing in a text control.

The file flow shows upload progress and returns to the library when the import starts. The Loom flow lets an authorized organization manager choose a destination, map source URLs to members and spaces, preview valid rows, run bounded batches, retry temporary failures, download results, and watch organization-wide import status. Larger migrations can use an agent prompt, a concierge request, or an operator queue that tracks reconciliation before completion.

References: apps/…/RecordVideoPage.tsx• L14-75 apps/…/QuickActions.tsx• L105-135 apps/…/UploadCapButton.tsx• L15-55 apps/…/ImportPage.tsx• L11-76 apps/…/ImportFilePage.tsx• L15-176 apps/…/ImportLoomPage.tsx• L297-479 apps/…/ImportLoomPage.tsx• L567-706 apps/…/LoomImportStatus.tsx• L82-171 apps/…/LoomMigrationQueue.tsx• L633-672

Analytics review

Analytics turns viewing and engagement activity into a workspace or Cap-level review surface. A member can choose an organization or space, select a time range, inspect views, comments, reactions, and created Caps, and move from a top Cap back to its share page.

The same view presents a time chart and breakdowns by place, browser, operating system, device, and top Cap. Free users see the product path to Pro instead of unrestricted analytics. The library and Cap cards link into the workspace or Cap-specific view.

References: apps/…/AnalyticsDashboard.tsx• L51-169 apps/…/Header.tsx• L81-128 apps/…/StatsChart.tsx• L38-149 apps/…/OtherStats.tsx• L137-243 apps/…/CapCardAnalytics.tsx• L15-99

Cap Infra console

Cap Infra is a separate developer product for storing, processing, transcribing, and playing videos from a site or application. It uses developer apps rather than team Caps. Each app has its own environment, secret key, media list, playback links, transcript list, credit balance, usage view, allowed embed sites, webhooks, and settings.

The console guides a first-time developer through app creation, prepaid credit, and the first upload. Later visits open the selected app and keep the same section while the developer switches apps. The console supports direct browser uploads and server-led API use. It reports processing state, refreshes changing media, and exposes HLS, MP4, poster, share, and embed links when media is ready. Embed settings can control player controls, autoplay, captions, quality, and accent color. Allowed sites limit where the player can be embedded.

Audio is a parallel app flow for turning an uploaded audio or video file into a transcript. Billing uses prepaid credits. Storage, speech-to-text, and delivered playback appear as separate usage views. A developer can add credit, claim the monthly Cap Pro credit when eligible, save a card for automatic top-up, review transactions, and configure signed webhooks for video readiness or failure.

This diagram shows the main Cap Infra lifecycle from app setup to media delivery.

flowchart LR
    A[Sign in and create app] --> B[Create key and add credit]
    B --> C[Upload or import media]
    C --> D[Process or transcribe]
    D --> E[Watch, embed, read, or receive webhook]
    E --> F[Review usage and billing]

References: apps/…/first-run.tsx• L30-181 apps/…/shell.tsx• L61-77 apps/…/page.tsx• L54-167 apps/…/video-client.tsx• L129-199 apps/…/embed-options.tsx• L18-116 apps/…/domains-section.tsx• L13-110 apps/…/webhooks-client.tsx• L124-258 apps/…/billing-view.tsx• L71-242 apps/…/page.tsx• L66-152

Share access and public collections

The share flow lets an owner choose a private audience, organization or space audience, matching-email access, or an open link when organization policy permits it. It also supports invited viewers, password protection, downloads, embed output, and share-page branding.

Folders and spaces can become public collections. A collection is a browsable page with a title, subtitle, logo choice, call to action, layout, and copy-link control. Collection controls persist small setting changes without replacing unrelated settings. Collection access can require sign-in or a password. These settings make a shared library useful for a team, course, portfolio, or customer handoff without exposing unrelated Caps.

References: apps/…/SharingDialog.tsx• L44-179 apps/…/share.ts• L31-59 apps/…/CollectionShareControl.tsx• L34-230 apps/…/CollectionShareDialog.tsx• L63-145 apps/…/page.tsx• L100-209 apps/…/page.tsx• L214-340

Playback and review

The share route is the full viewing and review experience. It resolves access policy, password state, media readiness, sharing context, and viewer permissions before it renders the player and collaboration controls. Owners can rename, share, move, configure, download, edit, duplicate, and delete a Cap.

The player supports processed MP4, HLS media, live recording segments, and raw-upload fallback. It keeps one active media state while the surrounding view changes between classic playback and a timeline. Comments, reactions, captions, transcripts, summaries, chapters, analytics, call-to-action content, downloads, and an optional up-next item stay tied to that media state. On iOS Safari, it can prepare a compatible temporary MP4 view when the source label exceeds the device's safe level but the frame size remains supported.

The timeline places timestamped text and media comments along the playback position. Desktop viewers can open a branch card and seek to its time. Mobile viewers use a dismissible bottom sheet instead of a hover card. Comments and replies can be posted optimistically, linked to a time, or recorded as media replies.

When a viewer is not signed in, comment or reply actions can open a small email-code sign-in flow without losing the share page. Viewer-facing download and access controls follow the same policy as playback.

References: apps/…/page.tsx• L381-514 apps/…/Share.tsx• L31-171 apps/…/ShareHeader.tsx• L153-209 apps/…/UpNextOverlay.tsx• L1-200 apps/…/Comments.tsx• L86-206 apps/…/TimelineBranchCard.tsx• L48-109 apps/…/TimelineMobileSheet.tsx• L23-131 apps/…/CapVideoPlayer.tsx• L267-377 apps/…/mp4-level-patch.ts• L116-255

Transcripts and AI review

The transcript surface turns timed text into a reading, caption, and review aid beside playback. It supports live text during desktop recording, canonical transcript handoff, retry states, language changes, copy, download, and time-based seeking.

AI review adds titles, summaries, and chapters when the plan and organization rules allow them. Chapters become seek targets. Owners can edit generated summary content or retry a failed generation without changing the media itself.

References: apps/…/Transcript.tsx• L128-315 apps/…/Transcript.tsx• L409-810 apps/…/Summary.tsx• L73-156 apps/…/Summary.tsx• L202-325 apps/…/route.ts• L19-99 apps/…/route.ts• L13-65

Editing and trimming

The owner edit route provides a non-destructive timeline for eligible video Caps. The editor lets an owner split clips, remove clips, trim edges, change zoom, use undo or redo, and turn transcript ranges into edit ranges when text is ready.

The editor saves a final edit description and can restore the original recording. The public trimming and conversion tools are separate: they process local media in the browser and return a download without uploading the source.

References: apps/…/EditVideoClient.tsx• L461-607 apps/…/EditVideoClient.tsx• L609-717 apps/…/EditVideoClient.tsx• L925-1057 apps/…/TrimmingTool.tsx• L99-159 apps/…/MediaFormatConverter.tsx• L1 apps/…/page.tsx• L145-220

UI components and state

The component split follows the user's time scale. Server pages prepare identity, access, and initial data. Client components own state that must remain alive while the user records, watches, edits, selects, purchases, transcribes, chats, or opens a dialog.

Shared dashboard state

The dashboard context is the shared state boundary for the workspace. It exposes the active organization, member and space views, theme, sidebar state, notifications, upgrade state, referral state, allowed Infra entry, and organization viewer settings to dashboard components.

The shell provides a desktop sidebar and mobile tabs. The header derives its title from the route, folder path, or active space. It exposes search, notifications, account actions, theme switching, sign-out, support, downloads, and upgrade actions. The notification panel filters the active organization's feed and provides keyboard-friendly navigation and a settings link without changing the surrounding dashboard. Account security prompts are mounted at this shell boundary so they can refresh the dashboard after registration.

References: apps/…/Contexts.tsx• L24-180 apps/…/DashboardContext.ts• L19-61 apps/…/DashboardInner.tsx• L6-25 apps/…/layout.tsx• L114-142 apps/…/PasskeyPrompt.tsx• L27-92 apps/…/Items.tsx• L72-141 apps/…/Top.tsx• L62-264 apps/…/FilterTabs.tsx• L13-95

Account settings components

Account settings combine profile data, organization choice, sign-in identity, passkeys, and CLI access in one security-aware surface. The page keeps failed credential-list reads visible as an error instead of presenting an empty list that could hide active credentials.

The profile and email controls use server-confirmed changes. Passkey add and remove actions use identity verification, while the dashboard prompt offers the same registration path after sign-in. CLI key actions show scoped, expiring credentials and support explicit revocation. These components connect browser settings to the account-wide credential boundary.

References: apps/…/page.tsx• L14-44 apps/…/Settings.tsx• L78-186 apps/…/ChangeEmail.tsx• L93-160 apps/…/Passkeys.tsx• L78-181 apps/…/VerifyIdentityDialog.tsx• L54-131 apps/…/server.ts• L123-205

Infra console components

Infra components form a small app console rather than an extension of the team dashboard. The shell provides app switching and section navigation for overview, videos, audio, usage, billing, keys, webhooks, and settings. Server pages load app-owned data. Client views preserve upload, polling, dialog, embed, domain, webhook, and billing state while the developer moves between sections.

The first-run view explains the separate prepaid model and reveals the secret key once. The app switcher remembers the selected app. Video views show local upload state beside server state so an interrupted upload is not confused with a processed item. Key, domain, webhook, and app settings views make credential, access, and destructive changes explicit.

References: apps/…/shell.tsx• L61-77 apps/…/shell.tsx• L79-204 apps/…/first-run.tsx• L30-181 apps/…/uploads.tsx• L71-151 apps/…/app-settings-client.tsx• L22-66 apps/…/domains-section.tsx• L13-110 apps/…/webhooks-client.tsx• L124-258

Library components

Library components group actions around content a user owns or can access. Cap cards represent videos and screenshots. Folder cards provide navigation, sorting, layout choice, colors, renaming, public links, and movement. Selection bars support bulk actions without leaving the library.

The card surface also exposes analytics, sharing, downloads, duplication, editing, thumbnails, passwords, archiving, and deletion according to ownership, plan, and current upload state. Selection and archive helpers keep optimistic movement visible while the server confirms the change. Shared status shows whether access comes from a Cap, organization, or space rule.

References: apps/…/CapCard.tsx• L175-275 apps/…/CapCard.tsx• L387-451 apps/…/CapCardContent.tsx• L61-205 apps/…/CapCardAnalytics.tsx• L27-101 apps/…/CapGridItem.tsx• L21-57 apps/…/useArchiveCaps.ts• L102-152 apps/…/useCapSelection.ts• L56-170 apps/…/CollectionShareControl.tsx• L99-230

Space components

Space components present shared media with the member, role, folder, and organization context needed for collaboration. Members can browse a space, manage its members when allowed, add or remove Caps, create folders, publish a collection, move content within the space, and choose a shared order.

The same dialog model supports organization-wide collections and folders. A space can use newest, oldest, or custom order. Custom order supports drag and keyboard movement while keeping the result visible to everyone in the space. This keeps personal placement, shared membership, and public presentation as related but separate choices.

References: apps/…/SharedCaps.tsx• L168-282 apps/…/SharedCaps.tsx• L494-740 apps/…/SpaceOrderSelect.tsx• L32-105 apps/…/MembersIndicator.tsx• L46-127 apps/…/SharedCapCard.tsx• L62-137

Playback components

Playback components coordinate media, timeline state, captions, transcript context, comments, reactions, share controls, and up-next playback around one Cap. The route supplies policy and initial data. The client view handles view changes, playback position, feedback, seeking, and readiness updates without restarting the whole page.

Source resolution separates processed media, live segments, and raw fallback. Progress boundaries distinguish fetching, upload, processing, thumbnail, error, and failed states. A stable player lets review work continue while the page changes between player, timeline, and the next item. On iOS Safari, the player can use a compatible local MP4 view when source metadata is too high for hardware playback but the video dimensions are within the safe range.

References: apps/…/Share.tsx• L222-321 apps/…/Share.tsx• L739-1201 apps/…/CapVideoPlayer.tsx• L267-377 apps/…/CapVideoPlayer.tsx• L501-588 apps/…/mp4-level-patch.ts• L142-255 apps/…/up-next-playback.ts• L1-160

Developer playback components

Developer playback components serve a video inside an external page or a direct share view. They apply the requested player options to a ready source and show a small state page while a video is uploading, processing, paused, failed, or taken down. An embed reports unavailable or paused states back to its parent page through the player event contract.

The same public playback model supports share metadata, poster images, captions, oEmbed discovery, branding, call-to-action content, and player controls. It does not expose the app console or secret credentials.

References: apps/…/page.tsx• L111-210 apps/…/page.tsx• L325-467 apps/…/EmbedVideo.tsx• L57-112 apps/…/page.tsx• L7-29 apps/…/DeveloperVideoPage.tsx• L34-95 apps/…/route.ts• L16-66

Marketing components

Marketing components turn product claims into guided actions. The home hero connects recording modes, downloads, Chrome capture, migration, and Cap Pro. Pricing controls connect plan, license, seat, and billing choices to checkout. Feature, comparison, SEO, student, storage, Infra, conversion, downloader, and redemption pages explain why a visitor should move into the product.

References: apps/…/Header.tsx• L115-217 apps/…/CommercialCard.tsx• L21-62 apps/…/ComparePlans.tsx• L345-501 apps/…/DownloadPage.tsx• L1 apps/…/ToolsPageTemplate.tsx• L1 apps/…/page.tsx• L64-180

Public media components

Public media components show a Cap or collection without exposing dashboard controls. Public Cap cards show the title, owner, relative date, thumbnail, lock state, comments, and reactions. Collection pages add folders, layout, branding, access states, pagination, and a link-copy action.

References: apps/…/PublicCapCard.tsx• L59-163 apps/…/CollectionCopyLinkButton.tsx• L8-27 apps/…/page.tsx• L148-209 apps/…/page.tsx• L274-340

Actions and route boundaries

The web UI changes product state through server actions, route handlers, RPC clients, and shared API clients. These boundaries connect browser events to the data, billing, media, storage, and policy services described in Web API and domain services.

Server actions

Server actions handle focused mutations that begin in a page or component. Video actions update titles, dates, settings, passwords, viewer grants, downloads, sharing, archive state, and collection settings. Organization actions update settings, details, branding, members, domains, billing, seats, content transfers, and compliance add-ons. Account actions update profile data, create or revoke scoped CLI keys, change sign-in identity, register or remove passkeys, and revoke all credentials. Developer actions create and manage Infra apps, keys, domains, videos, transcripts, credit, auto top-up, and webhooks.

The key boundary is permission at the time of the change. A client control can request a mutation, but the server action checks the current user, organization or app owner, role, plan, credit state, and resource before it changes shared state. Sensitive account changes also require a recent identity grant.

References: apps/…/share.ts• L31-59 apps/…/settings.ts• L27-79 apps/…/settings.ts• L67-129 apps/…/server.ts• L35-89 apps/…/server.ts• L123-205 apps/…/create-app.ts• L24-91 apps/…/webhooks.ts• L1-180

API authentication and access

API middleware separates browser sessions, auth API keys, developer app keys, mobile bearer access, and agent access. Protected handlers reject unauthenticated requests before business work. Versioned and agent APIs add scoped capabilities for reading, commenting, writing, processing, deleting, storage management, organization management, developer video delivery, and audio transcription.

The mobile boundary provides account sign-in, organization, space, folder, Cap, upload, comment, notification, push-token, profile, analytics, and settings contracts. It also handles mobile email verification, account deletion, notification preferences, and revalidation of web views after shared changes. The versioned boundary serves agent operations with stable request IDs and mapped errors. Browser media routes protect thumbnails, storage objects, playlists, and generated social images with the same viewing and ownership rules as page routes. These boundaries map policy and domain failures into stable client responses.

References: apps/…/utils.ts• L94-220 apps/…/route.ts• L121-225 apps/…/route.ts• L25-61 apps/…/route.ts• L574-685 apps/…/route.ts• L687-706 apps/…/route.ts• L768-794 apps/…/route.ts• L508-539 apps/…/route.ts• L818-988 apps/…/route.ts• L20-69 apps/…/route.ts• L168-229 apps/…/route.ts• L1-9

Upload and media routes

Upload routes turn an owned Cap or developer video into storage targets and then into a ready media source. Single-part and multipart clients upload recording files, raw media, reuploads, comment media, and supported child assets. Multipart completion checks ownership, part integrity, recording duration rules, and replacement identity before it publishes the object. Completion then records media metadata, clears pending state when appropriate, and starts processing or transcription.

Playback routes return signed media, HLS playlists, live segment status, captions, thumbnails, raw previews, or developer playback files only after the request has passed the relevant viewing, app, credit, or storage checks. The storage object route supports range reads and safe download headers. The playlist route also exposes live and early playback states so a viewer can follow a recording while it is still becoming ready.

This diagram shows the normal recording path from client upload to playback readiness.

flowchart LR
    A[Create or select Cap] --> B[Request upload target]
    B --> C[Upload parts or object]
    C --> D[Complete and verify upload]
    D --> E[Process or finalize recording]
    E --> F[Ready playback and transcript]

References: apps/…/multipart.ts• L89-229 apps/…/multipart.ts• L420-585 apps/…/recording-complete.ts• L20-101 apps/…/route.ts• L62-147 apps/…/route.ts• L7-27 apps/…/route.ts• L63-141 apps/…/route.ts• L168-229

Native and developer client routes

The mobile route is a broad client boundary for account access, profiles, organization settings, folders, spaces, Caps, upload status, comments, notifications, push tokens, analytics, and video access. The desktop route supports sign-in handoff, recording, upload progress, deletion, and storage integrations.

The developer API supports app-owned video creation and import, upload tokens, multipart upload, status, deletion, usage, transactions, transcripts, and webhooks. The CLI authorization page lets a signed-in user approve a bounded set of library, profile, organization, billing, or developer scopes. The MCP authorization action provides the equivalent approval step for an MCP client. These routes keep native clients and developer integrations independent from browser page behavior while preserving the same ownership, media, access, and billing rules.

References: apps/…/route.ts• L574-685 apps/…/route.ts• L731-867 apps/…/route.ts• L1570-1595 apps/…/session.ts• L19-83 apps/…/video.ts• L65-117 apps/…/videos.ts• L101-209 apps/…/upload.ts• L22-161 apps/…/page.tsx• L54-133 apps/…/actions.ts• L12-49

External billing routes

Billing route handlers create checkout sessions for Cap plans, organization add-ons, commercial licenses, developer credits, and saved cards. Payment events remain the source of truth that turns settled payment into Pro access, seat quota, add-on state, or developer credit balance.

Developer billing is separate from Cap Pro billing. The Infra console draws media charges from an app credit account. Organization settings continue to manage Cap Pro seats and add-ons through the account's billing customer.

References: apps/…/root.ts• L561-705 apps/…/route.ts• L17-140 apps/…/route.ts• L38-113 apps/…/route.ts• L469-575 apps/…/top-up.tsx• L25-84

Developer media contracts

The developer media routes expose the Cap Infra lifecycle to external applications. A secret-key API can create or import videos, issue browser upload tokens, read processing and playback state, request transcripts, inspect usage, and manage webhook endpoints. The console uses the same app ownership model through browser actions.

Webhooks notify an external server when a video reaches a ready or failed state. Endpoint secrets are shown only at creation or rotation. oEmbed describes a public developer video to tools that discover an embeddable player. Public playback routes then provide the player, share metadata, captions, and parent-page error events without exposing the app's private data.

References: apps/…/videos.ts• L109-239 apps/…/transcripts.ts• L61-95 apps/…/webhooks.ts• L33-131 apps/…/route.ts• L23-66 apps/…/DeveloperVideoPage.tsx• L140-217 apps/…/EmbedError.tsx• L26-41

Agent discovery and markdown routes

Discovery routes let an external client learn which Cap contract to use before it sends an authenticated request. The API catalog and OpenAPI document describe developer contracts. Infra MCP discovery publishes a server card, while the MCP route accepts the app secret key as a bearer credential rather than OAuth. The authorization page can still ask a user to approve an MCP client's requested access.

Markdown routes provide machine-readable versions of product and API documentation. They complement the rendered docs pages and keep agents from depending on page markup.

References: apps/…/route.ts• L1-3 apps/…/route.ts• L1-4 apps/…/route.ts• L3-15 apps/…/route.ts• L11-37 apps/…/actions.ts• L12-49 apps/…/route.ts• L1-3 apps/…/route.ts• L1-3 apps/…/route.ts• L5-22

Middleware and instrumentation

Request middleware and startup instrumentation protect the route boundary and make the web process observable. They run before or beside page rendering, so one decision can affect many routes.

Request proxy

The request proxy applies cross-route decisions before page rendering. It redirects signed-in visitors from the public root to the dashboard, sets frame policy for login, handles share-page iframe redirects, restricts self-hosted route exposure, and routes verified custom domains to share or collection pages. Its matcher leaves APIs and static assets to their own boundaries.

References: apps/…/proxy.ts• L24-137

Startup instrumentation

The instrumentation entry point registers OpenTelemetry traces when configured. In the Node runtime it also starts self-hosting work such as delayed database migration and storage setup. Migration failure retries and then stops the process after the retry limit, so schema and storage readiness are part of startup.

References: apps/…/instrumentation.ts• L1-25 apps/…/instrumentation.node.ts• L14-101

Global error boundary

The global error boundary is the last UI path for an uncaught application error. It reports the exception to Sentry and returns a small error document instead of leaving the user on a broken route.

References: apps/…/global-error.tsx• L7-23

Change checklist

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

  • Changes to route groups or layouts must preserve the provider, navigation, upload, organization, and account-security state assumptions of every child route.
  • Changes to authentication must preserve email normalization, passkey step-up grants, Google One Tap nonce use, SSO intent binding, mobile-provider handoff, safe return paths, and JSON versus redirect error responses.
  • Changes to account identity must preserve managed-email rules, email-code cooldowns, sign-out behavior, passkey identity guarantees, CLI key scope and expiry, and all-device credential revocation.
  • Changes to invite acceptance must preserve email matching, role normalization, Pro-seat assignment, active-organization selection, and the post-transaction sync.
  • Changes to Cap access rules must stay aligned across /s/[videoId], /embed/[videoId], /c/[id], custom domains, invited viewer grants, password verification, collection access, mobile access, and agent operations.
  • Changes to upload phases or source types must preserve pending states in the library, share page, embed page, desktop client, mobile client, playlist resources, developer playback, and media-server callbacks.
  • Changes to Infra app ownership or app selection must preserve the signed-in preview gate, app cookie selection, legacy developer redirects, app-scoped routes, and API ownership checks.
  • Changes to developer keys, upload tokens, embed origins, or webhook contracts must preserve one-time secret reveal, server-only key use, short-lived browser credentials, app ownership, allowed-origin checks, signature verification, and client error shapes.
  • Changes to CLI or MCP authorization must preserve request validation, redirect URI checks, PKCE binding, requested scopes, state propagation, rate limits, and session-version invalidation.
  • Changes to playback source selection must preserve processed media, live media, raw fallback, iOS compatibility handling, signed URL refresh, playback position, and object URL cleanup.
  • Changes to public tools or download pages must preserve local-only processing claims, canonical metadata, structured data, release-state messaging, and the link from one-off Loom downloads to the workspace migration path.
  • Changes to native client routes must preserve email verification and account-deletion gates, organization fallback, bearer or API-key rules, upload status shapes, push-token limits, notification preference mapping, and web-page revalidation.
  • Changes to checkout entry points must preserve the split between in-app web checkout and hosted Stripe checkout, guest versus signed-in access, plan and seat validation, referral or promotion precedence, and onboarding return paths.
  • Changes to transcript, chapter, comment-media, or waveform data must preserve timed captions, media-comment quotas, chapter ranges, transcript-driven edits, and stable timeline display.
  • Changes to proxy matching or custom-domain rules must preserve share links while keeping APIs, markdown routes, and static assets outside the page proxy.
  • Changes to self-hosting startup must preserve the relationship between database migrations, storage setup, trace registration, and process readiness.

Important failure modes

TriggerConsequenceGuard
A share page, embed, collection, mobile route, or agent route skips access policyMedia or metadata can reach a viewer outside the owner's chosen audienceResolve viewing policy before page data, playback, or API data is returned
A public-link change ignores the organization email rule or overrideA link can become open to the wrong audienceOrganization policy and link choice are checked together before the share write
A passkey, email change, or key revocation skips recent identity proofA signed-in session can change the account's future access methods without the account ownerRequire a passkey or email-code step-up grant for sensitive account changes
A managed organization email is changed through the account pageThe user's sign-in identity can leave the organization's controlResolve managed-email status before showing or accepting the change
A Google One Tap credential is accepted without a matching nonceA credential from another browser flow can be replayed at the auth boundaryIssue a no-store nonce and consume it during the credential callback
An invite is accepted by a different email or twiceMembership or a Pro seat can be assigned to the wrong personLock the pending invite, compare normalized emails, and commit membership in one transaction
A live source has no playable segment or its signed URL expiresThe viewer sees a stalled or unavailable recordingPlayers separate readiness from playback and show a recovery state
A processed source is unavailable but raw fallback is not checkedA playable upload appears brokenSource resolution probes the processed source and then a supported raw source
The share player remounts during a view changePlayback and in-progress review work can resetThe media stage stays mounted while presentation state changes around it
An iOS MP4 label is patched for a video whose frames exceed the safe sizeThe browser may still fail to decode the source or show invalid playbackPatch only sources whose probe shows a supported frame size and otherwise use normal fallback
An archived Cap is counted as active or excluded from the archived viewLibrary counts, pagination, and bulk actions disagree with the visible listThe page separates active and archived views while preserving links and shared entries
An Infra app is opened by a signed-out user, an unapproved preview user, or a different app ownerApp data, keys, or media can be exposed or a valid user can receive a misleading pageThe route group and every app action require the signed-in approved owner
An embed origin is added without exact-origin validationAn unrelated site can use the player or a valid site is blockedDomains are normalized before storage and checked at embed time
A developer key is regenerated without switching the callerAPI requests fail immediately and browser uploads cannot startThe UI warns that the old key stops at once and reveals the new key only once
A changing developer video is not refreshed or a stalled job is not redrivenThe console keeps showing a stale state or a ready video never gains playback linksVideo reads redrive eligible work and live views refresh while state changes
A mobile or agent request uses an invalid token or inaccessible organizationThe client receives data outside its workspace or an unstable errorClient boundaries check identity, membership, scope, storage access, and mapped errors
A checkout accepts an unknown plan or unsafe seat countThe payment provider receives an invalid purchase requestBilling routes validate plan IDs and normalize quantity
A thumbnail, object, playlist, or OG route skips the same view gate as the pagePrivate media or metadata can leak through a supporting resourceMedia helpers apply policy before signing or returning the resource
A custom-domain request is not verifiedThe request reaches the wrong host or returns the wrong pageThe proxy checks domain verification before allowing share or collection routes
Self-hosted migration retries are exhaustedThe Node process exits instead of serving an unknown schemaStartup instrumentation retries migration and fails the process after the limit
An uncaught error reaches the app boundaryThe route cannot render its normal responseThe global boundary reports the exception and returns a minimal error document

Key files

FileWhy to read it
apps/…/layout.tsxShows the document shell, theme bootstrap, and analytics boundary.
apps/…/AppProviders.tsxShows the shared auth, session, billing, public environment, query, toast, and purchase state.
apps/…/layout.tsxShows dashboard access checks, pending-invite and onboarding redirects, passkey prompting, and data passed into the workspace shell.
apps/…/Contexts.tsxShows how organization, space, theme, navigation, upgrade, and Infra entry state reach client components.
apps/…/Items.tsxShows organization switching, route navigation, spaces, role-aware dashboard links, and Infra visibility.
apps/…/page.tsxShows the account settings composition and safe handling of failed credential reads.
apps/…/Settings.tsxShows profile, default-organization, email, and all-device security actions.
apps/…/Passkeys.tsxShows passkey registration, removal, identity verification, and browser support states.
apps/…/ChangeEmail.tsxShows the verified email-change flow and sign-out after the identity changes.
apps/…/VerifyIdentityDialog.tsxShows the common passkey or email-code step-up boundary for sensitive account actions.
apps/…/server.tsShows account updates, expiring scoped CLI keys, revocation, and all-device credential invalidation.
apps/…/Caps.tsxShows library capture entry points, selection, archiving, deletion, movement, pagination, and analytics.
apps/…/SharedCaps.tsxShows shared-space and organization collection flow, selection, and ordering.
apps/…/ImportLoomPage.tsxShows single Loom import, CSV mapping, batch results, retries, and destinations.
apps/…/shell.tsxShows app switching, section navigation, responsive console layout, and upload leave guards.
apps/…/video-client.tsxShows developer playback, processing states, link output, rename, delete, and credit pause behavior.
apps/…/share.tsShows the permission boundary for Cap audience and link changes.
apps/…/settings.tsShows organization setting validation and Pro-field preservation.
apps/…/form.tsxShows email, passkey, OAuth, Google One Tap, and SSO entry paths.
apps/…/form.tsxShows account creation, Google One Tap, SSO, and checkout return handling.
apps/…/google-one-tap.tsShows browser-side nonce use, prompt lifecycle, credential handoff, and fallback sign-in.
apps/…/route.tsShows email-code limits, passkey and One Tap callback checks, SSO intent checks, callback handling, and safe auth errors.
apps/…/route.tsShows the short-lived Google One Tap nonce boundary.
apps/…/route.tsShows email-matched invite acceptance, membership creation, seat assignment, and active-organization selection.
apps/…/route.tsShows mobile authentication and the native organization, library, media, notification, and account contract.
apps/…/route.tsShows agent-scoped library, media, transcript, processing, integration, and developer operations.
apps/…/page.tsxShows the browser approval page for scoped CLI access.
apps/…/actions.tsShows MCP request validation, user approval, code creation, and callback behavior.
apps/…/multipart.tsShows authenticated Cap multipart upload and finalization boundaries.
apps/…/route.tsShows policy-aware MP4, HLS, live segment, caption, and raw-preview delivery.
apps/…/videos.tsShows the developer video and import contract.
apps/…/uploads.tsShows server-created videos and short-lived browser upload tokens.
apps/…/page.tsxShows share-page policy, metadata, playback preparation, collaboration data, and viewer controls.
apps/…/Share.tsxShows the client review surface and stable media stage.
apps/…/CapVideoPlayer.tsxShows source readiness, upload and processing states, fallback playback, captions, and review controls.
apps/…/mp4-level-patch.tsShows the iOS-compatible playback adaptation boundary.
apps/…/page.tsxShows public embed access, branding, playback state, and share limits.
apps/…/route.tsShows the machine-readable documentation contract.
apps/…/proxy.tsShows request-wide redirects, custom-domain handling, and the page matcher.
apps/…/instrumentation.tsShows trace registration and the runtime split for startup work.
apps/…/instrumentation.node.tsShows self-hosted migration and storage setup behavior.
apps/…/global-error.tsxShows the final error report and fallback document for uncaught app errors.
apps/…/page.tsxShows release-aware desktop download messaging and public metadata.
apps/…/page.tsxShows the public browser-only conversion product flow and its structured page content.
apps/…/page.tsxShows the public Loom download flow and the migration path into Cap.
apps/…/sitemap.tsShows public route discovery, SEO fallback handling, deduplication, and index exclusions.