# igrisundead-ops/prometheus-core-backend architecture

> Architecture diagram of the GitHub repository igrisundead-ops/prometheus-core-backend, 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/prometheus-core-backend
- Repository: https://github.com/igrisundead-ops/prometheus-core-backend

## Overview

1. This is a multi-package media-generation platform, not a single app. The repository centers on a cinematic video/audio system built around TypeScript, React/Remotion, a Node backend, and a Python render worker. The codebase is organized to plan creative decisions, render preview/final outputs, and manage media/font/music catalogs.

2. The main runtime boundary is between `backend/` and `remotion-app/`. The backend is a Node/TypeScript API and orchestration service. The Remotion app is a Vite/React front end plus composition/runtime layer that turns manifests and timelines into previewable or renderable scenes.

3. `backend/src/` is the control plane. It exposes routes for edit sessions, music, uploads, thumbnails, diagnostics, and “god”/creative decision workflows. It also contains execution routing, queueing, render authority, and pipeline modules that decide which executor or rendering path should run.

4. The backend’s core domain is split into specialized subsystems: `cognitive-engine` and related governors for decision-making and constraints; `executors` for running video jobs; `music` for cataloging, planning, rendering, and validating audio; `render` for adapter-based render execution; and `typography`, `motion`, and `assets` services for asset resolution and layout decisions. These are the main architectural seams you’d diagram.

5. The creative decision layer is especially prominent. The repo includes “governor,” “critic,” “ocular,” “temporal,” and “timeline” concepts in the backend, plus a large `remotion-app/src/creative-orchestration/` area with agents, judgment engines, governance, deviation control, and planning. This indicates a layered system where candidate creative treatments are generated, critiqued, constrained, and then approved for rendering.

6. The Remotion app is the presentation and composition engine. `src/compositions/` holds renderable scenes, while `src/components/` and `src/web-preview/` provide live preview UIs, audio preview players, and hyperframes/native preview stages. `src/lib/render-graph/`, `src/webgl/`, and `src/lib/motion-3d/` suggest a pipeline that can augment or simulate visual effects before final composition.

7. There is a strong typography/font subsystem. Font data lives in `remotion-app/public/fonts/`, `font-intelligence/`, and backend typography modules. The system includes font registries, runtime font selection, compatibility graphs, hydration/ingestion scripts, and audit outputs. In an architecture diagram, this should be treated as a distinct content-intelligence service feeding preview/render decisions.

8. Music is its own first-class pipeline. In `backend/src/music/` and `remotion-app/src/lib/music/`, the code covers catalog import, license guarding, track analysis, beat-grid/section detection, planning, overrides, preflight validation, rehearsal runs, and audio preview rendering. That means music is not just an asset; it is planned against video timelines and governed by its own validation and artifact store.

9. Asset and retrieval infrastructure is vector-aware. The repo references Milvus, R2, embedding builders, retrieval rankers, and catalog normalization in both backend and app code. External storage/search services materially shape the architecture: R2 is used for media/font/music artifacts, Milvus for embedding retrieval, and AssemblyAI/ffprobe for transcription and media metadata.

10. Rendering is adapter-based. The backend `render/adapters/` folder contains local, legacy Remotion, and “vast” render adapters, with `render-authority` and `preview-render-service` coordinating which renderer is allowed to run. The separate `runpod-video-worker/` package is the compute boundary for heavier rendering jobs, packaged as a Dockerized Python worker.

11. Data flows are artifact-driven rather than purely request/response. Many modules read and write JSON artifacts under `remotion-app/src/data/` and backend persistence layers. This suggests a pipeline where ingestion, cataloging, planning, and rendering each produce durable manifests that later stages consume.

12. Operationally, the repository includes extensive tests and audit documentation. Backend and app tests cover contracts, integrations, and governance behavior, while docs and generated reports capture render audits, typography diagnostics, and architecture notes. The `.github/workflows/` and scripts directories indicate CI/CD and batch tooling around those pipelines.

13. The `.agents/` and `docs/` folders are important for human/process workflow, but they are not runtime architecture. They encode domain guidance, triage, planning, and architectural notes that support the engineering process around the system’s creative and media pipelines.

14. If you draw this repository, the clearest top-level shape is: content ingestion and catalogs on the left, governance/planning in the middle, rendering/preview on the right, and external services below or alongside for embeddings, storage, transcription, and compute. The dominant theme is a governed cinematic production system with separate planes for decisioning, assets, music, typography, and execution.

Main entry points: [`remotion-app/src/creative-orchestration/index.ts`](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/remotion-app/src/creative-orchestration/index.ts) (Creative orchestration), [`backend/src/cognitive-engine/index.ts`](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/cognitive-engine/index.ts) (Creative gov), [`backend/src/integrations/r2.ts`](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/integrations/r2.ts) (R2 storage), [`backend/src/execution-router.ts`](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/execution-router.ts) (Execution routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_backend["Backend"]
  node_backend_app["API surface<br/>Node API<br/>[app.ts]"]
  node_backend_governance{{"Creative gov<br/>decision control<br/>[index.ts]"}}
  node_backend_execution["Execution routing<br/>job orchestration"]
  node_backend_render["Render authority<br/>render control"]
  node_backend_music["Music pipeline<br/>audio planning<br/>[index.ts]"]
  node_backend_typography["Typography<br/>font intelligence"]
  node_backend_assets["Assets<br/>asset service<br/>[service.ts]"]
  node_backend_integrations["Integrations<br/>connectors<br/>[r2.ts]"]
  node_backend_thumbnails["Thumbnails<br/>media utility<br/>[index.ts]"]
end

subgraph group_remotion["Remotion App"]
  node_remotion_preview["Preview UI<br/>React preview<br/>[PreviewApp.tsx]"]
  node_remotion_compositions["Compositions<br/>render scenes"]
  node_remotion_orchestration{{"Creative orchestration<br/>scene planning<br/>[index.ts]"}}
  node_remotion_motion["Motion engine<br/>visual pipeline<br/>[index.ts]"]
  node_remotion_music["Music tools<br/>audio preview<br/>[music-api.ts]"]
  node_remotion_typography["Font system<br/>font runtime<br/>[index.ts]"]
  node_remotion_assets["Asset search<br/>retrieval<br/>[retrieval.ts]"]
end

subgraph group_worker["Render Worker"]
  node_worker_compute["Video worker<br/>Python render worker<br/>[handler.py]"]
end

subgraph group_external["External Services"]
  node_ext_storage[("R2 storage<br/>object storage<br/>[r2.ts]")]
  node_ext_vectors[("Milvus<br/>vector search<br/>[milvus-client.ts]")]
  node_ext_transcribe(("AssemblyAI<br/>transcription<br/>[assemblyai.ts]"))
end

subgraph group_process["Process"]
end

node_backend_app -->|"creative decisions"| node_backend_governance
node_backend_app -->|"dispatch jobs"| node_backend_execution
node_backend_execution -->|"select renderer"| node_backend_render
node_backend_execution -->|"heavy renders"| node_worker_compute
node_backend_governance -->|"constrain audio"| node_backend_music
node_backend_governance -->|"font rules"| node_backend_typography
node_backend_governance -->|"resolve assets"| node_backend_assets
node_backend_assets -->|"retrieve"| node_ext_vectors
node_backend_assets -->|"store media"| node_ext_storage
node_backend_music -->|"catalog artifacts"| node_ext_storage
node_backend_music -->|"analyze audio"| node_ext_transcribe
node_backend_typography -->|"font search"| node_ext_vectors
node_backend_typography -->|"font assets"| node_ext_storage
node_remotion_preview -->|"mount scenes"| node_remotion_compositions
node_remotion_preview -->|"preview governance"| node_remotion_orchestration
node_remotion_orchestration -->|"plan motion"| node_remotion_motion
node_remotion_orchestration -->|"audio cues"| node_remotion_music
node_remotion_orchestration -->|"choose fonts"| node_remotion_typography
node_remotion_orchestration -->|"rank assets"| node_remotion_assets
node_remotion_motion -.->|"render pipeline"| node_worker_compute
node_backend_render -->|"preview output"| node_remotion_preview
node_backend_render -->|"approved jobs"| node_worker_compute
node_backend_integrations -->|"media fetch"| node_ext_storage
node_backend_integrations -->|"probe/transcribe"| node_ext_transcribe

click node_backend_app "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/app.ts"
click node_backend_governance "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/cognitive-engine/index.ts"
click node_backend_execution "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/execution-router.ts"
click node_backend_render "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/render/render-authority.ts"
click node_backend_music "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/music/index.ts"
click node_backend_typography "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/typography/typography-decision-engine.ts"
click node_backend_assets "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/assets/service.ts"
click node_backend_integrations "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/integrations/r2.ts"
click node_backend_thumbnails "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/thumbnail/index.ts"
click node_remotion_preview "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/remotion-app/src/web-preview/PreviewApp.tsx"
click node_remotion_compositions "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/remotion-app/src/compositions/ProjectScopedPreviewComposition.tsx"
click node_remotion_orchestration "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/remotion-app/src/creative-orchestration/index.ts"
click node_remotion_motion "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/remotion-app/src/lib/render-graph/index.ts"
click node_remotion_music "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/remotion-app/src/lib/music/music-api.ts"
click node_remotion_typography "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/remotion-app/src/lib/font-intelligence/index.ts"
click node_remotion_assets "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/remotion-app/src/lib/assets/retrieval.ts"
click node_worker_compute "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/runpod-video-worker/handler.py"
click node_ext_storage "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/integrations/r2.ts"
click node_ext_vectors "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/remotion-app/src/lib/vector/milvus-client.ts"
click node_ext_transcribe "https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/integrations/assemblyai.ts"

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_backend_app,node_backend_governance,node_backend_execution,node_backend_render,node_backend_music,node_backend_typography,node_backend_assets,node_backend_integrations,node_backend_thumbnails toneBlue
class node_remotion_preview,node_remotion_compositions,node_remotion_orchestration,node_remotion_motion,node_remotion_music,node_remotion_typography,node_remotion_assets toneAmber
class node_worker_compute toneMint
class node_ext_storage,node_ext_vectors,node_ext_transcribe toneRose
```

## Components

### Backend

Node/TypeScript control plane and orchestration

- [API surface](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/app.ts): Node API · HTTP server, routes, sessions, uploads, thumbnails, diagnostics · `backend/src/app.ts`
- [Creative gov](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/cognitive-engine/index.ts): decision control · God workflows, cognitive governance, critics, temporal/timeline integrity · `backend/src/cognitive-engine/index.ts`
- [Execution routing](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/execution-router.ts): job orchestration · Queueing, execution context, router, and pipeline selection · `backend/src/execution-router.ts`
- [Render authority](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/render/render-authority.ts): render control · Adapter-based render approval and preview render service · `backend/src/render/render-authority.ts`
- [Music pipeline](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/music/index.ts): audio planning · Catalog import, analysis, planning, rehearsal, validation, and rendering · `backend/src/music/index.ts`
- [Typography](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/typography/typography-decision-engine.ts): font intelligence · Font registry, selection, delivery, and Zilliz-backed resolution · `backend/src/typography/typography-decision-engine.ts`
- [Assets](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/assets/service.ts): asset service · Asset routes, vector service, and media/catalog resolution · `backend/src/assets/service.ts`
- [Integrations](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/integrations/r2.ts): connectors · R2, ffprobe, and AssemblyAI integration layer · `backend/src/integrations/r2.ts`
- [Thumbnails](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/thumbnail/index.ts): media utility · Thumbnail extraction and generation services · `backend/src/thumbnail/index.ts`

### Remotion App

React/Vite composition and preview runtime

- [Preview UI](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/remotion-app/src/web-preview/PreviewApp.tsx): React preview · Web preview app, native/hyperframes stages, and preview controls · `remotion-app/src/web-preview/PreviewApp.tsx`
- [Compositions](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/remotion-app/src/compositions/ProjectScopedPreviewComposition.tsx): render scenes · Renderable scenes and project-scoped compositions · `remotion-app/src/compositions/ProjectScopedPreviewComposition.tsx`
- [Creative orchestration](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/remotion-app/src/creative-orchestration/index.ts): scene planning · Agents, governance, judgment, and creative decision plumbing · `remotion-app/src/creative-orchestration/index.ts`
- [Motion engine](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/remotion-app/src/lib/render-graph/index.ts): visual pipeline · Render graph, motion platform, webgl, and 3D augmentation · `remotion-app/src/lib/render-graph/index.ts`
- [Music tools](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/remotion-app/src/lib/music/music-api.ts): audio preview · Client-side music API, preview player, and video-aware state · `remotion-app/src/lib/music/music-api.ts`
- [Font system](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/remotion-app/src/lib/font-intelligence/index.ts): font runtime · Font intelligence, runtime registry, compatibility graphs, and selection · `remotion-app/src/lib/font-intelligence/index.ts`
- [Asset search](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/remotion-app/src/lib/assets/retrieval.ts): retrieval · Cataloging, embeddings, Milvus retrieval, and asset ranking · `remotion-app/src/lib/assets/retrieval.ts`

### Render Worker

Python compute boundary for heavy renders

- [Video worker](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/runpod-video-worker/handler.py): Python render worker · Dockerized Runpod worker for heavyweight rendering jobs · `runpod-video-worker/handler.py`

### External Services

Storage, search, transcription, and model backends

- [R2 storage](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/integrations/r2.ts): object storage · Durable media, font, and music artifact storage · `backend/src/integrations/r2.ts`
- [Milvus](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/remotion-app/src/lib/vector/milvus-client.ts): vector search · Embedding retrieval and ranking backend · `remotion-app/src/lib/vector/milvus-client.ts`
- [AssemblyAI](https://github.com/igrisundead-ops/prometheus-core-backend/blob/main/backend/src/integrations/assemblyai.ts): transcription · Media transcription and metadata extraction service · `backend/src/integrations/assemblyai.ts`

## Connections

- API surface → Creative gov: creative decisions · Routes feed governed treatment and edit-session workflows
- API surface → Execution routing: dispatch jobs · API requests enter execution routing and queueing
- Execution routing → Render authority: select renderer · Execution chooses the allowed render path
- Execution routing → Video worker: heavy renders · Large jobs can be delegated to the Python worker
- Creative gov → Music pipeline: constrain audio · Governance shapes music planning and validation
- Creative gov → Typography: font rules · Decisioning constrains typography and layout choices
- Creative gov → Assets: resolve assets · Creative control consumes curated asset catalogs
- Assets → Milvus: retrieve · Vector-aware ranking and catalog search
- Assets → R2 storage: store media · Media and artifacts are persisted in object storage
- Music pipeline → R2 storage: catalog artifacts · Plans, rehearsals, and previews are stored durably
- Music pipeline → AssemblyAI: analyze audio · Transcription and media metadata support music planning
- Typography → Milvus: font search · Font intelligence uses embedding-backed lookup
- Typography → R2 storage: font assets · Runtime font artifacts are delivered from storage
- Preview UI → Compositions: mount scenes · Preview surfaces render composition entry points
- Preview UI → Creative orchestration: preview governance · Live preview is steered by creative orchestration
- Creative orchestration → Motion engine: plan motion · Judgment and planning produce motion/render graphs
- Creative orchestration → Music tools: audio cues · Creative orchestration coordinates music preview state
- Creative orchestration → Font system: choose fonts · Typography policy and runtime selection are governed here
- Creative orchestration → Asset search: rank assets · Agents search and rank assets for a scene
- Motion engine → Video worker: render pipeline · The motion stack ultimately feeds render execution
- Render authority → Preview UI: preview output · Backend render control serves preview-render flows to the app
- Render authority → Video worker: approved jobs · Render authority may release jobs to external compute
- Integrations → R2 storage: media fetch · Backend integrations read and write artifacts in storage
- Integrations → AssemblyAI: probe/transcribe · ffprobe and transcription are part of media ingestion
