# igrisundead-ops/silicon-valley-prometheus-frontend-latest architecture

> Architecture diagram of the GitHub repository igrisundead-ops/silicon-valley-prometheus-frontend-latest, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest
- Repository: https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest

## Overview

1. This repository is a product monorepo centered on a Next.js App Router application in `app/`, with a separate Remotion-based rendering workspace in `remotion-app-live/`. The main app handles user workflows and API orchestration; the Remotion subproject handles composition, preview, and render logic for motion/video output.

2. The primary UI surface is organized by route domain: auth (`app/(auth)`), dashboard/editor (`app/dashboard`, `app/editor/[id]`, `app/projects/[id]`), content pages (`assets`, `templates`, `captions`, `broll`, `highlights`, `exports`), and account/billing/settings pages. Shared UI lives in `components/`, with editor-specific panels and shell components forming the main interaction boundary.

3. Backend behavior is concentrated in `app/api/**` route handlers. These routes are thin entry points that delegate to `lib/**` services for auth, projects, assets, billing, uploads, jobs, music, cinematic/template logic, and export/download URLs. In architecture terms, the app uses the route handlers as the API edge, while business rules live in the library layer.

4. The core product flow appears to be: authenticate user, select workspace, create/open project, upload source media, generate or sync transcript, build an edit plan, preview in the editor, and create export jobs. Uploads are supported by multipart endpoints and presigned URLs, while transcript synchronization is explicitly exposed under asset transcript routes.

5. Workspace and tenant isolation are first-class boundaries. There are dedicated workspace helpers in `lib/workspaces/**`, active workspace routes in `app/api/workspaces/active`, and related storage-key/permission logic. This suggests most project/media operations are scoped to a current workspace rather than a globally shared account.

6. Persistent storage is split across several backends. Supabase is used for database/auth/runtime state (`lib/supabase/**`, migrations in `supabase/migrations`), Cloudflare R2 handles object storage and presigned uploads/downloads (`lib/r2/**`), and vector search uses Milvus via the vector and asset indexing layers (`lib/vector/**`, `lib/assets/**`). The app also integrates Airtable for some image/catalog health endpoints and browser-visible asset data.

7. Billing is a separate subsystem with its own API routes and UI gates. Paddle is the payment provider, with checkout, cancel, invoices, webhook, and success-state pages/components. Billing checks are enforced through hooks and dialogs in the UI, so access control is part of the user-flow architecture rather than just a backend concern.

8. The editor is a composition of focused panels rather than a single monolith: preview canvas, timeline, inspector, music panel, upload flow, command overlay, chat/workspace panels, and export/download dialogs. Hooks like `use-editor-state`, `use-video-engine`, `use-durable-job`, and `use-music-workspace` bridge the UI to backend state, long-running jobs, and media engines.

9. `remotion-app-live/` is the media-generation engine. It contains Remotion compositions, a custom preview app, motion overlays, longform caption systems, and a large amount of generated/local asset state. This subproject is effectively the rendering/runtime boundary: it consumes structured data and assets from `src/data` and produces previewable/renderable cinematic output.

10. Inside `remotion-app-live/`, the main architectural layers are creative orchestration, motion platform primitives, typography/font intelligence, preview runtime, and render helpers. The `creative-orchestration` and `motion-platform` directories encode the decision logic for captions, overlays, transitions, sound, target focus, pattern memory, and scene planning; the `web-preview` area provides a browser-based live preview and telemetry layer; and the `lib/` packages provide the reusable planning/ranking/selection algorithms.

11. The repo relies heavily on generated and synced artifacts rather than only hand-written source. `src/data/**` in the Remotion workspace and `lib/generated/**` in the app hold catalogs, manifests, transcripts, pattern memory, font graphs, and asset indexes created by scripts. The `scripts/` and `remotion-app-live/scripts/` folders are the ingestion/sync pipeline for this data, turning raw assets and external catalog sources into runtime-friendly JSON and manifests.

12. External integrations materially shape the architecture: AssemblyAI for transcript-related work, Paddle for billing, Airtable for asset/image checks, Supabase for auth/database/realtime/storage metadata, R2 for file storage, Milvus for embedding retrieval, and Google Drive/music catalog syncing through helper scripts. These integrations are not incidental; they define the data pipelines that feed editor state and rendering decisions.

13. The repository is test-heavy, especially around media/layout policy and runtime stability. There are extensive unit tests in both the main app and Remotion workspace, indicating many architecture rules are encoded as deterministic planning logic: caption timing, overlay layout, motion selection, typography policy, retrieval/ranking, and preview governance.

14. Overall, the system is best drawn as three major zones: the Next.js product shell/API, the data/storage/integration layer, and the Remotion creative runtime. Data flows from user actions and external integrations into workspace-scoped records and generated catalogs, then into orchestration/planning code, and finally into preview/render compositions that produce exports and downloadable media.

Main entry points: [`remotion-app-live`](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live) (Remotion app), [`app`](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/app) (Main app), [`lib`](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/lib) (App services), [`app/dashboard`](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/app/dashboard) (Workspace UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_app["Next.js app"]
  node_node_main_app["Main app<br/>Next.js App Router"]
  node_node_auth_ui["Auth flow<br/>Route UI"]
  node_node_workspace_ui["Workspace UI<br/>Route UI"]
  node_node_api_edge["API edge<br/>Route handlers"]
  node_node_editor_shell["Editor shell<br/>UI composition"]
  node_node_shared_ui["Shared UI<br/>Component kit"]
  node_node_app_hooks["App hooks<br/>State bridges"]
  node_node_app_lib["App services<br/>Business logic"]
end

subgraph group_group_remotion["Remotion runtime"]
  node_node_remotion_root["Remotion app<br/>Rendering workspace"]
  node_node_creative_orch["Creative orchestration<br/>Planning engine"]
  node_node_motion_platform["Motion platform<br/>Motion rules"]
  node_node_typography["Typography system<br/>Font intelligence"]
  node_node_preview_runtime["Preview runtime<br/>Web preview"]
  node_node_compositions["Compositions<br/>Remotion scenes"]
  node_node_remotion_data["Runtime data<br/>Generated JSON"]
  node_node_remotion_scripts["Remotion scripts<br/>Build/sync pipeline"]
end

subgraph group_group_data["Storage and sync"]
  node_node_supabase[("Supabase<br/>DB/auth layer")]
  node_node_r2[("R2 storage<br/>Object storage")]
  node_node_vector[("Vector search<br/>Milvus layer")]
  node_node_integrations["External APIs<br/>Providers"]
  node_node_ingest_scripts["Ingestion scripts<br/>Sync pipelines"]
  node_node_app_generated["Generated data<br/>Catalogs/manifests"]
end

node_node_main_app -->|"routes to"| node_node_auth_ui
node_node_main_app -->|"routes to"| node_node_workspace_ui
node_node_main_app -->|"hosts"| node_node_api_edge
node_node_workspace_ui -->|"uses"| node_node_editor_shell
node_node_workspace_ui -->|"reuses"| node_node_shared_ui
node_node_editor_shell -->|"binds through"| node_node_app_hooks
node_node_api_edge -->|"delegates to"| node_node_app_lib
node_node_app_lib -->|"persists via"| node_node_supabase
node_node_app_lib -->|"stores media in"| node_node_r2
node_node_app_lib -->|"searches via"| node_node_vector
node_node_app_lib -->|"integrates with"| node_node_integrations
node_node_integrations -->|"feeds"| node_node_ingest_scripts
node_node_ingest_scripts -->|"builds"| node_node_app_generated
node_node_main_app -->|"reads"| node_node_app_generated
node_node_main_app -->|"hands off to"| node_node_remotion_root
node_node_remotion_root -->|"contains"| node_node_creative_orch
node_node_remotion_root -->|"contains"| node_node_motion_platform
node_node_remotion_root -->|"contains"| node_node_typography
node_node_remotion_root -->|"contains"| node_node_preview_runtime
node_node_remotion_root -->|"contains"| node_node_compositions
node_node_remotion_root -->|"consumes"| node_node_remotion_data
node_node_remotion_scripts -->|"generates"| node_node_remotion_data
node_node_creative_orch -->|"coordinates"| node_node_motion_platform
node_node_creative_orch -->|"adapts text"| node_node_typography
node_node_preview_runtime -->|"renders"| node_node_compositions
node_node_compositions -->|"uses"| node_node_remotion_data

click node_node_main_app "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/app"
click node_node_auth_ui "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/app/(auth)"
click node_node_workspace_ui "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/app/dashboard"
click node_node_api_edge "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/app/api"
click node_node_editor_shell "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/components/editor"
click node_node_shared_ui "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/components"
click node_node_app_hooks "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/hooks"
click node_node_app_lib "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/lib"
click node_node_supabase "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/lib/supabase"
click node_node_r2 "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/lib/r2"
click node_node_vector "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live/src/lib/vector"
click node_node_integrations "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/lib/api"
click node_node_ingest_scripts "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/scripts"
click node_node_app_generated "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/lib/generated"
click node_node_remotion_root "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live"
click node_node_creative_orch "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live/src/creative-orchestration"
click node_node_motion_platform "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live/src/lib/motion-platform"
click node_node_typography "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live/src/lib/cinematic-typography"
click node_node_preview_runtime "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live/src/web-preview"
click node_node_compositions "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live/src/compositions"
click node_node_remotion_data "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live/src/data"
click node_node_remotion_scripts "https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live/scripts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_node_main_app,node_node_auth_ui,node_node_workspace_ui,node_node_api_edge,node_node_editor_shell,node_node_shared_ui,node_node_app_hooks,node_node_app_lib toneBlue
class node_node_remotion_root,node_node_creative_orch,node_node_motion_platform,node_node_typography,node_node_preview_runtime,node_node_compositions,node_node_remotion_data,node_node_remotion_scripts toneAmber
class node_node_supabase,node_node_r2,node_node_vector,node_node_integrations,node_node_ingest_scripts,node_node_app_generated toneMint
```

## Components

### Next.js app

Product UI, route surfaces, and API edge in the main monorepo app.

- [Main app](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/app): Next.js App Router · Primary product shell with route-based UI and API orchestration. · `app`
- [Auth flow](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/app/(auth)): Route UI · Login, signup, password reset, and verification screens. · `app/(auth)`
- [Workspace UI](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/app/dashboard): Route UI · Dashboard, projects, editor, assets, templates, captions, exports, settings, and billing surfaces. · `app/dashboard`
- [API edge](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/app/api): Route handlers · Thin HTTP entrypoints that delegate to service modules. · `app/api`
- [Editor shell](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/components/editor): UI composition · Preview canvas, timeline, inspector, music, upload, command overlay, and dialogs. · `components/editor`
- [Shared UI](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/components): Component kit · Reusable shells, auth UI, billing UI, workspace selector, and app-wide primitives. · `components`
- [App hooks](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/hooks): State bridges · Client hooks that connect the editor and billing UI to backend state and jobs. · `hooks`
- [App services](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/lib): Business logic · Product-domain services for auth, projects, uploads, billing, workspaces, exports, and jobs. · `lib`

### Remotion runtime

Creative rendering workspace, preview app, and planning engine.

- [Remotion app](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live): Rendering workspace · Separate runtime for composition, preview, and render output. · `remotion-app-live`
- [Creative orchestration](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live/src/creative-orchestration): Planning engine · Decision logic for captions, overlays, transitions, sound, and scene planning. · `remotion-app-live/src/creative-orchestration`
- [Motion platform](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live/src/lib/motion-platform): Motion rules · Core motion catalogs, planners, pattern memory, target focus, and transition logic. · `remotion-app-live/src/lib/motion-platform`
- [Typography system](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live/src/lib/cinematic-typography): Font intelligence · Font graphs, runtime selection, compatibility, and stylebook-driven typography policy. · `remotion-app-live/src/lib/cinematic-typography`
- [Preview runtime](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live/src/web-preview): Web preview · Browser preview app, telemetry, and live audio/video preview surfaces. · `remotion-app-live/src/web-preview`
- [Compositions](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live/src/compositions): Remotion scenes · Project-scoped compositions and render entrypoints that consume structured scene data. · `remotion-app-live/src/compositions`
- [Runtime data](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live/src/data): Generated JSON · Synced captions, motion maps, pattern memory, showcase assets, and transcripts. · `remotion-app-live/src/data`
- [Remotion scripts](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live/scripts): Build/sync pipeline · Font, asset, music, showcase, pattern, and render ingestion jobs for the media runtime. · `remotion-app-live/scripts`

### Storage and sync

Persistence, external integrations, generated catalogs, and ingestion pipelines.

- [Supabase](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/lib/supabase): DB/auth layer · Database, auth, realtime, and server/client access helpers. · `lib/supabase`
- [R2 storage](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/lib/r2): Object storage · Workspace bucket keys, multipart uploads, object copies, and presigned URLs. · `lib/r2`
- [Vector search](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/remotion-app-live/src/lib/vector): Milvus layer · Embedding, retrieval, ranking, and Milvus client code for asset intelligence. · `remotion-app-live/src/lib/vector`
- [External APIs](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/lib/api): Providers · Supabase, Paddle, Airtable, AssemblyAI, Google Drive, music catalogs, and other remote integrations. · `lib/api`
- [Ingestion scripts](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/scripts): Sync pipelines · Catalog, font, music, asset, motion, and transcript sync jobs that build runtime data. · `scripts`
- [Generated data](https://github.com/igrisundead-ops/silicon-valley-prometheus-frontend-latest/tree/main/lib/generated): Catalogs/manifests · Generated app-side artifacts for assets, jobs, workspaces, and integrations. · `lib/generated`

## Connections

- Main app → Auth flow: routes to · Public auth pages are part of the main Next.js surface.
- Main app → Workspace UI: routes to · Dashboard, editor, project, and account pages are route-driven UI.
- Main app → API edge: hosts · The app exposes its backend behavior through route handlers.
- Workspace UI → Editor shell: uses · The editor page is assembled from dedicated interaction panels.
- Workspace UI → Shared UI: reuses · Route surfaces share common shells, dialogs, navigation, and forms.
- Editor shell → App hooks: binds through · Editor panels read and mutate state via client hooks.
- API edge → App services: delegates to · API handlers are thin adapters over service-layer modules.
- App services → Supabase: persists via · Auth, project state, jobs, and workspace records are backed by Supabase.
- App services → R2 storage: stores media in · Uploads, transcripts, and exports use object storage and presigned access.
- App services → Vector search: searches via · Asset and catalog retrieval uses embeddings and Milvus-backed search.
- App services → External APIs: integrates with · Business logic depends on external providers and remote APIs.
- External APIs → Ingestion scripts: feeds · Sync scripts pull remote catalogs and normalize them into runtime data.
- Ingestion scripts → Generated data: builds · The app stores generated catalogs and manifests for runtime use.
- Main app → Generated data: reads · The UI and services consume generated catalogs and manifests.
- Main app → Remotion app: hands off to · The product shell connects to the separate rendering workspace.
- Remotion app → Creative orchestration: contains · Creative orchestration is the planning core of the rendering workspace.
- Remotion app → Motion platform: contains · Motion platform primitives drive composition and overlay behavior.
- Remotion app → Typography system: contains · Typography intelligence is a central subsystem in the render runtime.
- Remotion app → Preview runtime: contains · Browser preview is a distinct runtime boundary from composition code.
- Remotion app → Compositions: contains · Compositions are the renderable scene entrypoints.
- Remotion app → Runtime data: consumes · Preview and render logic are driven by synced datasets and manifests.
- Remotion scripts → Runtime data: generates · Scripts ingest and reshape the runtime datasets.
- Creative orchestration → Motion platform: coordinates · Creative orchestration makes higher-level decisions over motion primitives.
- Creative orchestration → Typography system: adapts text · Caption and overlay planning depend on typography policy.
- Preview runtime → Compositions: renders · The preview app mounts compositions for interactive playback.
- Compositions → Runtime data: uses · Compositions are parameterized by structured runtime data.
