# rocketseat/jupiter architecture

> Architecture diagram of the GitHub repository rocketseat/jupiter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rocketseat/jupiter
- Repository: https://github.com/rocketseat/jupiter

## Overview

Jupiter is a video-upload hub. Its main workflow is to upload and manage video batches, process stored media, and generate AI transcripts and subtitles, with video metadata and processing status available in the app. The graph also preserves the documented upload, search, tagging, AI-title/description, transcription-review, and webhook capabilities. Source evidence is partial: several UI and route modules are indexed but not excerpted, so links between those parts are omitted where their calls are not shown.

Main entry points: [`src/lib/prisma.ts`](https://github.com/rocketseat/jupiter/blob/main/src/lib/prisma.ts) (Database client), [`src/lib/eden.ts`](https://github.com/rocketseat/jupiter/blob/main/src/lib/eden.ts) (Typed API client), [`src/env.ts`](https://github.com/rocketseat/jupiter/blob/main/src/env.ts) (Runtime configuration), [`src/app/api/webhooks/create-video-transcription/route.ts`](https://github.com/rocketseat/jupiter/blob/main/src/app/api/webhooks/create-video-transcription/route.ts) (Transcription job)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["App experience"]
  node_upload_ui["Upload interface<br/>[index.tsx]"]
  node_upload_state["Upload state<br/>[uploads.ts]"]
  node_uploads_ui["Video library<br/>[page.tsx]"]
  node_pagination["Library pagination"]
  node_search_ui["Video search<br/>[search.tsx]"]
  node_video_ui["Video details<br/>[page.tsx]"]
  node_transcript_ui["Transcript review"]
  node_format_bytes["Storage summary<br/>[storage.tsx]"]
  node_format_util["Byte formatting<br/>[format-bytes.ts]"]
end

subgraph group_api["API and workflows"]
  node_upload_api["Upload endpoints"]
  node_batch_api["Batch creation"]
  node_tag_api["Tag endpoints<br/>[create-tag.ts]"]
  node_ai_api["AI metadata"]
  node_api_app["API router<br/>[app.ts]"]
  node_transcribe["Transcription job<br/>[route.ts]"]
  node_subtitles["Subtitle generation<br/>[route.ts]"]
end

subgraph group_services["Media and AI services"]
  node_r2["Object storage client<br/>[cloudflare-r2.ts]"]
  node_openai["OpenAI service<br/>[openai.ts]"]
  node_env["Runtime configuration<br/>[env.ts]"]
  node_eden["Typed API client<br/>[eden.ts]"]
end

subgraph group_data["Persistence and messaging"]
  node_db_client["Database client<br/>[prisma.ts]"]
  node_qstash["QStash messaging<br/>[qstash.ts]"]
  node_kafka["Kafka messaging<br/>[kafka.ts]"]
end

node_user(("User"))
node_pandavideo{{"PandaVideo"}}
node_database[("Application database")]

node_user -->|"uploads media"| node_upload_ui
node_upload_state -->|"calls API"| node_eden
node_upload_state -.->|"supports uploads"| node_upload_ui
node_api_app -->|"registers route"| node_upload_api
node_api_app -->|"registers route"| node_batch_api
node_api_app -->|"registers route"| node_tag_api
node_batch_api -->|"reads and writes"| node_db_client
node_batch_api -->|"publishes job"| node_qstash
node_batch_api -->|"publishes messages"| node_kafka
node_tag_api -->|"writes tag"| node_db_client
node_ai_api -->|"reads video"| node_db_client
node_ai_api -->|"requests description"| node_openai
node_transcribe -->|"reads and writes"| node_db_client
node_transcribe -->|"reads audio"| node_r2
node_transcribe -->|"publishes event"| node_qstash
node_transcribe -->|"publishes event"| node_kafka
node_subtitles -->|"reads and updates"| node_db_client
node_subtitles -->|"writes subtitles"| node_r2
node_subtitles -->|"uploads subtitles"| node_pandavideo
node_db_client -.->|"queries"| node_database
node_uploads_ui -->|"fetches library"| node_eden
node_uploads_ui -->|"renders preview"| node_transcript_ui
node_uploads_ui -->|"renders pagination"| node_pagination
node_transcript_ui -->|"fetches transcript"| node_eden
node_search_ui -->|"searches videos"| node_eden
node_format_bytes -->|"reads storage totals"| node_db_client
node_format_bytes -->|"formats sizes"| node_format_util
node_r2 -->|"uses credentials"| node_env
node_db_client -->|"uses database URL"| node_env
node_qstash -->|"uses credentials"| node_env
node_kafka -->|"uses credentials"| node_env
node_eden -->|"uses API URL"| node_env

click node_upload_ui "https://github.com/rocketseat/jupiter/blob/main/src/app/(app)/upload/upload-list/index.tsx"
click node_upload_state "https://github.com/rocketseat/jupiter/blob/main/src/state/uploads.ts"
click node_upload_api "https://github.com/rocketseat/jupiter/blob/main/server/routes/request-video-upload-url.ts"
click node_batch_api "https://github.com/rocketseat/jupiter/blob/main/server/routes/create-upload-batch.ts"
click node_uploads_ui "https://github.com/rocketseat/jupiter/blob/main/src/app/(app)/uploads/page.tsx"
click node_pagination "https://github.com/rocketseat/jupiter/blob/main/src/app/(app)/uploads/uploads-pagination.tsx"
click node_search_ui "https://github.com/rocketseat/jupiter/blob/main/src/components/search.tsx"
click node_video_ui "https://github.com/rocketseat/jupiter/blob/main/src/app/(app)/videos/%5Bid%5D/page.tsx"
click node_transcript_ui "https://github.com/rocketseat/jupiter/blob/main/src/components/transcription-preview.tsx"
click node_tag_api "https://github.com/rocketseat/jupiter/blob/main/server/routes/create-tag.ts"
click node_ai_api "https://github.com/rocketseat/jupiter/blob/main/server/routes/generate-ai-description.ts"
click node_api_app "https://github.com/rocketseat/jupiter/blob/main/server/app.ts"
click node_transcribe "https://github.com/rocketseat/jupiter/blob/main/src/app/api/webhooks/create-video-transcription/route.ts"
click node_subtitles "https://github.com/rocketseat/jupiter/blob/main/src/app/api/webhooks/create-subtitles-from-transcription/route.ts"
click node_r2 "https://github.com/rocketseat/jupiter/blob/main/src/lib/cloudflare-r2.ts"
click node_openai "https://github.com/rocketseat/jupiter/blob/main/src/lib/openai.ts"
click node_db_client "https://github.com/rocketseat/jupiter/blob/main/src/lib/prisma.ts"
click node_qstash "https://github.com/rocketseat/jupiter/blob/main/src/lib/qstash.ts"
click node_kafka "https://github.com/rocketseat/jupiter/blob/main/src/lib/kafka.ts"
click node_format_bytes "https://github.com/rocketseat/jupiter/blob/main/src/components/summary/storage.tsx"
click node_format_util "https://github.com/rocketseat/jupiter/blob/main/src/utils/format-bytes.ts"
click node_env "https://github.com/rocketseat/jupiter/blob/main/src/env.ts"
click node_eden "https://github.com/rocketseat/jupiter/blob/main/src/lib/eden.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_upload_ui,node_upload_state,node_uploads_ui,node_pagination,node_search_ui,node_video_ui,node_transcript_ui,node_format_bytes,node_format_util,node_user toneBlue
class node_upload_api,node_batch_api,node_tag_api,node_ai_api,node_api_app,node_transcribe,node_subtitles,node_database toneAmber
class node_r2,node_openai,node_env,node_eden toneMint
class node_db_client,node_qstash,node_kafka toneRose
class node_pandavideo toneIndigo
```

## Components

### App experience

- [Upload interface](https://github.com/rocketseat/jupiter/blob/main/src/app/(app)/upload/upload-list/index.tsx): `src/app/(app)/upload/upload-list/index.tsx`
- [Upload state](https://github.com/rocketseat/jupiter/blob/main/src/state/uploads.ts): `src/state/uploads.ts`
- [Video library](https://github.com/rocketseat/jupiter/blob/main/src/app/(app)/uploads/page.tsx): `src/app/(app)/uploads/page.tsx`
- [Library pagination](https://github.com/rocketseat/jupiter/blob/main/src/app/(app)/uploads/uploads-pagination.tsx): `src/app/(app)/uploads/uploads-pagination.tsx`
- [Video search](https://github.com/rocketseat/jupiter/blob/main/src/components/search.tsx): `src/components/search.tsx`
- [Video details](https://github.com/rocketseat/jupiter/blob/main/src/app/(app)/videos/%5Bid%5D/page.tsx): `src/app/(app)/videos/[id]/page.tsx`
- [Transcript review](https://github.com/rocketseat/jupiter/blob/main/src/components/transcription-preview.tsx): `src/components/transcription-preview.tsx`
- [Storage summary](https://github.com/rocketseat/jupiter/blob/main/src/components/summary/storage.tsx): `src/components/summary/storage.tsx`
- [Byte formatting](https://github.com/rocketseat/jupiter/blob/main/src/utils/format-bytes.ts): `src/utils/format-bytes.ts`

### API and workflows

- [Upload endpoints](https://github.com/rocketseat/jupiter/blob/main/server/routes/request-video-upload-url.ts): `server/routes/request-video-upload-url.ts`
- [Batch creation](https://github.com/rocketseat/jupiter/blob/main/server/routes/create-upload-batch.ts): `server/routes/create-upload-batch.ts`
- [Tag endpoints](https://github.com/rocketseat/jupiter/blob/main/server/routes/create-tag.ts): `server/routes/create-tag.ts`
- [AI metadata](https://github.com/rocketseat/jupiter/blob/main/server/routes/generate-ai-description.ts): `server/routes/generate-ai-description.ts`
- [API router](https://github.com/rocketseat/jupiter/blob/main/server/app.ts): `server/app.ts`
- [Transcription job](https://github.com/rocketseat/jupiter/blob/main/src/app/api/webhooks/create-video-transcription/route.ts): `src/app/api/webhooks/create-video-transcription/route.ts`
- [Subtitle generation](https://github.com/rocketseat/jupiter/blob/main/src/app/api/webhooks/create-subtitles-from-transcription/route.ts): `src/app/api/webhooks/create-subtitles-from-transcription/route.ts`

### Media and AI services

- [Object storage client](https://github.com/rocketseat/jupiter/blob/main/src/lib/cloudflare-r2.ts): `src/lib/cloudflare-r2.ts`
- [OpenAI service](https://github.com/rocketseat/jupiter/blob/main/src/lib/openai.ts): `src/lib/openai.ts`
- [Runtime configuration](https://github.com/rocketseat/jupiter/blob/main/src/env.ts): `src/env.ts`
- [Typed API client](https://github.com/rocketseat/jupiter/blob/main/src/lib/eden.ts): `src/lib/eden.ts`

### Persistence and messaging

- [Database client](https://github.com/rocketseat/jupiter/blob/main/src/lib/prisma.ts): `src/lib/prisma.ts`
- [QStash messaging](https://github.com/rocketseat/jupiter/blob/main/src/lib/qstash.ts): `src/lib/qstash.ts`
- [Kafka messaging](https://github.com/rocketseat/jupiter/blob/main/src/lib/kafka.ts): `src/lib/kafka.ts`

### Other components

- **User**
- **PandaVideo**
- **Application database**

## Connections

- User → Upload interface: uploads media
- Upload state → Typed API client: calls API (evidence: `src/state/uploads.ts`)
- Upload state → Upload interface: supports uploads
- API router → Upload endpoints: registers route (evidence: `server/app.ts`)
- API router → Batch creation: registers route (evidence: `server/app.ts`)
- API router → Tag endpoints: registers route (evidence: `server/app.ts`)
- Batch creation → Database client: reads and writes (evidence: `server/routes/create-upload-batch.ts`)
- Batch creation → QStash messaging: publishes job (evidence: `server/routes/create-upload-batch.ts`)
- Batch creation → Kafka messaging: publishes messages (evidence: `server/routes/create-upload-batch.ts`)
- Tag endpoints → Database client: writes tag (evidence: `server/routes/create-tag.ts`)
- AI metadata → Database client: reads video (evidence: `server/routes/generate-ai-description.ts`)
- AI metadata → OpenAI service: requests description (evidence: `server/routes/generate-ai-description.ts`)
- Transcription job → Database client: reads and writes (evidence: `src/app/api/webhooks/create-video-transcription/route.ts`)
- Transcription job → Object storage client: reads audio (evidence: `src/app/api/webhooks/create-video-transcription/route.ts`)
- Transcription job → QStash messaging: publishes event (evidence: `src/app/api/webhooks/create-video-transcription/route.ts`)
- Transcription job → Kafka messaging: publishes event (evidence: `src/app/api/webhooks/create-video-transcription/route.ts`)
- Subtitle generation → Database client: reads and updates (evidence: `src/app/api/webhooks/create-subtitles-from-transcription/route.ts`)
- Subtitle generation → Object storage client: writes subtitles (evidence: `src/app/api/webhooks/create-subtitles-from-transcription/route.ts`)
- Subtitle generation → PandaVideo: uploads subtitles (evidence: `src/app/api/webhooks/create-subtitles-from-transcription/route.ts`)
- Database client → Application database: queries
- Video library → Typed API client: fetches library (evidence: `src/app/(app)/uploads/page.tsx`)
- Video library → Transcript review: renders preview (evidence: `src/app/(app)/uploads/page.tsx`)
- Video library → Library pagination: renders pagination (evidence: `src/app/(app)/uploads/page.tsx`)
- Transcript review → Typed API client: fetches transcript (evidence: `src/components/transcription-preview.tsx`)
- Video search → Typed API client: searches videos (evidence: `src/components/search.tsx`)
- Storage summary → Database client: reads storage totals (evidence: `src/components/summary/storage.tsx`)
- Storage summary → Byte formatting: formats sizes (evidence: `src/components/summary/storage.tsx`)
- Object storage client → Runtime configuration: uses credentials (evidence: `src/lib/cloudflare-r2.ts`)
- Database client → Runtime configuration: uses database URL (evidence: `src/lib/prisma.ts`)
- QStash messaging → Runtime configuration: uses credentials (evidence: `src/lib/qstash.ts`)
- Kafka messaging → Runtime configuration: uses credentials (evidence: `src/lib/kafka.ts`)
- Typed API client → Runtime configuration: uses API URL (evidence: `src/lib/eden.ts`)
