# errornointernet/openheimer architecture

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

- Interactive diagram: https://gitdiagram.com/errornointernet/openheimer
- Repository: https://github.com/errornointernet/openheimer

## Overview

##### Main Components

a) Core Scanner Components:
- IP Scanner Module (scanner.go)
- Pinger Module (pinger.go)
- IP Management Module (ips.go)
- Main Orchestrator (main.go)

b) External Components:
- Database Storage (SQLite)
- Log File System
- Input Sources (IP file or range)

**[Input Layer]**

**[Core Processing Layer]**

**[Storage Layer]**

##### Specific Component Details

a) Input Layer:
- IP Range Input (starting from user-defined IP)
- IP File Input (optional file-based input)

b) Core Processing Layer:
- Worker Pool Manager
- Ping Workers (up to 4000 concurrent)
- Scan Workers (up to 1000 concurrent)
- IP Address Manager
- Port Scanner
- Minecraft Server Validator

c) Storage Layer:
- Database Connection (SQLite)
- Log File Writer

##### Flow Representation

- Input → IP Manager
- IP Manager → Ping Workers
- Ping Workers → Scan Workers
- Scan Workers → Database
- All Components → Logger

##### Important Elements to Highlight

- Concurrent Processing:
- Worker pool architecture
- Scaling capabilities (16,000 IPs/second)

- Data Flow:
- IP address progression
- Validation results
- Storage operations

##### Technical Details

- Worker Pool Sizes:
- Ping Workers: 4000 max
- Scan Workers: 1000 max

- Performance Metrics:
- Scanning Speed: 16,000 IPs/second
- Timeout Settings: 5 seconds default

##### Additional Notes

- Worker pool configurations
- Performance characteristics
- Data flow patterns
- Configuration options

Remember to include configuration parameters as they play a crucial role in the system's operation:
- Database file location
- Log file settings
- Worker pool sizes
- Timeout values
- IP range parameters

This architecture should be represented as a high-performance, concurrent scanning system with clear separation between IP discovery, validation, and storage components.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Input Layer
    subgraph Input
        IPRange[IP Range Input]:::input
        IPFile[IP File Input]:::input
    end

    %% Core Processing Layer
    subgraph Processing
        Main[Main Orchestrator]:::core
        IPManager[IP Address Manager]:::core
        
        subgraph "Worker Pools"
            PingPool[Ping Workers<br/>Max: 4000 concurrent]:::worker
            ScanPool[Scan Workers<br/>Max: 1000 concurrent]:::worker
        end
        
        Scanner[Port Scanner]:::core
        Pinger[Minecraft Pinger]:::core
        Validator[Server Validator]:::core
    end

    %% Storage Layer
    subgraph Storage
        DB[(SQLite Database)]:::storage
        Logger[Log File System]:::storage
    end

    %% Connections
    IPRange --> Main
    IPFile --> Main
    Main --> IPManager
    IPManager --> PingPool
    PingPool --> Pinger
    Pinger --> ScanPool
    ScanPool --> Scanner
    Scanner --> Validator
    Validator --> DB
    
    %% Logger connections
    Main -.-> Logger
    IPManager -.-> Logger
    PingPool -.-> Logger
    ScanPool -.-> Logger
    Scanner -.-> Logger
    Validator -.-> Logger

    %% Click Events
    click Main "https://github.com/ErrorNoInternet/openheimer/blob/main/main.go"
    click IPManager "https://github.com/ErrorNoInternet/openheimer/blob/main/ips.go"
    click Scanner "https://github.com/ErrorNoInternet/openheimer/blob/main/scanner.go"
    click Pinger "https://github.com/ErrorNoInternet/openheimer/blob/main/pinger.go"

    %% Styles
    classDef input fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef worker fill:#f1c40f,stroke:#f39c12,color:black
    classDef storage fill:#e74c3c,stroke:#c0392b,color:white

    %% Legend
    subgraph Legend
        L1[Input Components]:::input
        L2[Core Components]:::core
        L3[Worker Pools]:::worker
        L4[Storage Components]:::storage
    end
```
