# ezioxtn/instabooster architecture

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

- Interactive diagram: https://gitdiagram.com/ezioxtn/instabooster
- Repository: https://github.com/ezioxtn/instabooster

## Overview

##### Project type and purpose
- This is a monolithic, CLI-driven Python tool (“Instagram Booster”) whose sole purpose is to automate Instagram interactions (follow, like, comment, view) based on a JSON configuration or command-line flags.

##### File structure
- Top-level files only:
- main.py – the entry point and orchestration layer
- config.json – user settings (credentials, target, actions, debug)
- comments.txt – payloads for comment action
- README.md / LICENSE – documentation
- No separate frontend/backend directories → single process

##### README for insights
- Enumerates features (followers, views, likes, comments)
- Describes required Python modules (requests, httpx, threading, concurrent.futures, prettytable, etc.)
- Explains config format and CLI args

##### Main components
a. Presentation Layer (CLI Interface)
- Parses command-line flags and/or reads config.json
b. Core Engine
- Scheduler / Orchestrator in main.py
- Concurrency module: threading + concurrent.futures executor
c. Action Modules (Plugins)
- FollowAction
- LikeAction
- CommentAction (uses comments.txt)
- ViewAction
d. HTTP Client Layer
- requests or httpx wrapper for all Instagram HTTP calls
- Rate-limiting / backoff logic (time module)
e. Data Layer
- Config loader (json module)
- Comments loader (plain text)
f. Reporting / Logging
- prettytable for tabular output
g. External Service
- Instagram Web Endpoints (public API / scraping endpoints)

##### Relationships & data flow
- CLI → Core Engine (passes config+flags)
- Core Engine → Concurrency Executor → dispatches to each Action Module
- Action Module → HTTP Client → Instagram endpoints
- HTTP Client → returns responses → Action Module → updates metrics
- Core Engine → Reporting Layer → console output / logs

##### Architectural patterns & principles
- Modular “plugin” pattern for each Action
- Separation of concerns: CLI parsing, orchestration, HTTP calls, data/config, reporting
- Concurrency pattern: thread pool for parallel requests

##### Essential details to capture
- Shared HTTP client and concurrency executor used by all actions
- How config.json and command-line args merge into a single settings object
- Output directed to prettytable/log console

1. Sketch the high-level flow: CLI → Engine → Actions → HTTP → Instagram → Reporting
2. Break down into components and subcomponents (plugins + shared services)
3. Resource nodes (config.json, comments.txt)
4. Concurrency pool as an infrastructure block between engine and actions
7. Review against README features to ensure completeness (followers, likes, comments, views)

## Diagram (Mermaid)

```mermaid
flowchart TB
    CLI["CLI Parser"]:::internal
    Config["config.json"]:::resource
    Engine["Core Engine (Orchestrator)"]:::internal
    Executor["Concurrency Executor"]:::infra
    subgraph "Action Modules"
        FAction["FollowAction"]:::internal
        LAction["LikeAction"]:::internal
        CAction["CommentAction"]:::internal
        VAction["ViewAction"]:::internal
    end
    ActionResource["comments.txt"]:::resource
    HTTP["HTTP Client Layer"]:::internal
    External["Instagram Web API"]:::external
    Report["Reporting / Logging"]:::internal
    README["README.md"]:::resource
    License["LICENSE"]:::resource

    Config -->|"Config object"| CLI
    CLI -->|"CLI args & settings"| Engine
    Engine -->|"Dispatch tasks"| Executor
    Executor -->|"run()"| FAction
    Executor -->|"run()"| LAction
    Executor -->|"run()"| CAction
    Executor -->|"run()"| VAction

    CAction -->|"load comments"| ActionResource
    FAction -->|"HTTP Request"| HTTP
    LAction -->|"HTTP Request"| HTTP
    CAction -->|"HTTP Request"| HTTP
    VAction -->|"HTTP Request"| HTTP

    HTTP -->|"send/receive"| External
    HTTP -->|"HTTP Response"| FAction
    HTTP -->|"HTTP Response"| LAction
    HTTP -->|"HTTP Response"| CAction
    HTTP -->|"HTTP Response"| VAction

    Engine -->|"metrics"| Report

    CLI --> README
    CLI --> License

    click CLI "https://github.com/ezioxtn/instabooster/blob/main/main.py"
    click Engine "https://github.com/ezioxtn/instabooster/blob/main/main.py"
    click Executor "https://github.com/ezioxtn/instabooster/blob/main/main.py"
    click FAction "https://github.com/ezioxtn/instabooster/blob/main/main.py"
    click LAction "https://github.com/ezioxtn/instabooster/blob/main/main.py"
    click CAction "https://github.com/ezioxtn/instabooster/blob/main/main.py"
    click VAction "https://github.com/ezioxtn/instabooster/blob/main/main.py"
    click HTTP "https://github.com/ezioxtn/instabooster/blob/main/main.py"
    click Report "https://github.com/ezioxtn/instabooster/blob/main/main.py"
    click Config "https://github.com/ezioxtn/instabooster/blob/main/config.json"
    click ActionResource "https://github.com/ezioxtn/instabooster/blob/main/comments.txt"
    click README "https://github.com/ezioxtn/instabooster/blob/main/README.md"
    click License "https://github.com/ezioxtn/instabooster/tree/main/LICENSE"

    classDef internal fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef resource fill:#98FB98,stroke:#333,stroke-width:1px
    classDef external fill:#FFA500,stroke:#333,stroke-width:1px
    classDef infra fill:#D3D3D3,stroke:#333,stroke-width:1px
```
