# nerdsinspace/nocomment-master architecture

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

- Interactive diagram: https://gitdiagram.com/nerdsinspace/nocomment-master
- Repository: https://github.com/nerdsinspace/nocomment-master

## Overview

##### Main components
- Controller Core – This is the central “nocomment-master” engine and includes the main entry point and core application logic (e.g., NoComment.java, Server.java, World.java).
- Tracking Module – Represented by packages under “tracking” (such as TrackyTrackyManager, MonteCarloParticleFilterMode, FilterMode classes). This module is responsible for monitoring players and handling the Monte Carlo particle filter for tracking.
- Clustering Module – Under the “clustering” subpackage (Aggregator, DBSCAN, HitRetry) which clusters incoming “hits” to determine base-related events.
- Networking Module – Located under “network” (BlockAPI, Connection, NoCommentServer, SocketConnection, etc.), which handles communication, connection management, and API endpoints (including ShitpostAPI for perhaps playful messaging).
- Scanning Module – The “scanners” package (HighwayScanner, RingScanner, SpiralScanner, ClusterRetryScanner) deals with selecting which areas to scan and on what schedule.
- Remote Data / Download Module (Slurp) – Found within the “slurp” package (BlockCheck, BlockCheckManager, ChunkManager, SignManager, SlurpManager) where remote base downloading and related tasks are managed.
- Database and Persistence Module – All functionality regarding data storage, asynchronous batch commits, maintenance, and metrics (packages under “db”).
- Task/Job Management – Under the “task” package, representing how tasks are prioritized and executed.
- Utility Services – All helper functionalities and shared utilities (e.g., Config, LoggingExecutor, Telegram, OnlinePlayer, TrackFixup) are found in the “util” package.
- CI/CD and Build Infrastructure – Reflect exposed files like Jenkinsfile, Dockerfile, docker-compose.ci.yml, Gradle scripts, and various CI scripts in the “scripts” folder. These show the internal pipelines for integration, deployment, and testing.

##### Relationships and Data Flow
- The Networking Module is the point of contact for external inputs and fetches data that feeds into the clustering, scanning, and tracking systems.
- The Task Management module serves as a mediator that organizes work across modules such as scanning, slurping, and clustering.
- The Utility module provides supportive functions to Core operations across modules.

##### Architectural Patterns & Design Principles
- Modular Monolithic Architecture: Though the project is contained in one codebase, it is clearly divided into bounded contexts (tracking, clustering, etc.), making it easier to isolate and understand each component.
- Separation of Concerns: Each package (tracking, networking, database, etc.) has a distinct responsibility linked together through controlled interfaces.
- Extensibility: The presence of various “Manager” and “Helper” classes hints at a design that encourages plugging in additional logic or variations (for example, additional scanning algorithms).
- CI/CD Integration: The use of Docker, Jenkins, and Gradle emphasizes that deployment and automated builds are critical parts of this specialized system.

##### Tools, Configurations, and Build Integration
- External dependencies or configurations such as “schema.sql” for database initialization and “proguard.config” for code obfuscation/shrinking in production.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Integration
    subgraph "External Integration"
        NET["Networking Module"]:::network
    end

    %% Controller Core Subgraph
    subgraph "Controller Core"
        NC["NoComment"]:::core
        SRV["Server"]:::core
        WLD["World"]:::core
    end

    %% Core Modules Subgraph
    subgraph "Modules"
        TRK["Tracking Module"]:::module
        CLS["Clustering Module"]:::module
        SCN["Scanning Module"]:::module
        RMT["Remote Data Module"]:::module
        TSK["Task Management"]:::module
        DB["Database Module"]:::database
        UTL["Utility Services"]:::utility
    end

    %% CI/CD Pipeline Subgraph
    subgraph "CI/CD Pipeline"
        DF["Dockerfile"]:::ci
        JF["Jenkinsfile"]:::ci
        DCY["docker-compose.ci.yml"]:::ci
        SCR["scripts"]:::ci
        GRD["build.gradle"]:::ci
        GRL["gradle"]:::ci
        PGC["proguard.config"]:::ci
        SCH["schema.sql"]:::ci
    end

    %% Relationships
    NET -->|"inputs"| NC
    NC -->|"orchestrates"| TRK
    NC -->|"orchestrates"| CLS
    NC -->|"orchestrates"| SCN
    TRK -->|"schedulesScanning"| SCN
    TRK -->|"correlatesHits"| CLS
    TRK -->|"persistsData"| DB
    CLS -->|"storesClusters"| DB
    SCN -->|"recordsScans"| DB
    RMT -->|"downloadsRemoteData"| DB
    TSK -->|"managesTasks"| SCN
    TSK -->|"managesTasks"| RMT
    TSK -->|"managesTasks"| CLS
    UTL -->|"supports"| NC
    UTL -->|"supports"| TRK
    UTL -->|"supports"| CLS
    UTL -->|"supports"| SCN
    DF ---|"buildTrigger"| NC
    JF ---|"buildTrigger"| NC
    DCY ---|"buildTrigger"| NC
    SCR ---|"buildTrigger"| NC
    GRD ---|"buildTrigger"| NC
    GRL ---|"buildTrigger"| NC
    PGC ---|"buildTrigger"| NC
    SCH ---|"buildTrigger"| NC

    %% Click Events for Controller Core
    click NC "https://github.com/nerdsinspace/nocomment-master/blob/master/src/main/java/nocomment/master/NoComment.java"
    click SRV "https://github.com/nerdsinspace/nocomment-master/blob/master/src/main/java/nocomment/master/Server.java"
    click WLD "https://github.com/nerdsinspace/nocomment-master/blob/master/src/main/java/nocomment/master/World.java"

    %% Click Events for Modules
    click TRK "https://github.com/nerdsinspace/nocomment-master/tree/master/src/main/java/nocomment/master/tracking/"
    click CLS "https://github.com/nerdsinspace/nocomment-master/tree/master/src/main/java/nocomment/master/clustering/"
    click NET "https://github.com/nerdsinspace/nocomment-master/tree/master/src/main/java/nocomment/master/network/"
    click SCN "https://github.com/nerdsinspace/nocomment-master/tree/master/src/main/java/nocomment/master/scanners/"
    click RMT "https://github.com/nerdsinspace/nocomment-master/tree/master/src/main/java/nocomment/master/slurp/"
    click DB "https://github.com/nerdsinspace/nocomment-master/tree/master/src/main/java/nocomment/master/db/"
    click TSK "https://github.com/nerdsinspace/nocomment-master/tree/master/src/main/java/nocomment/master/task/"
    click UTL "https://github.com/nerdsinspace/nocomment-master/tree/master/src/main/java/nocomment/master/util/"

    %% Click Events for CI/CD Pipeline
    click DF "https://github.com/nerdsinspace/nocomment-master/tree/master/Dockerfile"
    click JF "https://github.com/nerdsinspace/nocomment-master/tree/master/Jenkinsfile"
    click DCY "https://github.com/nerdsinspace/nocomment-master/blob/master/docker-compose.ci.yml"
    click SCR "https://github.com/nerdsinspace/nocomment-master/tree/master/scripts/"
    click GRD "https://github.com/nerdsinspace/nocomment-master/blob/master/build.gradle"
    click GRL "https://github.com/nerdsinspace/nocomment-master/tree/master/gradle/"
    click PGC "https://github.com/nerdsinspace/nocomment-master/blob/master/proguard.config"
    click SCH "https://github.com/nerdsinspace/nocomment-master/blob/master/schema.sql"

    %% Styles
    classDef core fill:#ffccff,stroke:#660066,stroke-width:2px;
    classDef module fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef network fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef database fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef utility fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef ci fill:#d1e7dd,stroke:#0f5132,stroke-width:2px;
```
