# jeantoroot/nextdns-reporter architecture

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

- Interactive diagram: https://gitdiagram.com/jeantoroot/nextdns-reporter
- Repository: https://github.com/jeantoroot/nextdns-reporter

## Overview

NextDNS Reporter is a Chrome/Firefox extension for collecting user-initiated requests to unblock sites. Its main flow detects a NextDNS block page, presents a request interface, and submits a report to a configured Formspree endpoint; settings and a 48-hour report history are stored locally. The graph includes documented options/history capabilities and setup surfaces. Some implementation details, especially report submission and optional direct-link handling, are only partly excerpted, so those relationships rely on README evidence.

Main entry points: [`content.js`](https://github.com/jeantoroot/nextdns-reporter/blob/main/content.js) (Detection and report form), [`options.js`](https://github.com/jeantoroot/nextdns-reporter/blob/main/options.js) (Options and history), [`onboarding.js`](https://github.com/jeantoroot/nextdns-reporter/blob/main/onboarding.js) (Guided onboarding), [`popup.js`](https://github.com/jeantoroot/nextdns-reporter/blob/main/popup.js) (Toolbar popup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_detection["Block Detection"]
  node_content["Detection and report form<br/>[content.js]"]
  node_blockreason["Block reason extraction<br/>[content.js]"]
end

subgraph group_reporting["User Reporting"]
  node_requestform["Report form<br/>[content.js]"]
  node_reportdata["Report details<br/>[content.js]"]
  node_reporter["Report submission<br/>[content.js]"]
end

subgraph group_configuration["Setup and Settings"]
  node_popup["Toolbar popup<br/>[popup.js]"]
  node_options["Options and history<br/>[options.js]"]
  node_onboarding["Guided onboarding<br/>[onboarding.js]"]
end

subgraph group_runtime["Extension Runtime"]
  node_localstorage[("Local extension storage")]
  node_background["Install handler<br/>[background.js]"]
end

node_user(("Extension user"))
node_blocked["NextDNS block page"]
node_formspree["Formspree endpoint"]
node_admin(("Network administrator"))

node_blocked -->|"hosts script"| node_content
node_content -->|"reads reason"| node_blockreason
node_content -->|"reads and writes"| node_localstorage
node_user -->|"opens and submits"| node_requestform
node_content -->|"shows on detection"| node_requestform
node_requestform -->|"collects fields"| node_reportdata
node_reporter -->|"reads endpoint"| node_localstorage
node_reporter -->|"posts JSON"| node_formspree
node_formspree -->|"emails report"| node_admin
node_popup -->|"reads and updates"| node_localstorage
node_options -->|"manages settings and history"| node_localstorage
node_onboarding -->|"loads and saves setup"| node_localstorage
node_background -->|"checks configuration"| node_localstorage
node_background -->|"opens on first install"| node_onboarding
node_popup -->|"opens settings"| node_options
node_options -->|"opens guide"| node_onboarding

click node_content "https://github.com/jeantoroot/nextdns-reporter/blob/main/content.js"
click node_blockreason "https://github.com/jeantoroot/nextdns-reporter/blob/main/content.js"
click node_requestform "https://github.com/jeantoroot/nextdns-reporter/blob/main/content.js"
click node_reportdata "https://github.com/jeantoroot/nextdns-reporter/blob/main/content.js"
click node_reporter "https://github.com/jeantoroot/nextdns-reporter/blob/main/content.js"
click node_popup "https://github.com/jeantoroot/nextdns-reporter/blob/main/popup.js"
click node_options "https://github.com/jeantoroot/nextdns-reporter/blob/main/options.js"
click node_onboarding "https://github.com/jeantoroot/nextdns-reporter/blob/main/onboarding.js"
click node_background "https://github.com/jeantoroot/nextdns-reporter/blob/main/background.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_content,node_blockreason,node_user toneBlue
class node_requestform,node_reportdata,node_reporter toneAmber
class node_popup,node_options,node_onboarding toneMint
class node_localstorage,node_background toneRose
class node_blocked,node_formspree,node_admin toneIndigo
```

## Components

### Block Detection

- [Detection and report form](https://github.com/jeantoroot/nextdns-reporter/blob/main/content.js): `content.js`
- [Block reason extraction](https://github.com/jeantoroot/nextdns-reporter/blob/main/content.js): `content.js`

### User Reporting

- [Report form](https://github.com/jeantoroot/nextdns-reporter/blob/main/content.js): `content.js`
- [Report details](https://github.com/jeantoroot/nextdns-reporter/blob/main/content.js): `content.js`
- [Report submission](https://github.com/jeantoroot/nextdns-reporter/blob/main/content.js): `content.js`

### Setup and Settings

- [Toolbar popup](https://github.com/jeantoroot/nextdns-reporter/blob/main/popup.js): `popup.js`
- [Options and history](https://github.com/jeantoroot/nextdns-reporter/blob/main/options.js): `options.js`
- [Guided onboarding](https://github.com/jeantoroot/nextdns-reporter/blob/main/onboarding.js): `onboarding.js`

### Extension Runtime

- **Local extension storage**
- [Install handler](https://github.com/jeantoroot/nextdns-reporter/blob/main/background.js): `background.js`

### Other components

- **Extension user**
- **NextDNS block page**
- **Formspree endpoint**
- **Network administrator**

## Connections

- NextDNS block page → Detection and report form: hosts script (evidence: `README.md`)
- Detection and report form → Block reason extraction: reads reason (evidence: `content.js`)
- Detection and report form → Local extension storage: reads and writes (evidence: `content.js`)
- Extension user → Report form: opens and submits (evidence: `README.md`)
- Detection and report form → Report form: shows on detection (evidence: `README.md`)
- Report form → Report details: collects fields (evidence: `README.md`)
- Report submission → Local extension storage: reads endpoint (evidence: `content.js`)
- Report submission → Formspree endpoint: posts JSON (evidence: `README.md`)
- Formspree endpoint → Network administrator: emails report (evidence: `README.md`)
- Toolbar popup → Local extension storage: reads and updates (evidence: `popup.js`)
- Options and history → Local extension storage: manages settings and history (evidence: `options.js`)
- Guided onboarding → Local extension storage: loads and saves setup (evidence: `onboarding.js`)
- Install handler → Local extension storage: checks configuration (evidence: `background.js`)
- Install handler → Guided onboarding: opens on first install (evidence: `background.js`)
- Toolbar popup → Options and history: opens settings (evidence: `popup.js`)
- Options and history → Guided onboarding: opens guide (evidence: `options.js`)
