# galib4444/sonar architecture

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

- Interactive diagram: https://gitdiagram.com/galib4444/sonar
- Repository: https://github.com/galib4444/sonar
- Video tour (about a minute): https://gitdiagram.com/galib4444/sonar/video

## Overview

Sonar combines job discovery, evidence-based profile tailoring, application assistance, and outcome tracking. The main workflow runs from scanning roles and selecting verified resume facts through tailoring and applying, then recording application outcomes. The README documents product-level links among the scanner, profile package, web app, extension, and local bridge. Source excerpts additionally show graph-memory persistence and bridge writes; other internal arrows are limited where implementation was not sampled.

Main entry points: [`apps/scanner/scan.mjs`](https://github.com/galib4444/sonar/blob/main/apps/scanner/scan.mjs) (Job scanner), [`apps/extension/src/content.ts`](https://github.com/galib4444/sonar/blob/main/apps/extension/src/content.ts) (ATS form detection and fill), [`apps/web/app/(routes)/tailor/page.tsx`](https://github.com/galib4444/sonar/blob/main/apps/web/app/(routes)/tailor/page.tsx) (Resume editor and tracker), [`apps/extension/src/shared/ai-provider.ts`](https://github.com/galib4444/sonar/blob/main/apps/extension/src/shared/ai-provider.ts) (Local AI and resume tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Job discovery"]
  node_scanner["Job scanner<br/>[scan.mjs]"]
  node_scanledger[("Scan ledger")]
end

subgraph group_profile["Profile source"]
  node_master["Verified master profile<br/>[master-profile.ts]"]
  node_profileexport["Extension profile export"]
end

subgraph group_web["Resume web app"]
  node_webui["Resume editor and tracker<br/>[page.tsx]"]
  node_webapi["Tailor and resume APIs<br/>[route.ts]"]
  node_webstore[("Resume and application storage<br/>[index.ts]")]
  node_analytics["Application analytics<br/>[route.ts]"]
end

subgraph group_extension["Apply extension"]
  node_atsform["ATS form detection and fill<br/>[content.ts]"]
  node_profiledata[("Stored extension profile<br/>[profile.ts]")]
  node_autofill["Field classification and autofill"]
  node_graphservice["Graph memory service<br/>[service.ts]"]
  node_graphstorage[("Graph memory storage<br/>[storage.ts]")]
  node_extensionai["Local AI and resume tools<br/>[ai-provider.ts]"]
end

subgraph group_integration["Local integration"]
  node_bridge["Token-authenticated local bridge<br/>[server.mjs]"]
  node_apptracker[("Markdown application tracker")]
end

node_seeker(("Job seeker"))
node_ats{{"ATS portals"}}
node_sheets[("Google Sheets")]
node_telegram{{"Telegram digest and bot"}}
node_ollama{{"Ollama"}}
node_gemini{{"Gemini or Claude"}}

node_seeker -->|"requests role scan"| node_scanner
node_scanner -->|"queries job APIs"| node_ats
node_scanner -->|"deduplicates results"| node_scanledger
node_scanner -->|"pushes job rows"| node_sheets
node_scanner -->|"sends digest"| node_telegram
node_master -->|"provides profile facts"| node_profileexport
node_seeker -->|"edits and tailors resume"| node_webui
node_webui -->|"requests tailoring"| node_webapi
node_webapi -.->|"stores resume data"| node_webstore
node_webui -.->|"views outcomes"| node_analytics
node_profileexport -->|"exports extension profile"| node_profiledata
node_seeker -->|"visits application form"| node_atsform
node_atsform -.->|"classifies form fields"| node_autofill
node_profiledata -.->|"supplies answers"| node_autofill
node_atsform -.->|"delegates memory requests"| node_graphservice
node_graphservice -->|"loads and saves graph"| node_graphstorage
node_atsform -->|"offers writing tools"| node_extensionai
node_extensionai -->|"uses by default"| node_ollama
node_extensionai -.->|"supports opt-in providers"| node_gemini
node_atsform -->|"pushes tracked applications"| node_bridge
node_bridge -->|"appends applications"| node_apptracker

click node_scanner "https://github.com/galib4444/sonar/blob/main/apps/scanner/scan.mjs"
click node_scanledger "https://github.com/galib4444/sonar/blob/main/apps/scanner/lib/applications-store.mjs"
click node_master "https://github.com/galib4444/sonar/blob/main/packages/profile/master-profile.ts"
click node_profileexport "https://github.com/galib4444/sonar/blob/main/packages/profile/export-extension-profile.ts"
click node_webui "https://github.com/galib4444/sonar/blob/main/apps/web/app/(routes)/tailor/page.tsx"
click node_webapi "https://github.com/galib4444/sonar/blob/main/apps/web/app/api/tailor/route.ts"
click node_webstore "https://github.com/galib4444/sonar/blob/main/apps/web/lib/db/index.ts"
click node_analytics "https://github.com/galib4444/sonar/blob/main/apps/web/app/api/analytics/route.ts"
click node_atsform "https://github.com/galib4444/sonar/blob/main/apps/extension/src/content.ts"
click node_profiledata "https://github.com/galib4444/sonar/blob/main/apps/extension/src/shared/profile.ts"
click node_autofill "https://github.com/galib4444/sonar/blob/main/apps/extension/src/shared/field-classifier.ts"
click node_graphservice "https://github.com/galib4444/sonar/blob/main/apps/extension/src/shared/graph/service.ts"
click node_graphstorage "https://github.com/galib4444/sonar/blob/main/apps/extension/src/shared/graph/storage.ts"
click node_extensionai "https://github.com/galib4444/sonar/blob/main/apps/extension/src/shared/ai-provider.ts"
click node_bridge "https://github.com/galib4444/sonar/blob/main/apps/bridge/server.mjs"
click node_apptracker "https://github.com/galib4444/sonar/blob/main/apps/scanner/lib/applications-store.mjs"

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_scanner,node_scanledger toneBlue
class node_master,node_profileexport,node_sheets toneAmber
class node_webui,node_webapi,node_webstore,node_analytics toneMint
class node_atsform,node_profiledata,node_autofill,node_graphservice,node_graphstorage,node_extensionai toneRose
class node_bridge,node_apptracker,node_seeker,node_ats,node_telegram,node_ollama,node_gemini toneIndigo
```

## Components

### Job discovery

- [Job scanner](https://github.com/galib4444/sonar/blob/main/apps/scanner/scan.mjs): `apps/scanner/scan.mjs`
- [Scan ledger](https://github.com/galib4444/sonar/blob/main/apps/scanner/lib/applications-store.mjs): `apps/scanner/lib/applications-store.mjs`

### Profile source

- [Verified master profile](https://github.com/galib4444/sonar/blob/main/packages/profile/master-profile.ts): `packages/profile/master-profile.ts`
- [Extension profile export](https://github.com/galib4444/sonar/blob/main/packages/profile/export-extension-profile.ts): `packages/profile/export-extension-profile.ts`

### Resume web app

- [Resume editor and tracker](https://github.com/galib4444/sonar/blob/main/apps/web/app/(routes)/tailor/page.tsx): `apps/web/app/(routes)/tailor/page.tsx`
- [Tailor and resume APIs](https://github.com/galib4444/sonar/blob/main/apps/web/app/api/tailor/route.ts): `apps/web/app/api/tailor/route.ts`
- [Resume and application storage](https://github.com/galib4444/sonar/blob/main/apps/web/lib/db/index.ts): `apps/web/lib/db/index.ts`
- [Application analytics](https://github.com/galib4444/sonar/blob/main/apps/web/app/api/analytics/route.ts): `apps/web/app/api/analytics/route.ts`

### Apply extension

- [ATS form detection and fill](https://github.com/galib4444/sonar/blob/main/apps/extension/src/content.ts): `apps/extension/src/content.ts`
- [Stored extension profile](https://github.com/galib4444/sonar/blob/main/apps/extension/src/shared/profile.ts): `apps/extension/src/shared/profile.ts`
- [Field classification and autofill](https://github.com/galib4444/sonar/blob/main/apps/extension/src/shared/field-classifier.ts): `apps/extension/src/shared/field-classifier.ts`
- [Graph memory service](https://github.com/galib4444/sonar/blob/main/apps/extension/src/shared/graph/service.ts): `apps/extension/src/shared/graph/service.ts`
- [Graph memory storage](https://github.com/galib4444/sonar/blob/main/apps/extension/src/shared/graph/storage.ts): `apps/extension/src/shared/graph/storage.ts`
- [Local AI and resume tools](https://github.com/galib4444/sonar/blob/main/apps/extension/src/shared/ai-provider.ts): `apps/extension/src/shared/ai-provider.ts`

### Local integration

- [Token-authenticated local bridge](https://github.com/galib4444/sonar/blob/main/apps/bridge/server.mjs): `apps/bridge/server.mjs`
- [Markdown application tracker](https://github.com/galib4444/sonar/blob/main/apps/scanner/lib/applications-store.mjs): `apps/scanner/lib/applications-store.mjs`

### Other components

- **Job seeker**
- **ATS portals**
- **Google Sheets**
- **Telegram digest and bot**
- **Ollama**
- **Gemini or Claude**

## Connections

- Job seeker → Job scanner: requests role scan (evidence: `README.md`)
- Job scanner → ATS portals: queries job APIs (evidence: `README.md`)
- Job scanner → Scan ledger: deduplicates results (evidence: `README.md`)
- Job scanner → Google Sheets: pushes job rows (evidence: `README.md`)
- Job scanner → Telegram digest and bot: sends digest (evidence: `README.md`)
- Verified master profile → Extension profile export: provides profile facts (evidence: `packages/profile/export-extension-profile.ts`)
- Job seeker → Resume editor and tracker: edits and tailors resume (evidence: `README.md`)
- Resume editor and tracker → Tailor and resume APIs: requests tailoring (evidence: `README.md`)
- Tailor and resume APIs → Resume and application storage: stores resume data
- Resume editor and tracker → Application analytics: views outcomes
- Extension profile export → Stored extension profile: exports extension profile (evidence: `README.md`)
- Job seeker → ATS form detection and fill: visits application form (evidence: `README.md`)
- ATS form detection and fill → Field classification and autofill: classifies form fields
- Stored extension profile → Field classification and autofill: supplies answers
- ATS form detection and fill → Graph memory service: delegates memory requests
- Graph memory service → Graph memory storage: loads and saves graph (evidence: `apps/extension/src/shared/graph/service.ts`)
- ATS form detection and fill → Local AI and resume tools: offers writing tools (evidence: `README.md`)
- Local AI and resume tools → Ollama: uses by default (evidence: `README.md`)
- Local AI and resume tools → Gemini or Claude: supports opt-in providers (evidence: `README.md`)
- ATS form detection and fill → Token-authenticated local bridge: pushes tracked applications (evidence: `README.md`)
- Token-authenticated local bridge → Markdown application tracker: appends applications (evidence: `apps/bridge/server.mjs`)
