# tabishassan/rung-check architecture

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

- Interactive diagram: https://gitdiagram.com/tabishassan/rung-check
- Repository: https://github.com/tabishassan/rung-check

## Overview

Rung Check is a LinkedIn profile scoring tool: a visitor uses the static site to request an audit and view a report, while the Cloudflare Worker proxies scoring-model requests and handles report email and lead logging. The Worker also contains a leads dashboard with analytics. The excerpts show the Worker’s external service calls and persistence, but omit much of its routing and scoring logic; the site source was not sampled, so its connection to the API is shown as unverified.

Main entry points: [`api/src/worker.js`](https://github.com/tabishassan/rung-check/blob/main/api/src/worker.js) (API Worker), [`site/public/index.html`](https://github.com/tabishassan/rung-check/blob/main/site/public/index.html) (Static site)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Visitor experience"]
  node_site["Static site<br/>[index.html]"]
end

subgraph group_audit["Profile audit"]
  node_worker["API Worker<br/>[worker.js]"]
  node_scoring["Profile scoring<br/>[worker.js]"]
  node_groq["Groq API"]
  node_report["Audit report<br/>[worker.js]"]
end

subgraph group_leadops["Lead operations"]
  node_email["Report email<br/>[worker.js]"]
  node_brevo["Brevo email service"]
  node_leadlog["Lead logging<br/>[worker.js]"]
  node_d1[("D1 leads database")]
  node_notion["Notion"]
end

subgraph group_analytics["Analytics"]
  node_dashboard["Leads dashboard<br/>[worker.js]"]
  node_posthog["PostHog"]
end

node_visitor(("Visitor"))

node_visitor -->|"uses"| node_site
node_site -.->|"requests audit"| node_worker
node_worker -.->|"routes audit"| node_scoring
node_scoring -->|"requests completions"| node_groq
node_worker -->|"handles send-report"| node_email
node_email -->|"sends email"| node_brevo
node_worker -->|"logs leads"| node_leadlog
node_leadlog -->|"inserts leads"| node_d1
node_leadlog -.->|"syncs optionally"| node_notion
node_dashboard -->|"reads leads"| node_d1
node_dashboard -->|"queries events"| node_posthog

click node_site "https://github.com/tabishassan/rung-check/blob/main/site/public/index.html"
click node_worker "https://github.com/tabishassan/rung-check/blob/main/api/src/worker.js"
click node_scoring "https://github.com/tabishassan/rung-check/blob/main/api/src/worker.js"
click node_report "https://github.com/tabishassan/rung-check/blob/main/api/src/worker.js"
click node_email "https://github.com/tabishassan/rung-check/blob/main/api/src/worker.js"
click node_leadlog "https://github.com/tabishassan/rung-check/blob/main/api/src/worker.js"
click node_dashboard "https://github.com/tabishassan/rung-check/blob/main/api/src/worker.js"

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_site toneBlue
class node_worker,node_scoring,node_groq,node_report toneAmber
class node_email,node_brevo,node_leadlog,node_d1,node_notion toneMint
class node_dashboard,node_posthog toneRose
class node_visitor toneIndigo
```

## Components

### Visitor experience

- [Static site](https://github.com/tabishassan/rung-check/blob/main/site/public/index.html): `site/public/index.html`

### Profile audit

- [API Worker](https://github.com/tabishassan/rung-check/blob/main/api/src/worker.js): `api/src/worker.js`
- [Profile scoring](https://github.com/tabishassan/rung-check/blob/main/api/src/worker.js): `api/src/worker.js`
- **Groq API**
- [Audit report](https://github.com/tabishassan/rung-check/blob/main/api/src/worker.js): `api/src/worker.js`

### Lead operations

- [Report email](https://github.com/tabishassan/rung-check/blob/main/api/src/worker.js): `api/src/worker.js`
- **Brevo email service**
- [Lead logging](https://github.com/tabishassan/rung-check/blob/main/api/src/worker.js): `api/src/worker.js`
- **D1 leads database**
- **Notion**

### Analytics

- [Leads dashboard](https://github.com/tabishassan/rung-check/blob/main/api/src/worker.js): `api/src/worker.js`
- **PostHog**

### Other components

- **Visitor**

## Connections

- Visitor → Static site: uses (evidence: `README.md`)
- Static site → API Worker: requests audit
- API Worker → Profile scoring: routes audit (evidence: `api/src/worker.js`)
- Profile scoring → Groq API: requests completions (evidence: `api/src/worker.js`)
- API Worker → Report email: handles send-report (evidence: `api/src/worker.js`)
- Report email → Brevo email service: sends email (evidence: `api/src/worker.js`)
- API Worker → Lead logging: logs leads (evidence: `api/src/worker.js`)
- Lead logging → D1 leads database: inserts leads (evidence: `api/src/worker.js`)
- Lead logging → Notion: syncs optionally (evidence: `api/src/worker.js`)
- Leads dashboard → D1 leads database: reads leads (evidence: `api/src/worker.js`)
- Leads dashboard → PostHog: queries events (evidence: `api/src/worker.js`)
