# lichess-org/lila-openingexplorer architecture

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

- Interactive diagram: https://gitdiagram.com/lichess-org/lila-openingexplorer
- Repository: https://github.com/lichess-org/lila-openingexplorer

## Overview

No explanation provided

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef api fill:#3498db,stroke:#2980b9,color:white
    classDef db fill:#e67e22,stroke:#d35400,color:white
    classDef ingestion fill:#2ecc71,stroke:#27ae60,color:white
    classDef monitor fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef cache fill:#9b59b6,stroke:#8e44ad,color:white
    classDef core fill:#34495e,stroke:#2c3e50,color:white

    %% Client Layer
    Client[Client Requests]

    %% API Layer
    API[API Layer]:::api
    Masters["Masters Endpoint"]:::api
    Lichess["Lichess Endpoint"]:::api
    Player["Player Endpoint"]:::api

    %% Core Processing
    Core[Core Processing]:::core
    OpeningLogic["Opening Logic"]:::core
    ChessLogic["Chess Logic"]:::core
    QueryProc["Query Processing"]:::core

    %% Database Layer
    DB[(RocksDB)]:::db
    MastersDB[(Masters CF)]:::db
    LichessDB[(Lichess CF)]:::db
    PlayerDB[(Player CF)]:::db
    BlockCache[("Block Cache\n40GB")]:::cache

    %% Data Ingestion
    PGNSource[PGN Sources]:::ingestion
    ImportProcess["Import Process"]:::ingestion
    Compression["Compression\nHandler"]:::ingestion

    %% Monitoring
    Monitor["Monitoring System"]:::monitor
    Metrics["Metrics Collection"]:::monitor
    InfluxDB["InfluxDB Protocol"]:::monitor

    %% Relationships
    Client --> API
    API --> |Request| Core
    Core --> |Response| API
    Core --> DB
    DB --> BlockCache
    DB --- MastersDB
    DB --- LichessDB
    DB --- PlayerDB
    PGNSource --> ImportProcess
    ImportProcess --> Compression
    Compression --> DB
    Core --> Monitor
    Monitor --> Metrics
    Metrics --> InfluxDB
    API --> Masters & Lichess & Player
    Core --> OpeningLogic & ChessLogic & QueryProc

    %% Click events
    click API "https://github.com/lichess-org/lila-openingexplorer/tree/master/src/api"
    click Core "https://github.com/lichess-org/lila-openingexplorer/blob/master/src/db.rs"
    click ImportProcess "https://github.com/lichess-org/lila-openingexplorer/tree/master/src/indexer"
    click Monitor "https://github.com/lichess-org/lila-openingexplorer/blob/master/src/metrics.rs"
    click OpeningLogic "https://github.com/lichess-org/lila-openingexplorer/blob/master/src/opening.rs"
    click ChessLogic "https://github.com/lichess-org/lila-openingexplorer/blob/master/src/zobrist.rs"
    click QueryProc "https://github.com/lichess-org/lila-openingexplorer/blob/master/src/api/query.rs"
    click Masters "https://github.com/lichess-org/lila-openingexplorer/blob/master/src/model/masters.rs"
    click Lichess "https://github.com/lichess-org/lila-openingexplorer/blob/master/src/model/lichess.rs"
    click Player "https://github.com/lichess-org/lila-openingexplorer/blob/master/src/model/player.rs"

    %% Legend
    subgraph Legend
        L1[API Endpoints]:::api
        L2[(Database)]:::db
        L3[Ingestion]:::ingestion
        L4[Monitoring]:::monitor
        L5[Cache]:::cache
    end
```
