# sho-luv/gitwho architecture

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

- Interactive diagram: https://gitdiagram.com/sho-luv/gitwho
- Repository: https://github.com/sho-luv/gitwho

## Overview

gitwho accepts a GitHub username through either its CLI or web interface, collects public profile data, enriches it with rule-based analysis and optional extras, then presents or serializes the result. A separate Cloudflare Worker backs the hosted web version and uses KV caching; the README documents the hosted frontend-to-Worker connection. The Worker excerpt is partial, so its internal collection and analysis stages are not mapped separately.

Main entry points: [`web/app.py`](https://github.com/sho-luv/gitwho/blob/main/web/app.py) (Flask application), [`gitwho.py`](https://github.com/sho-luv/gitwho/blob/main/gitwho.py) (CLI), [`analyzer.py`](https://github.com/sho-luv/gitwho/blob/main/analyzer.py) (Rule-based analysis), [`worker/index.js`](https://github.com/sho-luv/gitwho/blob/main/worker/index.js) (Cloudflare API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI<br/>[gitwho.py]"]
  node_webui["Web interface"]
  node_webjs["Web interactions<br/>[script.js]"]
  node_webapp["Flask application<br/>[app.py]"]
  node_cache[("Web profile cache<br/>[app.py]")]
  node_cliresult["CLI results<br/>[gitwho.py]"]
  node_webresult["Web results<br/>[results.html]"]
end

subgraph group_collection["Profile collection"]
  node_githubapi["GitHub data access<br/>[github_api.py]"]
  node_scraper["Profile extras scraper<br/>[scraper.py]"]
end

subgraph group_intelligence["Profile intelligence"]
  node_analyzer["Rule-based analysis<br/>[analyzer.py]"]
end

subgraph group_hosted["Hosted service"]
  node_workerui["Hosted frontend<br/>[app.js]"]
  node_worker["Cloudflare API<br/>[index.js]"]
  node_kv[("Worker KV<br/>[index.js]")]
end

node_user(("User"))
node_github{{"GitHub"}}
node_ollama{{"Ollama"}}
node_huggingface{{"Hugging Face"}}

node_user -->|"runs analysis"| node_cli
node_cli -->|"fetches profile"| node_githubapi
node_githubapi -->|"requests data"| node_github
node_cli -->|"analyzes data"| node_analyzer
node_cli -->|"scrapes extras"| node_scraper
node_analyzer -.->|"optional enhancement"| node_ollama
node_analyzer -.->|"optional enhancement"| node_huggingface
node_cli -->|"renders or serializes"| node_cliresult
node_user -->|"searches profile"| node_webui
node_webui -->|"submits search"| node_webjs
node_webjs -->|"requests search"| node_webapp
node_webapp -->|"reads and writes"| node_cache
node_webapp -->|"fetches profile"| node_githubapi
node_webapp -->|"analyzes data"| node_analyzer
node_webapp -->|"scrapes extras"| node_scraper
node_webapp -->|"renders results"| node_webresult
node_webapp -.->|"optional enhancement"| node_ollama
node_webapp -.->|"optional enhancement"| node_huggingface
node_user -.->|"searches hosted site"| node_workerui
node_workerui -.->|"calls API"| node_worker
node_worker -->|"fetches public data"| node_github
node_worker -->|"reads and writes cache"| node_kv

click node_cli "https://github.com/sho-luv/gitwho/blob/main/gitwho.py"
click node_webui "https://github.com/sho-luv/gitwho/tree/main/web/templates"
click node_webjs "https://github.com/sho-luv/gitwho/blob/main/web/static/script.js"
click node_webapp "https://github.com/sho-luv/gitwho/blob/main/web/app.py"
click node_githubapi "https://github.com/sho-luv/gitwho/blob/main/github_api.py"
click node_scraper "https://github.com/sho-luv/gitwho/blob/main/scraper.py"
click node_analyzer "https://github.com/sho-luv/gitwho/blob/main/analyzer.py"
click node_cache "https://github.com/sho-luv/gitwho/blob/main/web/app.py"
click node_workerui "https://github.com/sho-luv/gitwho/blob/main/docs/app.js"
click node_worker "https://github.com/sho-luv/gitwho/blob/main/worker/index.js"
click node_kv "https://github.com/sho-luv/gitwho/blob/main/worker/index.js"
click node_cliresult "https://github.com/sho-luv/gitwho/blob/main/gitwho.py"
click node_webresult "https://github.com/sho-luv/gitwho/blob/main/web/templates/results.html"

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_cli,node_webui,node_webjs,node_webapp,node_cache,node_cliresult,node_webresult,node_user toneBlue
class node_githubapi,node_scraper toneAmber
class node_analyzer toneMint
class node_workerui,node_worker,node_kv toneRose
class node_github,node_ollama,node_huggingface toneIndigo
```

## Components

### User interfaces

- [CLI](https://github.com/sho-luv/gitwho/blob/main/gitwho.py): `gitwho.py`
- [Web interface](https://github.com/sho-luv/gitwho/tree/main/web/templates): `web/templates`
- [Web interactions](https://github.com/sho-luv/gitwho/blob/main/web/static/script.js): `web/static/script.js`
- [Flask application](https://github.com/sho-luv/gitwho/blob/main/web/app.py): `web/app.py`
- [Web profile cache](https://github.com/sho-luv/gitwho/blob/main/web/app.py): `web/app.py`
- [CLI results](https://github.com/sho-luv/gitwho/blob/main/gitwho.py): `gitwho.py`
- [Web results](https://github.com/sho-luv/gitwho/blob/main/web/templates/results.html): `web/templates/results.html`

### Profile collection

- [GitHub data access](https://github.com/sho-luv/gitwho/blob/main/github_api.py): `github_api.py`
- [Profile extras scraper](https://github.com/sho-luv/gitwho/blob/main/scraper.py): `scraper.py`

### Profile intelligence

- [Rule-based analysis](https://github.com/sho-luv/gitwho/blob/main/analyzer.py): `analyzer.py`

### Hosted service

- [Hosted frontend](https://github.com/sho-luv/gitwho/blob/main/docs/app.js): `docs/app.js`
- [Cloudflare API](https://github.com/sho-luv/gitwho/blob/main/worker/index.js): `worker/index.js`
- [Worker KV](https://github.com/sho-luv/gitwho/blob/main/worker/index.js): `worker/index.js`

### Other components

- **User**
- **GitHub**
- **Ollama**
- **Hugging Face**

## Connections

- User → CLI: runs analysis
- CLI → GitHub data access: fetches profile
- GitHub data access → GitHub: requests data
- CLI → Rule-based analysis: analyzes data
- CLI → Profile extras scraper: scrapes extras
- Rule-based analysis → Ollama: optional enhancement
- Rule-based analysis → Hugging Face: optional enhancement
- CLI → CLI results: renders or serializes
- User → Web interface: searches profile
- Web interface → Web interactions: submits search
- Web interactions → Flask application: requests search
- Flask application → Web profile cache: reads and writes
- Flask application → GitHub data access: fetches profile
- Flask application → Rule-based analysis: analyzes data
- Flask application → Profile extras scraper: scrapes extras
- Flask application → Web results: renders results
- Flask application → Ollama: optional enhancement
- Flask application → Hugging Face: optional enhancement
- User → Hosted frontend: searches hosted site
- Hosted frontend → Cloudflare API: calls API
- Cloudflare API → GitHub: fetches public data
- Cloudflare API → Worker KV: reads and writes cache
