# dkhamsing/awesome_bot architecture

> Architecture diagram of the GitHub repository dkhamsing/awesome_bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dkhamsing/awesome_bot
- Repository: https://github.com/dkhamsing/awesome_bot

## Overview

##### Main Components Identification
The system should be represented with these key components:

a) Core Components:
- Link Parser
- URL Validator
- Results Processor
- CLI Interface
- Configuration Handler

b) External Interfaces:
- HTTP Client (for URL checking)
- File System Interface
- CI Integration Points (GitHub Actions, Travis CI, etc.)

##### Component Relationships and Architecture

**Input Layer**

- ▼
**Processing Layer**

- ▼
**Output Layer**

##### Specific Implementation Details

a) Input Layer (Blue Components):
- File Input Handler (processes markdown files)
- CLI Interface (handles command-line arguments)
- Configuration Parser (processes white lists and options)

b) Processing Layer (Green Components):
- Link Extractor (from lib/awesome_bot/links.rb)
- URL Validator (from lib/awesome_bot/net.rb)
- Status Checker (handles HTTP responses)
- White List Processor (from lib/awesome_bot/white_list.rb)

c) Output Layer (Orange Components):
- Results Formatter (from lib/awesome_bot/result.rb)
- JSON Writer (for CI integration)
- Console Output Generator

##### Integration Points (Purple Components)
- CI System Connectors
- GitHub Actions Interface
- Docker Container Interface

##### Technical Details

Annotations for:
- Ruby Version Requirements
- External Dependencies
- HTTP Client Configuration
- Timeout Settings
- Status Code Handling

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef input fill:#a8d1f0,stroke:#333
    classDef processing fill:#90EE90,stroke:#333
    classDef output fill:#FFB347,stroke:#333
    classDef integration fill:#DDA0DD,stroke:#333
    classDef interface fill:#F0E68C,stroke:#333

    %% Input Layer
    subgraph Input
        CLI["CLI Interface"]:::input
        FSI["File System Interface"]:::input
        Config["Configuration Handler"]:::input
    end

    %% Processing Layer
    subgraph Processing
        LinkParser["Link Parser"]:::processing
        URLValidator["URL Validator"]:::processing
        StatusCheck["Status Checker"]:::processing
        WhiteList["White List Processor"]:::processing
    end

    %% Output Layer
    subgraph Output
        Results["Results Processor"]:::output
        JSONWriter["JSON Writer"]:::output
        ConsoleOut["Console Output Generator"]:::output
    end

    %% Integration Layer
    subgraph Integration
        GHActions["GitHub Actions"]:::integration
        CircleCI["CircleCI"]:::integration
        Docker["Docker Container"]:::integration
    end

    %% External Interfaces
    HTTP["HTTP Client"]:::interface

    %% Relationships
    CLI --> Config
    FSI --> LinkParser
    Config --> WhiteList
    
    LinkParser --> URLValidator
    URLValidator --> HTTP
    HTTP --> StatusCheck
    WhiteList --> StatusCheck
    
    StatusCheck --> Results
    Results --> JSONWriter
    Results --> ConsoleOut
    
    JSONWriter --> GHActions
    JSONWriter --> CircleCI
    ConsoleOut --> Docker

    %% Click Events
    click CLI "https://github.com/dkhamsing/awesome_bot/blob/master/lib/awesome_bot/cli.rb"
    click FSI "https://github.com/dkhamsing/awesome_bot/blob/master/lib/awesome_bot/write.rb"
    click Config "https://github.com/dkhamsing/awesome_bot/blob/master/lib/awesome_bot.rb"
    click LinkParser "https://github.com/dkhamsing/awesome_bot/blob/master/lib/awesome_bot/links.rb"
    click URLValidator "https://github.com/dkhamsing/awesome_bot/blob/master/lib/awesome_bot/net.rb"
    click StatusCheck "https://github.com/dkhamsing/awesome_bot/blob/master/lib/awesome_bot/check.rb"
    click WhiteList "https://github.com/dkhamsing/awesome_bot/blob/master/lib/awesome_bot/white_list.rb"
    click Results "https://github.com/dkhamsing/awesome_bot/blob/master/lib/awesome_bot/result.rb"
    click ConsoleOut "https://github.com/dkhamsing/awesome_bot/blob/master/lib/awesome_bot/output.rb"
    click GHActions "https://github.com/dkhamsing/awesome_bot/blob/master/.github/workflows/ci.yml"
    click CircleCI "https://github.com/dkhamsing/awesome_bot/blob/master/.circleci/config.yml"
    click Docker "https://github.com/dkhamsing/awesome_bot/tree/master/Dockerfile"

    %% Legend
    subgraph Legend
        L1["Input Components"]:::input
        L2["Processing Components"]:::processing
        L3["Output Components"]:::output
        L4["Integration Points"]:::integration
        L5["External Interfaces"]:::interface
    end
```
