# innovatorved/realtime-interview-copilot architecture

> Architecture diagram of the GitHub repository innovatorved/realtime-interview-copilot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/innovatorved/realtime-interview-copilot
- Repository: https://github.com/innovatorved/realtime-interview-copilot

## Overview

Realtime Interview Copilot is a desktop interview-assistance app: users capture system audio for live transcription, then request AI answers from transcript text, typed questions, or screenshots. The desktop shell hosts full and compact interfaces; shared context, authentication, notes, and history support the session. A Worker API provides completion, transcription, and account features, with a database-backed admin surface. The README documents the main capabilities; several UI and route implementations were not sampled, so those relationships are omitted or marked unverified.

Main entry points: [`realtime-worker-api/src/index.ts`](https://github.com/innovatorved/realtime-interview-copilot/blob/main/realtime-worker-api/src/index.ts) (Worker dispatcher), [`components/main.tsx`](https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/main.tsx) (App workspace), [`lib/transcription/deepgramSession.ts`](https://github.com/innovatorved/realtime-interview-copilot/blob/main/lib/transcription/deepgramSession.ts) (Live transcription), [`electron/main.ts`](https://github.com/innovatorved/realtime-interview-copilot/blob/main/electron/main.ts) (Electron shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop runtime"]
  node_electron["Electron shell<br/>[main.ts]"]
  node_ipc["Desktop IPC"]
end

subgraph group_experience["Interview experience"]
  node_app["App workspace<br/>[main.tsx]"]
  node_capture["Audio capture<br/>[recorder.tsx]"]
  node_transcription["Live transcription<br/>[deepgramSession.ts]"]
  node_transcriptview["Transcript display"]
  node_fullcopilot["Copilot and Ask"]
  node_compact["Compact overlay<br/>[CompactCopilot.tsx]"]
  node_generate["Compact generation"]
  node_interviewcontext["Interview context"]
  node_notes["Notes and export<br/>[useNotes.ts]"]
  node_history["Answer history<br/>[History.tsx]"]
end

subgraph group_backend["Worker API"]
  node_api["Worker dispatcher<br/>[index.ts]"]
  node_completion["AI completion<br/>[completion.ts]"]
  node_deepgram["Transcription service route<br/>[deepgram.ts]"]
  node_sessionapi["Session and context routes<br/>[sessions.ts]"]
  node_notesapi["Notes and export routes<br/>[notes.ts]"]
end

subgraph group_operations["Account and operations"]
  node_auth["Authentication<br/>[auth-client.ts]"]
  node_authui["Sign-in flow<br/>[auth-wizard.tsx]"]
  node_admin["Admin operations"]
  node_db[("Worker database<br/>[schema.ts]")]
end

node_user(("Interview user"))
node_ai["AI providers"]
node_speech["Deepgram"]

node_user -->|"uses"| node_app
node_electron -->|"registers handlers"| node_ipc
node_electron -->|"loads interface"| node_app
node_app -.->|"presents capture"| node_capture
node_capture -.->|"streams audio"| node_transcription
node_transcription -.->|"transcribes audio"| node_speech
node_transcription -.->|"updates transcript"| node_transcriptview
node_app -->|"renders"| node_fullcopilot
node_app -->|"renders"| node_compact
node_compact -.->|"uses generation"| node_generate
node_generate -.->|"requests completion"| node_api
node_fullcopilot -.->|"requests answers"| node_api
node_api -->|"routes requests"| node_completion
node_completion -.->|"forwards prompts"| node_ai
node_api -->|"routes requests"| node_deepgram
node_interviewcontext -->|"loads and saves context"| node_api
node_api -->|"routes sessions"| node_sessionapi
node_notes -.->|"requests notes"| node_api
node_api -->|"routes notes"| node_notesapi
node_user -->|"signs in"| node_authui
node_authui -->|"authenticates"| node_auth
node_auth -->|"uses auth endpoint"| node_api
node_admin -->|"queries users"| node_db
node_admin -.->|"checks provider health"| node_ai
node_history -.->|"shown in workspace"| node_app

click node_electron "https://github.com/innovatorved/realtime-interview-copilot/blob/main/electron/main.ts"
click node_ipc "https://github.com/innovatorved/realtime-interview-copilot/tree/main/electron/ipc"
click node_app "https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/main.tsx"
click node_capture "https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/recorder.tsx"
click node_transcription "https://github.com/innovatorved/realtime-interview-copilot/blob/main/lib/transcription/deepgramSession.ts"
click node_transcriptview "https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/TranscriptionContext.tsx"
click node_fullcopilot "https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/QuestionAssistant.tsx"
click node_compact "https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/CompactCopilot.tsx"
click node_generate "https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/compact/useCompactGenerate.ts"
click node_interviewcontext "https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/InterviewContextProvider.tsx"
click node_notes "https://github.com/innovatorved/realtime-interview-copilot/blob/main/hooks/useNotes.ts"
click node_history "https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/History.tsx"
click node_api "https://github.com/innovatorved/realtime-interview-copilot/blob/main/realtime-worker-api/src/index.ts"
click node_completion "https://github.com/innovatorved/realtime-interview-copilot/blob/main/realtime-worker-api/src/routes/completion.ts"
click node_deepgram "https://github.com/innovatorved/realtime-interview-copilot/blob/main/realtime-worker-api/src/routes/deepgram.ts"
click node_sessionapi "https://github.com/innovatorved/realtime-interview-copilot/blob/main/realtime-worker-api/src/routes/sessions.ts"
click node_notesapi "https://github.com/innovatorved/realtime-interview-copilot/blob/main/realtime-worker-api/src/routes/notes.ts"
click node_auth "https://github.com/innovatorved/realtime-interview-copilot/blob/main/lib/auth-client.ts"
click node_authui "https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/auth/auth-wizard.tsx"
click node_admin "https://github.com/innovatorved/realtime-interview-copilot/tree/main/realtime-worker-api/src/plugins/self-hosted-admin"
click node_db "https://github.com/innovatorved/realtime-interview-copilot/blob/main/realtime-worker-api/src/db/schema.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_electron,node_ipc,node_user toneBlue
class node_app,node_capture,node_transcription,node_transcriptview,node_fullcopilot,node_compact,node_generate,node_interviewcontext,node_notes,node_history toneAmber
class node_api,node_completion,node_deepgram,node_sessionapi,node_notesapi toneMint
class node_auth,node_authui,node_admin,node_db toneRose
class node_ai,node_speech toneIndigo
```

## Components

### Desktop runtime

- [Electron shell](https://github.com/innovatorved/realtime-interview-copilot/blob/main/electron/main.ts): `electron/main.ts`
- [Desktop IPC](https://github.com/innovatorved/realtime-interview-copilot/tree/main/electron/ipc): `electron/ipc`

### Interview experience

- [App workspace](https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/main.tsx): `components/main.tsx`
- [Audio capture](https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/recorder.tsx): `components/recorder.tsx`
- [Live transcription](https://github.com/innovatorved/realtime-interview-copilot/blob/main/lib/transcription/deepgramSession.ts): `lib/transcription/deepgramSession.ts`
- [Transcript display](https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/TranscriptionContext.tsx): `components/TranscriptionContext.tsx`
- [Copilot and Ask](https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/QuestionAssistant.tsx): `components/QuestionAssistant.tsx`
- [Compact overlay](https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/CompactCopilot.tsx): `components/CompactCopilot.tsx`
- [Compact generation](https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/compact/useCompactGenerate.ts): `components/compact/useCompactGenerate.ts`
- [Interview context](https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/InterviewContextProvider.tsx): `components/InterviewContextProvider.tsx`
- [Notes and export](https://github.com/innovatorved/realtime-interview-copilot/blob/main/hooks/useNotes.ts): `hooks/useNotes.ts`
- [Answer history](https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/History.tsx): `components/History.tsx`

### Worker API

- [Worker dispatcher](https://github.com/innovatorved/realtime-interview-copilot/blob/main/realtime-worker-api/src/index.ts): `realtime-worker-api/src/index.ts`
- [AI completion](https://github.com/innovatorved/realtime-interview-copilot/blob/main/realtime-worker-api/src/routes/completion.ts): `realtime-worker-api/src/routes/completion.ts`
- [Transcription service route](https://github.com/innovatorved/realtime-interview-copilot/blob/main/realtime-worker-api/src/routes/deepgram.ts): `realtime-worker-api/src/routes/deepgram.ts`
- [Session and context routes](https://github.com/innovatorved/realtime-interview-copilot/blob/main/realtime-worker-api/src/routes/sessions.ts): `realtime-worker-api/src/routes/sessions.ts`
- [Notes and export routes](https://github.com/innovatorved/realtime-interview-copilot/blob/main/realtime-worker-api/src/routes/notes.ts): `realtime-worker-api/src/routes/notes.ts`

### Account and operations

- [Authentication](https://github.com/innovatorved/realtime-interview-copilot/blob/main/lib/auth-client.ts): `lib/auth-client.ts`
- [Sign-in flow](https://github.com/innovatorved/realtime-interview-copilot/blob/main/components/auth/auth-wizard.tsx): `components/auth/auth-wizard.tsx`
- [Admin operations](https://github.com/innovatorved/realtime-interview-copilot/tree/main/realtime-worker-api/src/plugins/self-hosted-admin): `realtime-worker-api/src/plugins/self-hosted-admin`
- [Worker database](https://github.com/innovatorved/realtime-interview-copilot/blob/main/realtime-worker-api/src/db/schema.ts): `realtime-worker-api/src/db/schema.ts`

### Other components

- **Interview user**
- **AI providers**
- **Deepgram**

## Connections

- Interview user → App workspace: uses (evidence: `README.md`)
- Electron shell → Desktop IPC: registers handlers (evidence: `electron/main.ts`)
- Electron shell → App workspace: loads interface (evidence: `electron/main.ts`)
- App workspace → Audio capture: presents capture
- Audio capture → Live transcription: streams audio
- Live transcription → Deepgram: transcribes audio
- Live transcription → Transcript display: updates transcript
- App workspace → Copilot and Ask: renders (evidence: `components/main.tsx`)
- App workspace → Compact overlay: renders (evidence: `components/main.tsx`)
- Compact overlay → Compact generation: uses generation
- Compact generation → Worker dispatcher: requests completion
- Copilot and Ask → Worker dispatcher: requests answers
- Worker dispatcher → AI completion: routes requests (evidence: `realtime-worker-api/src/index.ts`)
- AI completion → AI providers: forwards prompts
- Worker dispatcher → Transcription service route: routes requests (evidence: `realtime-worker-api/src/index.ts`)
- Interview context → Worker dispatcher: loads and saves context (evidence: `components/InterviewContextProvider.tsx`)
- Worker dispatcher → Session and context routes: routes sessions (evidence: `realtime-worker-api/src/index.ts`)
- Notes and export → Worker dispatcher: requests notes
- Worker dispatcher → Notes and export routes: routes notes (evidence: `realtime-worker-api/src/index.ts`)
- Interview user → Sign-in flow: signs in (evidence: `README.md`)
- Sign-in flow → Authentication: authenticates (evidence: `components/auth/auth-wizard.tsx`)
- Authentication → Worker dispatcher: uses auth endpoint (evidence: `lib/auth-client.ts`)
- Admin operations → Worker database: queries users (evidence: `realtime-worker-api/src/plugins/self-hosted-admin/endpoints/ai-gateway-routes.ts`)
- Admin operations → AI providers: checks provider health
- Answer history → App workspace: shown in workspace (evidence: `components/main.tsx`)
