How igrisundead-ops/silicon-valley-prometheus-frontend-latest works
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 Remotion app · app Main app · lib App services · dashboard Workspace UI
Components 22
Next.js app
Product UI, route surfaces, and API edge in the main monorepo app.
- Main app · Primary product shell with route-based UI and API orchestration.
app - Auth flow · Login, signup, password reset, and verification screens.
app/(auth) - Workspace UI · Dashboard, projects, editor, assets, templates, captions, exports, settings, and billing surfaces.
app/dashboard - API edge · Thin HTTP entrypoints that delegate to service modules.
app/api - Editor shell · Preview canvas, timeline, inspector, music, upload, command overlay, and dialogs.
components/editor - Shared UI · Reusable shells, auth UI, billing UI, workspace selector, and app-wide primitives.
components - App hooks · Client hooks that connect the editor and billing UI to backend state and jobs.
hooks - App services · 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 · Separate runtime for composition, preview, and render output.
remotion-app-live - Creative orchestration · Decision logic for captions, overlays, transitions, sound, and scene planning.
remotion-app-live/src/creative-orchestration - Motion platform · Core motion catalogs, planners, pattern memory, target focus, and transition logic.
remotion-app-live/src/lib/motion-platform - Typography system · Font graphs, runtime selection, compatibility, and stylebook-driven typography policy.
remotion-app-live/src/lib/cinematic-typography - Preview runtime · Browser preview app, telemetry, and live audio/video preview surfaces.
remotion-app-live/src/web-preview - Compositions · Project-scoped compositions and render entrypoints that consume structured scene data.
remotion-app-live/src/compositions - Runtime data · Synced captions, motion maps, pattern memory, showcase assets, and transcripts.
remotion-app-live/src/data - Remotion scripts · 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 · Database, auth, realtime, and server/client access helpers.
lib/supabase - R2 storage · Workspace bucket keys, multipart uploads, object copies, and presigned URLs.
lib/r2 - Vector search · Embedding, retrieval, ranking, and Milvus client code for asset intelligence.
remotion-app-live/src/lib/vector - External APIs · Supabase, Paddle, Airtable, AssemblyAI, Google Drive, music catalogs, and other remote integrations.
lib/api - Ingestion scripts · Catalog, font, music, asset, motion, and transcript sync jobs that build runtime data.
scripts - Generated data · Generated app-side artifacts for assets, jobs, workspaces, and integrations.
lib/generated
Connections 26
- 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.