# h-ssiqueira/followback architecture

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

- Interactive diagram: https://gitdiagram.com/h-ssiqueira/followback
- Repository: https://github.com/h-ssiqueira/followback

## Overview

Followback is a small Node.js utility that uses a GitHub token to find followers the authenticated user does not yet follow, then follows them. The main workflow is token retrieval, account-count lookup, paginated follower and following retrieval, set comparison, and follow requests. These behaviors are implemented together in script.js; the graph separates them by responsibility rather than implying separate modules. The README also documents running the script through GitHub Actions, but the workflow file was not sampled, so that integration is not mapped here.

Main entry points: [`script.js`](https://github.com/h-ssiqueira/followback/blob/master/script.js) (Workflow orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_run["Execution"]
  node_entry["Script runner<br/>[script.js]"]
  node_token["Token retrieval<br/>[script.js]"]
  node_request["HTTP request helper<br/>[script.js]"]
end

subgraph group_follow["Followback workflow"]
  node_orchestrator["Workflow orchestration<br/>[script.js]"]
  node_profile["Account counts<br/>[script.js]"]
  node_pagination["Login pagination<br/>[script.js]"]
  node_followers["Follower pages<br/>[script.js]"]
  node_following["Following pages<br/>[script.js]"]
  node_compare["Missing-follow comparison<br/>[script.js]"]
  node_followuser["Follow user<br/>[script.js]"]
end

node_user(("Operator"))
node_gitconfig["Git configuration"]
node_github["GitHub API"]

node_user -->|"runs"| node_entry
node_entry -->|"starts"| node_orchestrator
node_orchestrator -->|"retrieves token"| node_token
node_token -->|"reads fallback"| node_gitconfig
node_orchestrator -->|"gets counts"| node_profile
node_profile -->|"requests profile"| node_request
node_orchestrator -->|"retrieves logins"| node_pagination
node_pagination -->|"pages through"| node_followers
node_pagination -->|"pages through"| node_following
node_followers -->|"requests pages"| node_request
node_following -->|"requests pages"| node_request
node_orchestrator -->|"compares lists"| node_compare
node_compare -->|"selects logins"| node_followuser
node_followuser -->|"sends follow"| node_request
node_request -->|"sends HTTP"| node_github

click node_entry "https://github.com/h-ssiqueira/followback/blob/master/script.js"
click node_token "https://github.com/h-ssiqueira/followback/blob/master/script.js"
click node_orchestrator "https://github.com/h-ssiqueira/followback/blob/master/script.js"
click node_profile "https://github.com/h-ssiqueira/followback/blob/master/script.js"
click node_pagination "https://github.com/h-ssiqueira/followback/blob/master/script.js"
click node_followers "https://github.com/h-ssiqueira/followback/blob/master/script.js"
click node_following "https://github.com/h-ssiqueira/followback/blob/master/script.js"
click node_compare "https://github.com/h-ssiqueira/followback/blob/master/script.js"
click node_followuser "https://github.com/h-ssiqueira/followback/blob/master/script.js"
click node_request "https://github.com/h-ssiqueira/followback/blob/master/script.js"

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_entry,node_token,node_request toneBlue
class node_orchestrator,node_profile,node_pagination,node_followers,node_following,node_compare,node_followuser toneAmber
class node_user,node_gitconfig toneIndigo
class node_github toneMint
```

## Components

### Execution

- [Script runner](https://github.com/h-ssiqueira/followback/blob/master/script.js): `script.js`
- [Token retrieval](https://github.com/h-ssiqueira/followback/blob/master/script.js): `script.js`
- [HTTP request helper](https://github.com/h-ssiqueira/followback/blob/master/script.js): `script.js`

### Followback workflow

- [Workflow orchestration](https://github.com/h-ssiqueira/followback/blob/master/script.js): `script.js`
- [Account counts](https://github.com/h-ssiqueira/followback/blob/master/script.js): `script.js`
- [Login pagination](https://github.com/h-ssiqueira/followback/blob/master/script.js): `script.js`
- [Follower pages](https://github.com/h-ssiqueira/followback/blob/master/script.js): `script.js`
- [Following pages](https://github.com/h-ssiqueira/followback/blob/master/script.js): `script.js`
- [Missing-follow comparison](https://github.com/h-ssiqueira/followback/blob/master/script.js): `script.js`
- [Follow user](https://github.com/h-ssiqueira/followback/blob/master/script.js): `script.js`

### Other components

- **Operator**
- **Git configuration**
- **GitHub API**

## Connections

- Operator → Script runner: runs (evidence: `README.md`)
- Script runner → Workflow orchestration: starts (evidence: `script.js`)
- Workflow orchestration → Token retrieval: retrieves token (evidence: `script.js`)
- Token retrieval → Git configuration: reads fallback (evidence: `script.js`)
- Workflow orchestration → Account counts: gets counts (evidence: `script.js`)
- Account counts → HTTP request helper: requests profile (evidence: `script.js`)
- Workflow orchestration → Login pagination: retrieves logins (evidence: `script.js`)
- Login pagination → Follower pages: pages through (evidence: `script.js`)
- Login pagination → Following pages: pages through (evidence: `script.js`)
- Follower pages → HTTP request helper: requests pages (evidence: `script.js`)
- Following pages → HTTP request helper: requests pages (evidence: `script.js`)
- Workflow orchestration → Missing-follow comparison: compares lists (evidence: `script.js`)
- Missing-follow comparison → Follow user: selects logins (evidence: `script.js`)
- Follow user → HTTP request helper: sends follow (evidence: `script.js`)
- HTTP request helper → GitHub API: sends HTTP (evidence: `script.js`)
