# santiesleo/ti2-2025-1-e7probabilibets architecture

> Architecture diagram of the GitHub repository santiesleo/ti2-2025-1-e7probabilibets, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/santiesleo/ti2-2025-1-e7probabilibets
- Repository: https://github.com/santiesleo/ti2-2025-1-e7probabilibets

## Overview

##### Project type and purpose
- From the file tree and docs, this is a predictive‐analytics application for sports matches. It ingests historical datasets (matches, seasons, team stats), applies Bayesian and rule‐based inference to generate predictions, and exposes those predictions via a Telegram bot UI.

##### File structure
- Top-level:
– datasets/ (raw CSV data)
– src/
· data/ (DataManager: loading, cleaning, caching CSVs)
· inference/ (BayesianModel, BayesianAnalyzer, MatchAnalyzer, RuleEngine)
· ui/ (TelegramBot adaptor)
– main.py (entry point/orchestrator)
– tests/ (unit and stress tests)
– docs/ (requirements, analysis, report)
- Config/build: requirements.txt, .python-version, .gitignore
- The pattern is a layered architecture: Data → Inference → Presentation.

##### README
- The README itself contains only a classroom badge, so we rely on docs/*.md for design insights. The docs likely describe data flows, model training, and inference steps.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Layer
    subgraph "Data Layer"
        direction TB
        Datasets["Raw Datasets (CSV)"]:::data
        DataManager["DataManager"]:::data
    end

    %% Inference Layer
    subgraph "Inference Layer"
        direction TB
        BayesianModel["BayesianModel"]:::inference
        BayesianAnalyzer["BayesianAnalyzer"]:::inference
        RuleEngine["RuleEngine"]:::inference
        MatchAnalyzer["MatchAnalyzer"]:::inference
    end

    %% Orchestration
    subgraph "Orchestrator" 
        direction TB
        Main["main.py"]:::orchestration
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        TelegramBot["TelegramBot"]:::ui
        TelegramAPI["Telegram API"]:::external
        User["User"]:::external
    end

    %% Ancillary
    subgraph "Ancillary"
        direction TB
        Tests["Tests (unit & stress)"]:::ancillary
        Docs["Documentation"]:::ancillary
    end

    %% Data Flow
    Datasets -->|"load_data()"| DataManager
    DataManager -->|"get_data()"| BayesianAnalyzer
    DataManager -->|"get_data()"| RuleEngine
    BayesianModel -->|"provide_model()"| BayesianAnalyzer
    BayesianAnalyzer -->|"analyze()"| MatchAnalyzer
    RuleEngine -->|"apply_rules()"| MatchAnalyzer

    %% Orchestration Flow
    Main -->|"initialize()"| DataManager
    Main -->|"load_model()"| BayesianModel
    Main -->|"create_analyzers()"| BayesianAnalyzer
    Main -->|"create_analyzers()"| RuleEngine
    Main -->|"create_analyzers()"| MatchAnalyzer
    Main -->|"start()"| TelegramBot

    %% UI Flow
    User -->|"command"| TelegramBot
    TelegramBot -->|"invoke()"| MatchAnalyzer
    TelegramBot -->|"send_message()"| TelegramAPI

    %% Ancillary Relations
    Tests -.->|tests code| Main
    Docs -.->|reference| Main

    %% Click Events
    click Datasets "https://github.com/santiesleo/ti2-2025-1-e7probabilibets/tree/main/datasets/"
    click DataManager "https://github.com/santiesleo/ti2-2025-1-e7probabilibets/blob/main/src/data/data_manager.py"
    click BayesianModel "https://github.com/santiesleo/ti2-2025-1-e7probabilibets/blob/main/src/inference/bayesian_model.py"
    click BayesianAnalyzer "https://github.com/santiesleo/ti2-2025-1-e7probabilibets/blob/main/src/inference/bayesian_analyzer.py"
    click RuleEngine "https://github.com/santiesleo/ti2-2025-1-e7probabilibets/blob/main/src/inference/rule_engine.py"
    click MatchAnalyzer "https://github.com/santiesleo/ti2-2025-1-e7probabilibets/blob/main/src/inference/match_analyzer.py"
    click Main "https://github.com/santiesleo/ti2-2025-1-e7probabilibets/blob/main/main.py"
    click TelegramBot "https://github.com/santiesleo/ti2-2025-1-e7probabilibets/blob/main/src/ui/telegram_bot.py"
    click Tests "https://github.com/santiesleo/ti2-2025-1-e7probabilibets/tree/main/tests/"
    click Docs "https://github.com/santiesleo/ti2-2025-1-e7probabilibets/tree/main/docs/"

    %% Styles
    classDef data fill:#D0E6FF,stroke:#3399FF,stroke-width:2px
    classDef inference fill:#DFF2D8,stroke:#33AA33,stroke-width:2px
    classDef orchestration fill:#FFE5CC,stroke:#FF9933,stroke-width:2px
    classDef ui fill:#F3D9FF,stroke:#AA33AA,stroke-width:2px
    classDef external fill:#EEEEEE,stroke:#888888,stroke-width:1px,stroke-dasharray: 5 5
    classDef ancillary fill:#F5F5F5,stroke:#AAAAAA,stroke-width:1px,stroke-dasharray: 2 2
```
