# igouss/aggress architecture

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

- Interactive diagram: https://gitdiagram.com/igouss/aggress
- Repository: https://github.com/igouss/aggress

## Overview

##### Main Components Identification

The system consists of several key components:
- Crawler Service
- Frontend Service
- Storage Service (Redis + Elasticsearch)
- Web Admin Interface
- Common Libraries

##### Component Relationships

- Crawler → Redis (raw data storage)
- Parsers → Elasticsearch (processed data)
- Frontend ← Elasticsearch (search queries)
- WebAdmin ← All Components (monitoring)

##### Technical Details

- Docker containers (shown as boundaries around services)
- Java/Kotlin components
- External dependencies (Bootstrap, AdminLTE, etc.)
- Communication protocols (REST/HTTP)

##### Additional Elements

Include:
- Version information
- Technology stack labels
- Docker container boundaries
- Service health monitoring paths

##### Frontend/Admin interfaces

Remember to show the configuration management aspects (properties files, certificates) as these are crucial for deployment and security.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "External Layer"
        EXT[External Websites]:::external
    end

    subgraph "Data Collection Layer"
        CR[Crawler]:::service
        HC["HTTP Client"]:::component
        PM["Proxy Manager"]:::component
        WPP["Web Page Parsers"]:::parser
        PP["Product Parsers"]:::parser
        
        CR --> HC
        CR --> PM
        CR --> WPP
        CR --> PP
    end

    subgraph "Data Processing Layer"
        PS["Product Service"]:::service
        WS["Web Page Service"]:::service
        SCH["Scheduler"]:::service
    end

    subgraph "Storage Layer"
        RD[(Redis)]:::database
        ES[(Elasticsearch)]:::database
        SE["Storage Encoders"]:::component
    end

    subgraph "Presentation Layer"
        FS["Frontend Service"]:::service
        SH["Search Handler"]:::component
        IH["Index Handler"]:::component
        WA["Web Admin"]:::admin
        MD["Monitoring Dashboard"]:::admin
    end

    %% Relationships
    EXT --> CR
    CR --> RD
    WPP --> PS
    PP --> PS
    PS --> SE
    SE --> ES
    WS --> ES
    FS --> SH
    FS --> IH
    SH --> ES
    IH --> ES
    WA --> MD
    MD --> CR
    MD --> FS
    MD --> RD
    MD --> ES

    %% Click Events
    click CR "https://github.com/igouss/aggress/blob/master/crawler/src/main/java/com/naxsoft/Crawler.java"
    click HC "https://github.com/igouss/aggress/blob/master/crawler/src/main/java/com/naxsoft/crawler/AhcHttpClient.java"
    click PM "https://github.com/igouss/aggress/blob/master/crawler/src/main/java/com/naxsoft/crawler/ProxyManager.java"
    click WPP "https://github.com/igouss/aggress/tree/master/crawler/src/main/java/com/naxsoft/parsers/webPageParsers/"
    click PP "https://github.com/igouss/aggress/tree/master/crawler/src/main/java/com/naxsoft/parsers/productParser/"
    click FS "https://github.com/igouss/aggress/blob/master/frontend/src/main/java/com/naxsoft/Server.java"
    click SH "https://github.com/igouss/aggress/blob/master/frontend/src/main/java/com/naxsoft/handlers/SearchHandler.java"
    click IH "https://github.com/igouss/aggress/blob/master/frontend/src/main/java/com/naxsoft/handlers/IndexHandler.java"
    click RD "https://github.com/igouss/aggress/blob/master/storage/src/main/java/com/naxsoft/storage/redis/RedisDatabase.java"
    click ES "https://github.com/igouss/aggress/blob/master/storage/src/main/java/com/naxsoft/storage/elasticsearch/Elastic.java"
    click SE "https://github.com/igouss/aggress/tree/master/storage/src/main/java/com/naxsoft/encoders/"
    click WA "https://github.com/igouss/aggress/blob/master/webadmin/src/main/kotlin/WebAdmin.kt"
    click MD "https://github.com/igouss/aggress/blob/master/crawler/src/main/java/com/naxsoft/utils/HealthMonitor.java"

    %% Styling
    classDef service fill:#2374f7,stroke:#000,stroke-width:2px,color:#fff
    classDef component fill:#3498db,stroke:#000,stroke-width:1px,color:#fff
    classDef parser fill:#e67e22,stroke:#000,stroke-width:1px,color:#fff
    classDef database fill:#27ae60,stroke:#000,stroke-width:2px,color:#fff
    classDef admin fill:#9b59b6,stroke:#000,stroke-width:1px,color:#fff
    classDef external fill:#95a5a6,stroke:#000,stroke-width:1px,color:#fff

    %% Legend
    subgraph Legend
        L1[Service]:::service
        L2[Component]:::component
        L3[Parser]:::parser
        L4[(Database)]:::database
        L5[Admin Tool]:::admin
        L6[External]:::external
    end
```
