# purvanshbhatt/interview-ghost architecture

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

- Interactive diagram: https://gitdiagram.com/purvanshbhatt/interview-ghost
- Repository: https://github.com/purvanshbhatt/interview-ghost

## Overview

Ghost is a multi-surface interview and meeting copilot: users capture screen and/or conversation audio, choose an assistance mode, receive streamed AI suggestions, and can retain transcripts or meeting notes. Desktop orchestration is centered in `main.js`; the extension and mobile app have separate capture, AI, and storage paths. The README documents additional modes and platform features not fully represented in the sampled source; those are included where their source paths are supported, without asserting unsampled call wiring.

Main entry points: [`main.js`](https://github.com/purvanshbhatt/interview-ghost/blob/main/main.js) (Session orchestration), [`mobile/src/screens/SessionScreen.tsx`](https://github.com/purvanshbhatt/interview-ghost/blob/main/mobile/src/screens/SessionScreen.tsx) (Live session), [`extension/background/service_worker.js`](https://github.com/purvanshbhatt/interview-ghost/blob/main/extension/background/service_worker.js) (Capture and suggestion control), [`extension/lib/llm-client.js`](https://github.com/purvanshbhatt/interview-ghost/blob/main/extension/lib/llm-client.js) (Provider streaming)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop App"]
  node_desktop_main["Session orchestration<br/>[main.js]"]
  node_desktop_ui["HUD and dashboard<br/>[renderer.js]"]
  node_desktop_screen["Screen context<br/>[screen.js]"]
  node_desktop_stt["Speech transcription<br/>[stt.js]"]
  node_desktop_local["Local Whisper"]
  node_desktop_models["Whisper models"]
  node_desktop_context["Interview context<br/>[context.js]"]
  node_desktop_llm["LLM streaming<br/>[llm.js]"]
  node_desktop_notes["Notes and transcripts<br/>[notes.js]"]
  node_desktop_store["Session state<br/>[store.js]"]
end

subgraph group_extension["Browser Extension"]
  node_ext_content["Meeting-tab HUD<br/>[content.js]"]
  node_ext_worker["Capture and suggestion control<br/>[service_worker.js]"]
  node_ext_audio["Tab audio capture<br/>[offscreen.js]"]
  node_ext_llm["Provider streaming<br/>[llm-client.js]"]
  node_ext_prompt["Mode prompts<br/>[prompts.js]"]
  node_ext_storage[("Settings and session<br/>[storage.js]")]
end

subgraph group_mobile["Mobile App"]
  node_mobile_app["Mobile navigation<br/>[App.tsx]"]
  node_mobile_session["Live session<br/>[SessionScreen.tsx]"]
  node_mobile_audio["Audio capture<br/>[audio-capture.ts]"]
  node_mobile_stt["Audio transcription<br/>[stt-service.ts]"]
  node_mobile_context["Interview context<br/>[context-builder.ts]"]
  node_mobile_llm["LLM streaming<br/>[llm-service.ts]"]
  node_mobile_prompt["Mode prompts<br/>[prompts.ts]"]
  node_mobile_storage[("Settings and sessions<br/>[storage.ts]")]
end

node_desktop_user(("Desktop user"))
node_ai_provider(("AI providers"))
node_extension_user(("Browser user"))
node_mobile_user(("Mobile user"))

node_desktop_user -->|"uses"| node_desktop_ui
node_desktop_ui -->|"sends actions"| node_desktop_main
node_desktop_main -->|"captures context"| node_desktop_screen
node_desktop_main -->|"transcribes audio"| node_desktop_stt
node_desktop_main -->|"routes local audio"| node_desktop_local
node_desktop_main -->|"manages models"| node_desktop_models
node_desktop_main -->|"builds context"| node_desktop_context
node_desktop_main -->|"requests suggestions"| node_desktop_llm
node_desktop_llm -->|"streams requests"| node_ai_provider
node_desktop_main -->|"persists notes"| node_desktop_notes
node_desktop_main -->|"updates state"| node_desktop_store
node_desktop_main -->|"sends updates"| node_desktop_ui
node_extension_user -->|"uses"| node_ext_content
node_ext_content -->|"sends actions"| node_ext_worker
node_ext_worker -->|"starts capture"| node_ext_audio
node_ext_audio -->|"sends transcript"| node_ext_worker
node_ext_worker -->|"requests suggestions"| node_ext_llm
node_ext_llm -->|"builds prompt"| node_ext_prompt
node_ext_llm -->|"streams requests"| node_ai_provider
node_ext_worker -->|"reads and writes"| node_ext_storage
node_ext_worker -->|"dispatches updates"| node_ext_content
node_mobile_user -->|"uses"| node_mobile_app
node_mobile_app -->|"opens session"| node_mobile_session
node_mobile_session -->|"captures audio"| node_mobile_audio
node_mobile_session -->|"transcribes audio"| node_mobile_stt
node_mobile_session -->|"builds context"| node_mobile_context
node_mobile_session -->|"requests suggestions"| node_mobile_llm
node_mobile_llm -->|"builds prompt"| node_mobile_prompt
node_mobile_llm -->|"streams requests"| node_ai_provider
node_mobile_session -->|"saves session"| node_mobile_storage
node_mobile_app -->|"loads settings"| node_mobile_storage

click node_desktop_main "https://github.com/purvanshbhatt/interview-ghost/blob/main/main.js"
click node_desktop_ui "https://github.com/purvanshbhatt/interview-ghost/blob/main/renderer/renderer.js"
click node_desktop_screen "https://github.com/purvanshbhatt/interview-ghost/blob/main/src/screen.js"
click node_desktop_stt "https://github.com/purvanshbhatt/interview-ghost/blob/main/src/stt.js"
click node_desktop_local "https://github.com/purvanshbhatt/interview-ghost/blob/main/src/local-whisper-transcriber.js"
click node_desktop_models "https://github.com/purvanshbhatt/interview-ghost/blob/main/src/whisper-model-manager.js"
click node_desktop_context "https://github.com/purvanshbhatt/interview-ghost/blob/main/src/context.js"
click node_desktop_llm "https://github.com/purvanshbhatt/interview-ghost/blob/main/src/llm.js"
click node_desktop_notes "https://github.com/purvanshbhatt/interview-ghost/blob/main/src/notes.js"
click node_desktop_store "https://github.com/purvanshbhatt/interview-ghost/blob/main/src/store.js"
click node_ext_content "https://github.com/purvanshbhatt/interview-ghost/blob/main/extension/content/content.js"
click node_ext_worker "https://github.com/purvanshbhatt/interview-ghost/blob/main/extension/background/service_worker.js"
click node_ext_audio "https://github.com/purvanshbhatt/interview-ghost/blob/main/extension/offscreen/offscreen.js"
click node_ext_llm "https://github.com/purvanshbhatt/interview-ghost/blob/main/extension/lib/llm-client.js"
click node_ext_prompt "https://github.com/purvanshbhatt/interview-ghost/blob/main/extension/lib/prompts.js"
click node_ext_storage "https://github.com/purvanshbhatt/interview-ghost/blob/main/extension/lib/storage.js"
click node_mobile_app "https://github.com/purvanshbhatt/interview-ghost/blob/main/mobile/App.tsx"
click node_mobile_session "https://github.com/purvanshbhatt/interview-ghost/blob/main/mobile/src/screens/SessionScreen.tsx"
click node_mobile_audio "https://github.com/purvanshbhatt/interview-ghost/blob/main/mobile/src/services/audio-capture.ts"
click node_mobile_stt "https://github.com/purvanshbhatt/interview-ghost/blob/main/mobile/src/services/stt-service.ts"
click node_mobile_context "https://github.com/purvanshbhatt/interview-ghost/blob/main/mobile/src/services/context-builder.ts"
click node_mobile_llm "https://github.com/purvanshbhatt/interview-ghost/blob/main/mobile/src/services/llm-service.ts"
click node_mobile_prompt "https://github.com/purvanshbhatt/interview-ghost/blob/main/mobile/src/services/prompts.ts"
click node_mobile_storage "https://github.com/purvanshbhatt/interview-ghost/blob/main/mobile/src/services/storage.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_desktop_main,node_desktop_ui,node_desktop_screen,node_desktop_stt,node_desktop_local,node_desktop_models,node_desktop_context,node_desktop_llm,node_desktop_notes,node_desktop_store,node_desktop_user,node_extension_user,node_mobile_user toneBlue
class node_ext_content,node_ext_worker,node_ext_audio,node_ext_llm,node_ext_prompt,node_ext_storage toneAmber
class node_mobile_app,node_mobile_session,node_mobile_audio,node_mobile_stt,node_mobile_context,node_mobile_llm,node_mobile_prompt,node_mobile_storage toneMint
class node_ai_provider toneIndigo
```

## Components

### Desktop App

- [Session orchestration](https://github.com/purvanshbhatt/interview-ghost/blob/main/main.js): `main.js`
- [HUD and dashboard](https://github.com/purvanshbhatt/interview-ghost/blob/main/renderer/renderer.js): `renderer/renderer.js`
- [Screen context](https://github.com/purvanshbhatt/interview-ghost/blob/main/src/screen.js): `src/screen.js`
- [Speech transcription](https://github.com/purvanshbhatt/interview-ghost/blob/main/src/stt.js): `src/stt.js`
- [Local Whisper](https://github.com/purvanshbhatt/interview-ghost/blob/main/src/local-whisper-transcriber.js): `src/local-whisper-transcriber.js`
- [Whisper models](https://github.com/purvanshbhatt/interview-ghost/blob/main/src/whisper-model-manager.js): `src/whisper-model-manager.js`
- [Interview context](https://github.com/purvanshbhatt/interview-ghost/blob/main/src/context.js): `src/context.js`
- [LLM streaming](https://github.com/purvanshbhatt/interview-ghost/blob/main/src/llm.js): `src/llm.js`
- [Notes and transcripts](https://github.com/purvanshbhatt/interview-ghost/blob/main/src/notes.js): `src/notes.js`
- [Session state](https://github.com/purvanshbhatt/interview-ghost/blob/main/src/store.js): `src/store.js`

### Browser Extension

- [Meeting-tab HUD](https://github.com/purvanshbhatt/interview-ghost/blob/main/extension/content/content.js): `extension/content/content.js`
- [Capture and suggestion control](https://github.com/purvanshbhatt/interview-ghost/blob/main/extension/background/service_worker.js): `extension/background/service_worker.js`
- [Tab audio capture](https://github.com/purvanshbhatt/interview-ghost/blob/main/extension/offscreen/offscreen.js): `extension/offscreen/offscreen.js`
- [Provider streaming](https://github.com/purvanshbhatt/interview-ghost/blob/main/extension/lib/llm-client.js): `extension/lib/llm-client.js`
- [Mode prompts](https://github.com/purvanshbhatt/interview-ghost/blob/main/extension/lib/prompts.js): `extension/lib/prompts.js`
- [Settings and session](https://github.com/purvanshbhatt/interview-ghost/blob/main/extension/lib/storage.js): `extension/lib/storage.js`

### Mobile App

- [Mobile navigation](https://github.com/purvanshbhatt/interview-ghost/blob/main/mobile/App.tsx): `mobile/App.tsx`
- [Live session](https://github.com/purvanshbhatt/interview-ghost/blob/main/mobile/src/screens/SessionScreen.tsx): `mobile/src/screens/SessionScreen.tsx`
- [Audio capture](https://github.com/purvanshbhatt/interview-ghost/blob/main/mobile/src/services/audio-capture.ts): `mobile/src/services/audio-capture.ts`
- [Audio transcription](https://github.com/purvanshbhatt/interview-ghost/blob/main/mobile/src/services/stt-service.ts): `mobile/src/services/stt-service.ts`
- [Interview context](https://github.com/purvanshbhatt/interview-ghost/blob/main/mobile/src/services/context-builder.ts): `mobile/src/services/context-builder.ts`
- [LLM streaming](https://github.com/purvanshbhatt/interview-ghost/blob/main/mobile/src/services/llm-service.ts): `mobile/src/services/llm-service.ts`
- [Mode prompts](https://github.com/purvanshbhatt/interview-ghost/blob/main/mobile/src/services/prompts.ts): `mobile/src/services/prompts.ts`
- [Settings and sessions](https://github.com/purvanshbhatt/interview-ghost/blob/main/mobile/src/services/storage.ts): `mobile/src/services/storage.ts`

### Other components

- **Desktop user**
- **AI providers**
- **Browser user**
- **Mobile user**

## Connections

- Desktop user → HUD and dashboard: uses
- HUD and dashboard → Session orchestration: sends actions
- Session orchestration → Screen context: captures context
- Session orchestration → Speech transcription: transcribes audio
- Session orchestration → Local Whisper: routes local audio
- Session orchestration → Whisper models: manages models
- Session orchestration → Interview context: builds context
- Session orchestration → LLM streaming: requests suggestions
- LLM streaming → AI providers: streams requests
- Session orchestration → Notes and transcripts: persists notes
- Session orchestration → Session state: updates state
- Session orchestration → HUD and dashboard: sends updates
- Browser user → Meeting-tab HUD: uses
- Meeting-tab HUD → Capture and suggestion control: sends actions
- Capture and suggestion control → Tab audio capture: starts capture
- Tab audio capture → Capture and suggestion control: sends transcript
- Capture and suggestion control → Provider streaming: requests suggestions
- Provider streaming → Mode prompts: builds prompt
- Provider streaming → AI providers: streams requests
- Capture and suggestion control → Settings and session: reads and writes
- Capture and suggestion control → Meeting-tab HUD: dispatches updates
- Mobile user → Mobile navigation: uses
- Mobile navigation → Live session: opens session
- Live session → Audio capture: captures audio
- Live session → Audio transcription: transcribes audio
- Live session → Interview context: builds context
- Live session → LLM streaming: requests suggestions
- LLM streaming → Mode prompts: builds prompt
- LLM streaming → AI providers: streams requests
- Live session → Settings and sessions: saves session
- Mobile navigation → Settings and sessions: loads settings
