# paulomatheuz/github-profile-viewer architecture

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

- Interactive diagram: https://gitdiagram.com/paulomatheuz/github-profile-viewer
- Repository: https://github.com/paulomatheuz/github-profile-viewer

## Overview

GitHub Profile Viewer is a small terminal application: it reads a username, validates it, fetches the public GitHub profile, handles the HTTP result, and displays selected fields. The main module owns the workflow; validation and HTTP access are separate internal layers. README capabilities are represented where supported by the excerpts. The error handling and profile formatting are implemented in main.py; no storage layer is present.

Main entry points: [`main.py`](https://github.com/paulomatheuz/github-profile-viewer/blob/master/main.py) (Profile workflow), [`github_client.py`](https://github.com/paulomatheuz/github-profile-viewer/blob/master/github_client.py) (GitHub client), [`validators.py`](https://github.com/paulomatheuz/github-profile-viewer/blob/master/validators.py) (Username validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_terminal_user(("Terminal user"))
node_main_flow["Profile workflow<br/>[main.py]"]
node_username_validation["Username validation<br/>[validators.py]"]
node_github_client["GitHub client<br/>[github_client.py]"]
node_github_api["GitHub REST API"]

node_terminal_user -->|"enters username"| node_main_flow
node_main_flow -->|"validates username"| node_username_validation
node_main_flow -->|"requests profile"| node_github_client
node_github_client -->|"sends HTTP request"| node_github_api
node_github_client -->|"returns response"| node_main_flow
node_main_flow -->|"displays profile or error"| node_terminal_user

click node_main_flow "https://github.com/paulomatheuz/github-profile-viewer/blob/master/main.py"
click node_username_validation "https://github.com/paulomatheuz/github-profile-viewer/blob/master/validators.py"
click node_github_client "https://github.com/paulomatheuz/github-profile-viewer/blob/master/github_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_terminal_user,node_username_validation,node_github_client toneBlue
class node_main_flow toneTeal
class node_github_api toneMint
```

## Components

### Other components

- **Terminal user**
- [Profile workflow](https://github.com/paulomatheuz/github-profile-viewer/blob/master/main.py): `main.py`
- [Username validation](https://github.com/paulomatheuz/github-profile-viewer/blob/master/validators.py): `validators.py`
- [GitHub client](https://github.com/paulomatheuz/github-profile-viewer/blob/master/github_client.py): `github_client.py`
- **GitHub REST API**

## Connections

- Terminal user → Profile workflow: enters username (evidence: `README.md`)
- Profile workflow → Username validation: validates username (evidence: `main.py`)
- Profile workflow → GitHub client: requests profile (evidence: `main.py`)
- GitHub client → GitHub REST API: sends HTTP request (evidence: `github_client.py`)
- GitHub client → Profile workflow: returns response (evidence: `main.py`)
- Profile workflow → Terminal user: displays profile or error (evidence: `main.py`)
