# bechirfathallah/ip-whois-app architecture

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

- Interactive diagram: https://gitdiagram.com/bechirfathallah/ip-whois-app
- Repository: https://github.com/bechirfathallah/ip-whois-app

## Overview

IP Whois App is a Python application for showing the machine’s public IPv4/IPv6 addresses and looking up IP geolocation and network details through public REST APIs. Its principal search workflow is input, validation in the console app, API lookup, response-to-model conversion, and display; it also has a Tkinter interface with its own lookup flow. The README describes private-address rejection, but the sampled validator only checks whether an address parses, and the GUI does not use it. The GUI and API relationships are visible in the excerpts; other unsampled behavior is not inferred.

Main entry points: [`src/api_client.py`](https://github.com/bechirfathallah/ip-whois-app/blob/main/src/api_client.py) (IP API client), [`main.py`](https://github.com/bechirfathallah/ip-whois-app/blob/main/main.py) (Console app), [`src/display.py`](https://github.com/bechirfathallah/ip-whois-app/blob/main/src/display.py) (Console display), [`gui.py`](https://github.com/bechirfathallah/ip-whois-app/blob/main/gui.py) (Tkinter GUI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application flows"]
  node_console_app["Console app<br/>[main.py]"]
  node_console_display["Console display<br/>[display.py]"]
  node_desktop_gui["Tkinter GUI<br/>[gui.py]"]
end

subgraph group_domain["Validation and data"]
  node_ip_validator["IP validator<br/>[validator.py]"]
  node_ip_info["IP info model<br/>[models.py]"]
end

subgraph group_services["API integration"]
  node_api_client["IP API client<br/>[api_client.py]"]
  node_ipify{{"ipify API"}}
  node_ipwho{{"ipwho.is API"}}
end

node_console_user(("Console user"))
node_gui_user(("GUI user"))

node_console_user -->|"uses"| node_console_app
node_console_app -->|"prompts and displays"| node_console_display
node_console_app -->|"validates input"| node_ip_validator
node_console_app -->|"requests IP data"| node_api_client
node_console_app -->|"builds lookup model"| node_ip_info
node_gui_user -->|"uses"| node_desktop_gui
node_desktop_gui -->|"requests IP data"| node_api_client
node_api_client -->|"requests public IP"| node_ipify
node_ipify -->|"returns IP"| node_api_client
node_api_client -->|"requests IP details"| node_ipwho
node_ipwho -->|"returns lookup data"| node_api_client
node_console_display -->|"shows results"| node_console_user

click node_console_app "https://github.com/bechirfathallah/ip-whois-app/blob/main/main.py"
click node_console_display "https://github.com/bechirfathallah/ip-whois-app/blob/main/src/display.py"
click node_desktop_gui "https://github.com/bechirfathallah/ip-whois-app/blob/main/gui.py"
click node_ip_validator "https://github.com/bechirfathallah/ip-whois-app/blob/main/src/validator.py"
click node_ip_info "https://github.com/bechirfathallah/ip-whois-app/blob/main/src/models.py"
click node_api_client "https://github.com/bechirfathallah/ip-whois-app/blob/main/src/api_client.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_console_app,node_console_display,node_desktop_gui,node_console_user,node_gui_user toneBlue
class node_ip_validator,node_ip_info toneAmber
class node_api_client,node_ipify,node_ipwho toneMint
```

## Components

### Application flows

- [Console app](https://github.com/bechirfathallah/ip-whois-app/blob/main/main.py): `main.py`
- [Console display](https://github.com/bechirfathallah/ip-whois-app/blob/main/src/display.py): `src/display.py`
- [Tkinter GUI](https://github.com/bechirfathallah/ip-whois-app/blob/main/gui.py): `gui.py`

### Validation and data

- [IP validator](https://github.com/bechirfathallah/ip-whois-app/blob/main/src/validator.py): `src/validator.py`
- [IP info model](https://github.com/bechirfathallah/ip-whois-app/blob/main/src/models.py): `src/models.py`

### API integration

- [IP API client](https://github.com/bechirfathallah/ip-whois-app/blob/main/src/api_client.py): `src/api_client.py`
- **ipify API**
- **ipwho.is API**

### Other components

- **Console user**
- **GUI user**

## Connections

- Console user → Console app: uses (evidence: `main.py`)
- Console app → Console display: prompts and displays (evidence: `main.py`)
- Console app → IP validator: validates input (evidence: `main.py`)
- Console app → IP API client: requests IP data (evidence: `main.py`)
- Console app → IP info model: builds lookup model (evidence: `main.py`)
- GUI user → Tkinter GUI: uses (evidence: `gui.py`)
- Tkinter GUI → IP API client: requests IP data (evidence: `gui.py`)
- IP API client → ipify API: requests public IP (evidence: `src/api_client.py`)
- ipify API → IP API client: returns IP (evidence: `src/api_client.py`)
- IP API client → ipwho.is API: requests IP details (evidence: `src/api_client.py`)
- ipwho.is API → IP API client: returns lookup data (evidence: `src/api_client.py`)
- Console display → Console user: shows results (evidence: `src/display.py`)
