# atlegang-dotcom/link-detector architecture

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

- Interactive diagram: https://gitdiagram.com/atlegang-dotcom/link-detector
- Repository: https://github.com/atlegang-dotcom/link-detector

## Overview

This is a small interactive link checker. A user chooses a local file or URL; the CLI delegates to the matching helper, which extracts links, checks each link over the network, and returns results for display. The source shows these calls and data transfers; no README or additional capabilities are documented.

Main entry points: [`link.py`](https://github.com/atlegang-dotcom/link-detector/blob/main/link.py) (Interactive CLI), [`helper.py`](https://github.com/atlegang-dotcom/link-detector/blob/main/helper.py) (File Scanner)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_cli["Interactive CLI<br/>[link.py]"]
node_file["Local File"]
node_web["Web Resource"]
node_file_scan["File Scanner<br/>[helper.py]"]
node_url_scan["URL Scanner<br/>[helper.py]"]
node_extract["Link Extractor<br/>[helper.py]"]
node_checker["Link Checker<br/>[helper.py]"]

node_user -->|"chooses input"| node_cli
node_user -->|"provides path"| node_file
node_user -->|"provides URL"| node_web
node_cli -->|"calls for files"| node_file_scan
node_cli -->|"calls for URLs"| node_url_scan
node_file_scan -->|"reads contents"| node_file
node_file_scan -->|"passes contents"| node_extract
node_url_scan -->|"fetches resource"| node_web
node_url_scan -->|"passes contents"| node_extract
node_extract -->|"checks each link"| node_checker
node_checker -->|"requests link"| node_web
node_file_scan -->|"returns results"| node_cli
node_url_scan -->|"returns results"| node_cli
node_cli -->|"prints results"| node_user

click node_cli "https://github.com/atlegang-dotcom/link-detector/blob/main/link.py"
click node_file_scan "https://github.com/atlegang-dotcom/link-detector/blob/main/helper.py"
click node_url_scan "https://github.com/atlegang-dotcom/link-detector/blob/main/helper.py"
click node_extract "https://github.com/atlegang-dotcom/link-detector/blob/main/helper.py"
click node_checker "https://github.com/atlegang-dotcom/link-detector/blob/main/helper.py"

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_user toneBlue
class node_cli,node_file_scan,node_url_scan,node_extract,node_checker toneTeal
class node_file,node_web toneIndigo
```

## Components

### Other components

- **User**
- [Interactive CLI](https://github.com/atlegang-dotcom/link-detector/blob/main/link.py): `link.py`
- **Local File**
- **Web Resource**
- [File Scanner](https://github.com/atlegang-dotcom/link-detector/blob/main/helper.py): `helper.py`
- [URL Scanner](https://github.com/atlegang-dotcom/link-detector/blob/main/helper.py): `helper.py`
- [Link Extractor](https://github.com/atlegang-dotcom/link-detector/blob/main/helper.py): `helper.py`
- [Link Checker](https://github.com/atlegang-dotcom/link-detector/blob/main/helper.py): `helper.py`

## Connections

- User → Interactive CLI: chooses input (evidence: `link.py`)
- User → Local File: provides path
- User → Web Resource: provides URL
- Interactive CLI → File Scanner: calls for files (evidence: `link.py`)
- Interactive CLI → URL Scanner: calls for URLs (evidence: `link.py`)
- File Scanner → Local File: reads contents (evidence: `helper.py`)
- File Scanner → Link Extractor: passes contents (evidence: `helper.py`)
- URL Scanner → Web Resource: fetches resource (evidence: `helper.py`)
- URL Scanner → Link Extractor: passes contents (evidence: `helper.py`)
- Link Extractor → Link Checker: checks each link (evidence: `helper.py`)
- Link Checker → Web Resource: requests link (evidence: `helper.py`)
- File Scanner → Interactive CLI: returns results (evidence: `link.py`)
- URL Scanner → Interactive CLI: returns results (evidence: `link.py`)
- Interactive CLI → User: prints results (evidence: `link.py`)
