# vishnusivadasvs/instagramautofollower architecture

> Architecture diagram of the GitHub repository vishnusivadasvs/instagramautofollower, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vishnusivadasvs/instagramautofollower
- Repository: https://github.com/vishnusivadasvs/instagramautofollower

## Overview

##### Project type and purpose
- This is a lightweight open-source JavaScript automation tool.
- Purpose: run in your browser console on Instagram pages to automatically click “Follow” on suggested or other users’ follower dialogs.

##### File structure
- Only one source file: Instagram-Auto-Follower.js
- No additional directories, build scripts or external services—everything runs client-side in the browser.

##### README for additional insights
- It describes two modes:
- suggested → runs on https://www.instagram.com/explore/people/suggested/
- othersfollowers → runs in any user’s followers pop-up
- You copy/paste the entire JS into the browser console and invoke FunctionMain(mode).

a. Main components
1. User’s Browser (Chrome/Firefox)
2. Browser Console & JavaScript Engine (V8, SpiderMonkey)
3. Instagram Web Page (DOM)
4. JavaScript Automation Logic (Instagram-Auto-Follower.js)
5. Instagram Backend API/Servers

b. Relationships & interactions
- User pastes script into Browser Console →
- Script attaches event loop timers to scan the DOM for “Follow” buttons →
- Script issues synthetic click events on those buttons →
- Browser sends HTTP POST requests to Instagram backend →
- Instagram backend responds, user is followed →
- Script tallies success/failure and repeats until the tab is closed.

c. Architectural patterns & design principles
- Client-side scripting only: no backend component in your repo.
- DOM polling or MutationObserver pattern to detect new buttons in a dynamically loaded UI.
- Rate-limit awareness: the script should respect delays between clicks to mimic human behavior.

d. Key technologies / libraries
- Vanilla JavaScript (ES6+)
- Instagram’s public web UI selectors & internal API endpoints (undocumented)
- Browser developer console

## Diagram (Mermaid)

```mermaid
flowchart TD
    User((User)):::client
    User-->BC["Browser Console & JS Engine"]:::client
    User-->|"reads docs"|ProjectDoc["README (Usage & Instructions)"]:::docs

    BC-->AS["Automation Script"]:::client
    AS-->DOM["Instagram Web Page (DOM)"]:::client
    AS-->|"scan DOM & detect “Follow” buttons"|DOM

    AS-->|"issue synthetic clicks"|Network{{"Network: HTTP Requests"}}:::network
    Network-->API(("Instagram API / Servers")):::backend
    API-->|"HTTP Responses"|AS

    AS-.->Ext["Extensions (Delay Config, Proxy Support)"]:::docs

    click AS "https://github.com/vishnusivadasvs/instagramautofollower/blob/master/Instagram-Auto-Follower.js"
    click ProjectDoc "https://github.com/vishnusivadasvs/instagramautofollower/blob/master/README.md"

    classDef client fill:#ADD8E6,stroke:#000;
    classDef network fill:#90EE90,stroke:#000;
    classDef backend fill:#FFA500,stroke:#000;
    classDef docs fill:#D3D3D3,stroke:#000,stroke-dasharray: 5 5;
```
