# sengqt/networktools architecture

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

- Interactive diagram: https://gitdiagram.com/sengqt/networktools
- Repository: https://github.com/sengqt/networktools

## Overview

NetworkTools is a small interactive port-scanning tool. A user enters a target and port limit; the CLI constructs a scanner, which probes ports concurrently, reports open ports, and saves the result as JSON. The graph separates the CLI, scanning workflow, and result storage. The README documents the thread count, scan limit, and automatic results directory; implementation details are based on the shown source excerpts.

Main entry points: [`Port-Scanner/scanner.py`](https://github.com/sengqt/networktools/blob/main/Port-Scanner/scanner.py) (Port scanner), [`Port-Scanner/main.py`](https://github.com/sengqt/networktools/blob/main/Port-Scanner/main.py) (Interactive CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI"]
  node_main["Interactive CLI<br/>[main.py]"]
end

subgraph group_scan["Port scanning"]
  node_scanner["Port scanner<br/>[scanner.py]"]
  node_sockets["Target sockets"]
  node_queue["Port work queue"]
end

subgraph group_results["Results"]
  node_results["JSON results<br/>[scanner.py]"]
end

node_user(("User"))
node_filesystem[("Local filesystem")]

node_user -->|"enters target"| node_main
node_main -->|"constructs and invokes"| node_scanner
node_scanner -->|"enqueues ports"| node_queue
node_scanner -->|"probes ports"| node_sockets
node_main -->|"requests JSON save"| node_scanner
node_scanner -->|"serializes scan"| node_results
node_results -->|"writes file"| node_filesystem

click node_main "https://github.com/sengqt/networktools/blob/main/Port-Scanner/main.py"
click node_scanner "https://github.com/sengqt/networktools/blob/main/Port-Scanner/scanner.py"
click node_results "https://github.com/sengqt/networktools/blob/main/Port-Scanner/scanner.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_main,node_user toneBlue
class node_scanner,node_sockets,node_queue,node_filesystem toneAmber
class node_results toneMint
```

## Components

### CLI

- [Interactive CLI](https://github.com/sengqt/networktools/blob/main/Port-Scanner/main.py): `Port-Scanner/main.py`

### Port scanning

- [Port scanner](https://github.com/sengqt/networktools/blob/main/Port-Scanner/scanner.py): `Port-Scanner/scanner.py`
- **Target sockets**
- **Port work queue**

### Results

- [JSON results](https://github.com/sengqt/networktools/blob/main/Port-Scanner/scanner.py): `Port-Scanner/scanner.py`

### Other components

- **User**
- **Local filesystem**

## Connections

- User → Interactive CLI: enters target (evidence: `Port-Scanner/main.py`)
- Interactive CLI → Port scanner: constructs and invokes (evidence: `Port-Scanner/main.py`)
- Port scanner → Port work queue: enqueues ports (evidence: `Port-Scanner/scanner.py`)
- Port scanner → Target sockets: probes ports (evidence: `Port-Scanner/scanner.py`)
- Interactive CLI → Port scanner: requests JSON save (evidence: `Port-Scanner/main.py`)
- Port scanner → JSON results: serializes scan (evidence: `Port-Scanner/scanner.py`)
- JSON results → Local filesystem: writes file (evidence: `Port-Scanner/scanner.py`)
