# thekiran/nero architecture

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

- Interactive diagram: https://gitdiagram.com/thekiran/nero
- Repository: https://github.com/thekiran/nero

## Overview

NERO is a cross-platform C terminal shell for command-driven network diagnostics. Its main workflow starts at the executable, enters the interactive terminal, accepts and parses commands, then dispatches diagnostic work and renders results. The repository also contains a Wi-Fi discovery/capture branch and shared platform, hardware, logging, and operation-UI services. The README documents shell capabilities and TCP/SYN diagnostics; sampled source confirms the executable’s terminal/doctor entry points and parts of Wi-Fi capture and scan processing. Some subsystem links remain unverified because their callers were not excerpted.

Main entry points: [`src/cli/commands.c`](https://github.com/thekiran/nero/blob/main/src/cli/commands.c) (Command Dispatch), [`src/cli/terminal.c`](https://github.com/thekiran/nero/blob/main/src/cli/terminal.c) (Terminal Session), [`src/modules/wifi/wifi_session.c`](https://github.com/thekiran/nero/blob/main/src/modules/wifi/wifi_session.c) (Capture Sessions), [`src/main.c`](https://github.com/thekiran/nero/blob/main/src/main.c) (Program Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Interactive Shell"]
  node_main["Program Entry<br/>[main.c]"]
  node_terminal["Terminal Session<br/>[terminal.c]"]
  node_input["Line Editor<br/>[input.c]"]
  node_history["Command History<br/>[history.c]"]
  node_parser["Command Parser<br/>[parser.c]"]
  node_commands["Command Dispatch<br/>[commands.c]"]
  node_renderer["Terminal Rendering<br/>[render.c]"]
end

subgraph group_net["Network Diagnostics"]
  node_portscan["TCP Port Scanner<br/>[portscanner.c]"]
  node_scan_session["Scan Sessions<br/>[scan_session.c]"]
  node_syn["Raw SYN Engine"]
end

subgraph group_wifi["Wi-Fi Discovery"]
  node_wifi_cli["Wi-Fi Commands<br/>[wifi_command.c]"]
  node_wifi_session["Capture Sessions<br/>[wifi_session.c]"]
  node_wifi_tracker["Frame Tracker<br/>[wifi_tracker.c]"]
  node_capture["Capture Backend<br/>[wifi_capture.c]"]
end

subgraph group_shared["Core and Platform"]
  node_doctor["System Doctor<br/>[doctor.c]"]
  node_hardware["Hardware Probe<br/>[hardware.c]"]
  node_platform["Platform Adapter<br/>[platform.c]"]
  node_operation_ui["Operation UI<br/>[operation_ui.c]"]
  node_logging[("Runtime Logging<br/>[log.c]")]
end

node_user(("Terminal User"))

node_user -->|"starts"| node_main
node_main -->|"starts session"| node_terminal
node_main -->|"runs on request"| node_doctor
node_user -->|"enters commands"| node_terminal
node_terminal -.->|"reads input"| node_input
node_input -.->|"uses history"| node_history
node_terminal -.->|"tokenizes input"| node_parser
node_terminal -.->|"dispatches commands"| node_commands
node_commands -.->|"renders output"| node_renderer
node_commands -->|"runs TCP checks"| node_portscan
node_commands -->|"offers SYN mode"| node_syn
node_commands -.->|"dispatches Wi-Fi"| node_wifi_cli
node_wifi_cli -.->|"starts capture"| node_wifi_session
node_wifi_session -->|"runs capture"| node_capture
node_wifi_session -->|"resets tracker"| node_wifi_tracker
node_wifi_session -.->|"feeds packets"| node_wifi_tracker
node_portscan -.->|"uses scan core"| node_scan_session
node_doctor -.->|"checks hardware"| node_hardware
node_hardware -->|"queries platform"| node_platform
node_commands -.->|"shows progress"| node_operation_ui
node_portscan -.->|"records events"| node_logging
node_syn -.->|"records events"| node_logging

click node_main "https://github.com/thekiran/nero/blob/main/src/main.c"
click node_terminal "https://github.com/thekiran/nero/blob/main/src/cli/terminal.c"
click node_input "https://github.com/thekiran/nero/blob/main/src/cli/input.c"
click node_history "https://github.com/thekiran/nero/blob/main/src/cli/history.c"
click node_parser "https://github.com/thekiran/nero/blob/main/src/cli/parser/parser.c"
click node_commands "https://github.com/thekiran/nero/blob/main/src/cli/commands.c"
click node_renderer "https://github.com/thekiran/nero/blob/main/src/cli/render.c"
click node_portscan "https://github.com/thekiran/nero/blob/main/src/modules/portscanner.c"
click node_scan_session "https://github.com/thekiran/nero/blob/main/src/modules/scan_session.c"
click node_syn "https://github.com/thekiran/nero/blob/main/src/modules/syn_flood_powered.c"
click node_wifi_cli "https://github.com/thekiran/nero/blob/main/src/cli/wifi_command.c"
click node_wifi_session "https://github.com/thekiran/nero/blob/main/src/modules/wifi/wifi_session.c"
click node_wifi_tracker "https://github.com/thekiran/nero/blob/main/src/modules/wifi/wifi_tracker.c"
click node_capture "https://github.com/thekiran/nero/blob/main/src/platform/wifi_capture.c"
click node_doctor "https://github.com/thekiran/nero/blob/main/src/core/doctor.c"
click node_hardware "https://github.com/thekiran/nero/blob/main/src/core/hardware.c"
click node_platform "https://github.com/thekiran/nero/blob/main/src/core/platform.c"
click node_operation_ui "https://github.com/thekiran/nero/blob/main/src/cli/operation_ui.c"
click node_logging "https://github.com/thekiran/nero/blob/main/src/core/log.c"

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_terminal,node_input,node_history,node_parser,node_commands,node_renderer,node_user toneBlue
class node_portscan,node_scan_session,node_syn toneAmber
class node_wifi_cli,node_wifi_session,node_wifi_tracker,node_capture toneMint
class node_doctor,node_hardware,node_platform,node_operation_ui,node_logging toneRose
```

## Components

### Interactive Shell

- [Program Entry](https://github.com/thekiran/nero/blob/main/src/main.c): `src/main.c`
- [Terminal Session](https://github.com/thekiran/nero/blob/main/src/cli/terminal.c): `src/cli/terminal.c`
- [Line Editor](https://github.com/thekiran/nero/blob/main/src/cli/input.c): `src/cli/input.c`
- [Command History](https://github.com/thekiran/nero/blob/main/src/cli/history.c): `src/cli/history.c`
- [Command Parser](https://github.com/thekiran/nero/blob/main/src/cli/parser/parser.c): `src/cli/parser/parser.c`
- [Command Dispatch](https://github.com/thekiran/nero/blob/main/src/cli/commands.c): `src/cli/commands.c`
- [Terminal Rendering](https://github.com/thekiran/nero/blob/main/src/cli/render.c): `src/cli/render.c`

### Network Diagnostics

- [TCP Port Scanner](https://github.com/thekiran/nero/blob/main/src/modules/portscanner.c): `src/modules/portscanner.c`
- [Scan Sessions](https://github.com/thekiran/nero/blob/main/src/modules/scan_session.c): `src/modules/scan_session.c`
- [Raw SYN Engine](https://github.com/thekiran/nero/blob/main/src/modules/syn_flood_powered.c): `src/modules/syn_flood_powered.c`

### Wi-Fi Discovery

- [Wi-Fi Commands](https://github.com/thekiran/nero/blob/main/src/cli/wifi_command.c): `src/cli/wifi_command.c`
- [Capture Sessions](https://github.com/thekiran/nero/blob/main/src/modules/wifi/wifi_session.c): `src/modules/wifi/wifi_session.c`
- [Frame Tracker](https://github.com/thekiran/nero/blob/main/src/modules/wifi/wifi_tracker.c): `src/modules/wifi/wifi_tracker.c`
- [Capture Backend](https://github.com/thekiran/nero/blob/main/src/platform/wifi_capture.c): `src/platform/wifi_capture.c`

### Core and Platform

- [System Doctor](https://github.com/thekiran/nero/blob/main/src/core/doctor.c): `src/core/doctor.c`
- [Hardware Probe](https://github.com/thekiran/nero/blob/main/src/core/hardware.c): `src/core/hardware.c`
- [Platform Adapter](https://github.com/thekiran/nero/blob/main/src/core/platform.c): `src/core/platform.c`
- [Operation UI](https://github.com/thekiran/nero/blob/main/src/cli/operation_ui.c): `src/cli/operation_ui.c`
- [Runtime Logging](https://github.com/thekiran/nero/blob/main/src/core/log.c): `src/core/log.c`

### Other components

- **Terminal User**

## Connections

- Terminal User → Program Entry: starts (evidence: `README.md`)
- Program Entry → Terminal Session: starts session (evidence: `src/main.c`)
- Program Entry → System Doctor: runs on request (evidence: `src/main.c`)
- Terminal User → Terminal Session: enters commands (evidence: `README.md`)
- Terminal Session → Line Editor: reads input
- Line Editor → Command History: uses history
- Terminal Session → Command Parser: tokenizes input
- Terminal Session → Command Dispatch: dispatches commands
- Command Dispatch → Terminal Rendering: renders output
- Command Dispatch → TCP Port Scanner: runs TCP checks (evidence: `README.md`)
- Command Dispatch → Raw SYN Engine: offers SYN mode (evidence: `README.md`)
- Command Dispatch → Wi-Fi Commands: dispatches Wi-Fi
- Wi-Fi Commands → Capture Sessions: starts capture
- Capture Sessions → Capture Backend: runs capture (evidence: `src/modules/wifi/wifi_session.c`)
- Capture Sessions → Frame Tracker: resets tracker (evidence: `src/modules/wifi/wifi_session.c`)
- Capture Sessions → Frame Tracker: feeds packets
- TCP Port Scanner → Scan Sessions: uses scan core
- System Doctor → Hardware Probe: checks hardware
- Hardware Probe → Platform Adapter: queries platform (evidence: `src/core/hardware.c`)
- Command Dispatch → Operation UI: shows progress
- TCP Port Scanner → Runtime Logging: records events
- Raw SYN Engine → Runtime Logging: records events
