# quanquejztr/job-answer-extension architecture

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

- Interactive diagram: https://gitdiagram.com/quanquejztr/job-answer-extension
- Repository: https://github.com/quanquejztr/job-answer-extension

## Overview

Job Answer Extension is described as a personal macOS Chrome extension for drafting one answer to a selected job-application question; the user reviews it and explicitly inserts it. The README also calls the repository a scaffold with placeholder entrypoints, which conflicts with the sampled feature modules, so this map shows the evident extension and native-helper responsibilities without assuming unsampled wiring. Dashed, uncited links mark likely runtime connections not established by the excerpts or SOURCE INDEX.

Main entry points: [`extension/entrypoints/background.ts`](https://github.com/quanquejztr/job-answer-extension/blob/main/extension/entrypoints/background.ts) (Extension worker), [`extension/entrypoints/sidepanel/App.tsx`](https://github.com/quanquejztr/job-answer-extension/blob/main/extension/entrypoints/sidepanel/App.tsx) (Review panel), [`extension/lib/native/native-client.ts`](https://github.com/quanquejztr/job-answer-extension/blob/main/extension/lib/native/native-client.ts) (Native messaging), [`helper/internal/host/host.go`](https://github.com/quanquejztr/job-answer-extension/blob/main/helper/internal/host/host.go) (Native host)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and insertion"]
  node_capture_scripts["Page capture<br/>[content.ts]"]
  node_worker["Extension worker<br/>[background.ts]"]
  node_targeting["Field targeting"]
  node_insertion["Answer insertion"]
end

subgraph group_panel["Drafting experience"]
  node_panel["Review panel<br/>[App.tsx]"]
  node_panel_state["Panel state view<br/>[PanelStateView.tsx]"]
  node_draft["Draft controller"]
end

subgraph group_profile["Profile and settings"]
  node_profile_ui["Profile settings"]
  node_provider_ui["Provider settings"]
  node_profile_client["Profile client<br/>[profile-client.ts]"]
  node_profile_service["Profile service<br/>[profile-service.ts]"]
  node_diagnostics["Provider diagnostics"]
end

subgraph group_helper["Native helper"]
  node_profile_store[("Profile storage<br/>[store.go]")]
  node_native_client["Native messaging<br/>[native-client.ts]"]
  node_helper_host["Native host<br/>[host.go]"]
  node_provider["Provider adapters"]
end

node_user(("User"))
node_page["Job page"]

node_user -->|"selects question"| node_page
node_page -.->|"captures question"| node_capture_scripts
node_capture_scripts -.->|"reports capture"| node_worker
node_worker -.->|"resolves field"| node_targeting
node_worker -.->|"updates state"| node_panel
node_panel -->|"renders state"| node_panel_state
node_panel -->|"requests draft"| node_worker
node_worker -.->|"starts draft"| node_draft
node_draft -->|"requests generation"| node_native_client
node_native_client -.->|"sends native request"| node_helper_host
node_helper_host -.->|"dispatches provider"| node_provider
node_user -->|"reviews draft"| node_panel
node_panel -->|"requests insertion"| node_worker
node_worker -.->|"starts insertion"| node_insertion
node_insertion -->|"inserts answer"| node_page
node_user -.->|"configures profile"| node_profile_ui
node_profile_ui -->|"calls profile API"| node_profile_client
node_provider_ui -.->|"saves provider"| node_profile_client
node_profile_client -.->|"sends profile requests"| node_native_client
node_helper_host -.->|"handles profile requests"| node_profile_service
node_profile_service -.->|"reads and writes"| node_profile_store
node_provider_ui -.->|"runs diagnostics"| node_diagnostics
node_diagnostics -->|"requests diagnostics"| node_native_client

click node_capture_scripts "https://github.com/quanquejztr/job-answer-extension/blob/main/extension/entrypoints/content.ts"
click node_worker "https://github.com/quanquejztr/job-answer-extension/blob/main/extension/entrypoints/background.ts"
click node_targeting "https://github.com/quanquejztr/job-answer-extension/tree/main/extension/lib/targeting"
click node_insertion "https://github.com/quanquejztr/job-answer-extension/tree/main/extension/lib/insertion"
click node_panel "https://github.com/quanquejztr/job-answer-extension/blob/main/extension/entrypoints/sidepanel/App.tsx"
click node_panel_state "https://github.com/quanquejztr/job-answer-extension/blob/main/extension/components/PanelStateView.tsx"
click node_draft "https://github.com/quanquejztr/job-answer-extension/blob/main/extension/lib/draft/draft-controller.ts"
click node_profile_ui "https://github.com/quanquejztr/job-answer-extension/blob/main/extension/components/profile/ProfileSettings.tsx"
click node_provider_ui "https://github.com/quanquejztr/job-answer-extension/blob/main/extension/components/ProviderSettings.tsx"
click node_profile_client "https://github.com/quanquejztr/job-answer-extension/blob/main/extension/lib/profile/profile-client.ts"
click node_profile_service "https://github.com/quanquejztr/job-answer-extension/blob/main/extension/lib/profile/profile-service.ts"
click node_profile_store "https://github.com/quanquejztr/job-answer-extension/blob/main/helper/internal/profile/store.go"
click node_native_client "https://github.com/quanquejztr/job-answer-extension/blob/main/extension/lib/native/native-client.ts"
click node_helper_host "https://github.com/quanquejztr/job-answer-extension/blob/main/helper/internal/host/host.go"
click node_provider "https://github.com/quanquejztr/job-answer-extension/tree/main/helper/internal/provider"
click node_diagnostics "https://github.com/quanquejztr/job-answer-extension/blob/main/extension/lib/diagnostics/diagnostics-service.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_capture_scripts,node_worker,node_targeting,node_insertion,node_user toneBlue
class node_panel,node_panel_state,node_draft toneAmber
class node_profile_ui,node_provider_ui,node_profile_client,node_profile_service,node_diagnostics toneMint
class node_profile_store,node_native_client,node_helper_host,node_provider toneRose
class node_page toneIndigo
```

## Components

### Capture and insertion

- [Page capture](https://github.com/quanquejztr/job-answer-extension/blob/main/extension/entrypoints/content.ts): `extension/entrypoints/content.ts`
- [Extension worker](https://github.com/quanquejztr/job-answer-extension/blob/main/extension/entrypoints/background.ts): `extension/entrypoints/background.ts`
- [Field targeting](https://github.com/quanquejztr/job-answer-extension/tree/main/extension/lib/targeting): `extension/lib/targeting`
- [Answer insertion](https://github.com/quanquejztr/job-answer-extension/tree/main/extension/lib/insertion): `extension/lib/insertion`

### Drafting experience

- [Review panel](https://github.com/quanquejztr/job-answer-extension/blob/main/extension/entrypoints/sidepanel/App.tsx): `extension/entrypoints/sidepanel/App.tsx`
- [Panel state view](https://github.com/quanquejztr/job-answer-extension/blob/main/extension/components/PanelStateView.tsx): `extension/components/PanelStateView.tsx`
- [Draft controller](https://github.com/quanquejztr/job-answer-extension/blob/main/extension/lib/draft/draft-controller.ts): `extension/lib/draft/draft-controller.ts`

### Profile and settings

- [Profile settings](https://github.com/quanquejztr/job-answer-extension/blob/main/extension/components/profile/ProfileSettings.tsx): `extension/components/profile/ProfileSettings.tsx`
- [Provider settings](https://github.com/quanquejztr/job-answer-extension/blob/main/extension/components/ProviderSettings.tsx): `extension/components/ProviderSettings.tsx`
- [Profile client](https://github.com/quanquejztr/job-answer-extension/blob/main/extension/lib/profile/profile-client.ts): `extension/lib/profile/profile-client.ts`
- [Profile service](https://github.com/quanquejztr/job-answer-extension/blob/main/extension/lib/profile/profile-service.ts): `extension/lib/profile/profile-service.ts`
- [Provider diagnostics](https://github.com/quanquejztr/job-answer-extension/blob/main/extension/lib/diagnostics/diagnostics-service.ts): `extension/lib/diagnostics/diagnostics-service.ts`

### Native helper

- [Profile storage](https://github.com/quanquejztr/job-answer-extension/blob/main/helper/internal/profile/store.go): `helper/internal/profile/store.go`
- [Native messaging](https://github.com/quanquejztr/job-answer-extension/blob/main/extension/lib/native/native-client.ts): `extension/lib/native/native-client.ts`
- [Native host](https://github.com/quanquejztr/job-answer-extension/blob/main/helper/internal/host/host.go): `helper/internal/host/host.go`
- [Provider adapters](https://github.com/quanquejztr/job-answer-extension/tree/main/helper/internal/provider): `helper/internal/provider`

### Other components

- **User**
- **Job page**

## Connections

- User → Job page: selects question (evidence: `README.md`)
- Job page → Page capture: captures question
- Page capture → Extension worker: reports capture
- Extension worker → Field targeting: resolves field
- Extension worker → Review panel: updates state
- Review panel → Panel state view: renders state (evidence: `extension/entrypoints/sidepanel/App.tsx`)
- Review panel → Extension worker: requests draft (evidence: `extension/entrypoints/sidepanel/App.tsx`)
- Extension worker → Draft controller: starts draft
- Draft controller → Native messaging: requests generation (evidence: `extension/lib/draft/draft-controller.ts`)
- Native messaging → Native host: sends native request
- Native host → Provider adapters: dispatches provider
- User → Review panel: reviews draft (evidence: `README.md`)
- Review panel → Extension worker: requests insertion (evidence: `extension/entrypoints/sidepanel/App.tsx`)
- Extension worker → Answer insertion: starts insertion
- Answer insertion → Job page: inserts answer (evidence: `README.md`)
- User → Profile settings: configures profile
- Profile settings → Profile client: calls profile API (evidence: `extension/components/profile/ProfileSettings.tsx`)
- Provider settings → Profile client: saves provider (evidence: `extension/components/ProviderSettings.tsx`)
- Profile client → Native messaging: sends profile requests (evidence: `extension/lib/profile/profile-client.ts`)
- Native host → Profile service: handles profile requests
- Profile service → Profile storage: reads and writes
- Provider settings → Provider diagnostics: runs diagnostics
- Provider diagnostics → Native messaging: requests diagnostics (evidence: `extension/lib/diagnostics/diagnostics-service.ts`)
