# axie22/orbit architecture

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

- Interactive diagram: https://gitdiagram.com/axie22/orbit
- Repository: https://github.com/axie22/orbit

## Overview

Orbit is an interview-practice product: candidates choose a technical problem, work through it in an interactive coding session, and receive AI guidance grounded in problem material. The web app also supports spoken sessions, while a separate worker handles real-time audio and the video pipeline prepares tutorial material for retrieval. The graph reflects the documented product capabilities and sampled call paths; unsampled UI wiring and later video-processing stages are represented only where their directory is supported, without asserting specific calls.

Main entry points: [`livekit-worker/src/index.ts`](https://github.com/axie22/orbit/blob/main/livekit-worker/src/index.ts) (LiveKit worker), [`interv-ai/app/practice/[id]/PracticeSession.tsx`](https://github.com/axie22/orbit/blob/main/interv-ai/app/practice/%5Bid%5D/PracticeSession.tsx) (Practice session), [`video_pipeline/pipelines/ingest.py`](https://github.com/axie22/orbit/blob/main/video_pipeline/pipelines/ingest.py) (Video ingestion), [`interv-ai/app/components/voice/VoiceRecorder.tsx`](https://github.com/axie22/orbit/blob/main/interv-ai/app/components/voice/VoiceRecorder.tsx) (Voice controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Practice experience"]
  node_problemui["Problem selection<br/>[page.tsx]"]
  node_problemcard["Problem preview"]
  node_practice["Practice session"]
  node_editor["Code editor<br/>[CodeEditor.tsx]"]
  node_voiceui["Voice controls<br/>[VoiceRecorder.tsx]"]
end

subgraph group_webapi["Web services"]
  node_problemsapi["Problem listing API<br/>[route.ts]"]
  node_problemapi["Problem detail API<br/>[route.ts]"]
  node_chatapi["Chat API<br/>[route.ts]"]
  node_tokenapi["Room token API<br/>[route.ts]"]
  node_codeapi["Code execution API<br/>[route.ts]"]
  node_lambda["Code runner"]
end

subgraph group_interview["Interview runtime"]
  node_worker["LiveKit worker<br/>[index.ts]"]
  node_workerdb["Worker problem lookup<br/>[db.ts]"]
  node_workerllm["Streaming interviewer<br/>[llm.ts]"]
  node_stt["Google speech recognition"]
  node_tts["ElevenLabs speech synthesis<br/>[tts.ts]"]
  node_fastapi["LLM chat service<br/>[app.py]"]
end

subgraph group_knowledge["Problem knowledge"]
  node_dynamo[("Problem store")]
  node_retriever["Problem retrieval"]
  node_gemini["Gemini generation<br/>[llm_client.py]"]
end

subgraph group_media["Tutorial data"]
  node_ingest["Video ingestion<br/>[ingest.py]"]
  node_videostages["Transcript and media processing"]
  node_s3[("Media asset store")]
end

node_candidate(("Candidate"))

node_candidate -->|"selects problem"| node_problemui
node_problemui -->|"loads problems"| node_problemsapi
node_problemsapi -->|"queries"| node_dynamo
node_candidate -->|"reviews prompt"| node_problemcard
node_problemcard -->|"starts session"| node_practice
node_practice -->|"loads problem"| node_problemapi
node_problemapi -->|"reads problem"| node_dynamo
node_candidate -->|"edits code"| node_editor
node_editor -->|"updates code"| node_practice
node_practice -->|"sends chat"| node_chatapi
node_chatapi -->|"generates reply"| node_gemini
node_candidate -->|"speaks"| node_voiceui
node_voiceui -->|"requests room token"| node_tokenapi
node_tokenapi -->|"dispatches join"| node_worker
node_worker -->|"loads context"| node_workerdb
node_workerdb -->|"reads problem"| node_dynamo
node_worker -->|"streams audio"| node_stt
node_worker -->|"requests response"| node_workerllm
node_workerllm -->|"synthesizes speech"| node_tts
node_worker -->|"publishes audio"| node_voiceui
node_practice -->|"runs code"| node_codeapi
node_codeapi -->|"invokes"| node_lambda
node_fastapi -.->|"gets context"| node_retriever
node_fastapi -.->|"generates reply"| node_gemini
node_retriever -.->|"retrieves problem"| node_dynamo
node_ingest -->|"uploads media"| node_s3
node_ingest -->|"records metadata"| node_dynamo
node_ingest -.->|"prepares media"| node_videostages
node_videostages -.->|"stores assets"| node_s3

click node_problemui "https://github.com/axie22/orbit/blob/main/interv-ai/app/select/page.tsx"
click node_problemcard "https://github.com/axie22/orbit/blob/main/interv-ai/app/components/select/ProblemPreviewCard.tsx"
click node_practice "https://github.com/axie22/orbit/blob/main/interv-ai/app/practice/%5Bid%5D/PracticeSession.tsx"
click node_editor "https://github.com/axie22/orbit/blob/main/interv-ai/app/components/CodeEditor.tsx"
click node_voiceui "https://github.com/axie22/orbit/blob/main/interv-ai/app/components/voice/VoiceRecorder.tsx"
click node_problemsapi "https://github.com/axie22/orbit/blob/main/interv-ai/app/api/problems/route.ts"
click node_problemapi "https://github.com/axie22/orbit/blob/main/interv-ai/app/api/problem/%5Bid%5D/route.ts"
click node_chatapi "https://github.com/axie22/orbit/blob/main/interv-ai/app/api/chat/route.ts"
click node_tokenapi "https://github.com/axie22/orbit/blob/main/interv-ai/app/api/token/route.ts"
click node_codeapi "https://github.com/axie22/orbit/blob/main/interv-ai/app/api/code/run/route.ts"
click node_worker "https://github.com/axie22/orbit/blob/main/livekit-worker/src/index.ts"
click node_workerdb "https://github.com/axie22/orbit/blob/main/livekit-worker/src/db.ts"
click node_workerllm "https://github.com/axie22/orbit/blob/main/livekit-worker/src/llm.ts"
click node_tts "https://github.com/axie22/orbit/blob/main/livekit-worker/src/tts.ts"
click node_fastapi "https://github.com/axie22/orbit/blob/main/LLM/app.py"
click node_retriever "https://github.com/axie22/orbit/blob/main/LLM/src/problem_retriever.py"
click node_gemini "https://github.com/axie22/orbit/blob/main/LLM/src/llm_client.py"
click node_ingest "https://github.com/axie22/orbit/blob/main/video_pipeline/pipelines/ingest.py"
click node_videostages "https://github.com/axie22/orbit/tree/main/video_pipeline/pipelines"

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_problemui,node_problemcard,node_practice,node_editor,node_voiceui toneBlue
class node_problemsapi,node_problemapi,node_chatapi,node_tokenapi,node_codeapi,node_lambda toneAmber
class node_worker,node_workerdb,node_workerllm,node_stt,node_tts,node_fastapi toneMint
class node_dynamo,node_retriever,node_gemini toneRose
class node_ingest,node_videostages,node_s3,node_candidate toneIndigo
```

## Components

### Practice experience

- [Problem selection](https://github.com/axie22/orbit/blob/main/interv-ai/app/select/page.tsx): `interv-ai/app/select/page.tsx`
- [Problem preview](https://github.com/axie22/orbit/blob/main/interv-ai/app/components/select/ProblemPreviewCard.tsx): `interv-ai/app/components/select/ProblemPreviewCard.tsx`
- [Practice session](https://github.com/axie22/orbit/blob/main/interv-ai/app/practice/%5Bid%5D/PracticeSession.tsx): `interv-ai/app/practice/[id]/PracticeSession.tsx`
- [Code editor](https://github.com/axie22/orbit/blob/main/interv-ai/app/components/CodeEditor.tsx): `interv-ai/app/components/CodeEditor.tsx`
- [Voice controls](https://github.com/axie22/orbit/blob/main/interv-ai/app/components/voice/VoiceRecorder.tsx): `interv-ai/app/components/voice/VoiceRecorder.tsx`

### Web services

- [Problem listing API](https://github.com/axie22/orbit/blob/main/interv-ai/app/api/problems/route.ts): `interv-ai/app/api/problems/route.ts`
- [Problem detail API](https://github.com/axie22/orbit/blob/main/interv-ai/app/api/problem/%5Bid%5D/route.ts): `interv-ai/app/api/problem/[id]/route.ts`
- [Chat API](https://github.com/axie22/orbit/blob/main/interv-ai/app/api/chat/route.ts): `interv-ai/app/api/chat/route.ts`
- [Room token API](https://github.com/axie22/orbit/blob/main/interv-ai/app/api/token/route.ts): `interv-ai/app/api/token/route.ts`
- [Code execution API](https://github.com/axie22/orbit/blob/main/interv-ai/app/api/code/run/route.ts): `interv-ai/app/api/code/run/route.ts`
- **Code runner**

### Interview runtime

- [LiveKit worker](https://github.com/axie22/orbit/blob/main/livekit-worker/src/index.ts): `livekit-worker/src/index.ts`
- [Worker problem lookup](https://github.com/axie22/orbit/blob/main/livekit-worker/src/db.ts): `livekit-worker/src/db.ts`
- [Streaming interviewer](https://github.com/axie22/orbit/blob/main/livekit-worker/src/llm.ts): `livekit-worker/src/llm.ts`
- **Google speech recognition**
- [ElevenLabs speech synthesis](https://github.com/axie22/orbit/blob/main/livekit-worker/src/tts.ts): `livekit-worker/src/tts.ts`
- [LLM chat service](https://github.com/axie22/orbit/blob/main/LLM/app.py): `LLM/app.py`

### Problem knowledge

- **Problem store**
- [Problem retrieval](https://github.com/axie22/orbit/blob/main/LLM/src/problem_retriever.py): `LLM/src/problem_retriever.py`
- [Gemini generation](https://github.com/axie22/orbit/blob/main/LLM/src/llm_client.py): `LLM/src/llm_client.py`

### Tutorial data

- [Video ingestion](https://github.com/axie22/orbit/blob/main/video_pipeline/pipelines/ingest.py): `video_pipeline/pipelines/ingest.py`
- [Transcript and media processing](https://github.com/axie22/orbit/tree/main/video_pipeline/pipelines): `video_pipeline/pipelines`
- **Media asset store**

### Other components

- **Candidate**

## Connections

- Candidate → Problem selection: selects problem
- Problem selection → Problem listing API: loads problems
- Problem listing API → Problem store: queries
- Candidate → Problem preview: reviews prompt
- Problem preview → Practice session: starts session
- Practice session → Problem detail API: loads problem
- Problem detail API → Problem store: reads problem
- Candidate → Code editor: edits code
- Code editor → Practice session: updates code
- Practice session → Chat API: sends chat
- Chat API → Gemini generation: generates reply
- Candidate → Voice controls: speaks
- Voice controls → Room token API: requests room token
- Room token API → LiveKit worker: dispatches join
- LiveKit worker → Worker problem lookup: loads context
- Worker problem lookup → Problem store: reads problem
- LiveKit worker → Google speech recognition: streams audio
- LiveKit worker → Streaming interviewer: requests response
- Streaming interviewer → ElevenLabs speech synthesis: synthesizes speech
- LiveKit worker → Voice controls: publishes audio
- Practice session → Code execution API: runs code
- Code execution API → Code runner: invokes
- LLM chat service → Problem retrieval: gets context
- LLM chat service → Gemini generation: generates reply
- Problem retrieval → Problem store: retrieves problem
- Video ingestion → Media asset store: uploads media
- Video ingestion → Problem store: records metadata
- Video ingestion → Transcript and media processing: prepares media
- Transcript and media processing → Media asset store: stores assets
