# miksyr/auto_super_six architecture

> Architecture diagram of the GitHub repository miksyr/auto_super_six, 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/miksyr/auto_super_six
- Repository: https://github.com/miksyr/auto_super_six

## Overview

Key Components to Include:

##### Core System Components
- Web Automation Layer (Selenium)
- Prediction Engine
- External Services Interface
- Data Models
- Strategy Engine

##### Main Flows and Interactions

A. External Systems (Top Layer):
- SuperSix Website
- Betfair Exchange API

B. Core Application Components (Middle Layer):
1. Web Automation Module:
- Webdriver.py as a component handling Selenium interactions
- Connection to SuperSix website

2. Betting Data Collection:
- Betfair_events.py as a component
- To Betfair Exchange

3. Strategy Engine (Central):
- Picking_strategies as a module with subcomponents:
- BasePickingStrategy
- SampleTopNProbabilities
- SampleUsingProbabilities
- TakeMostLikely

4. Data Models (Foundation Layer):
- SuperSixCompetition
- HomeOrAway
- PickingStrategyMap

C. Flow Directions:
1. Data Collection Flow:

2. Prediction Flow:

##### Important Elements to Highlight
- The automation flow from data collection to submission
- The strategy pattern implementation in picking_strategies
- External service dependencies

##### Layering
- Layer 1 (Top): External Services
- Layer 2: Interface Components
- Layer 3: Core Logic/Strategy
- Layer 4: Data Models

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Services
    subgraph External
        SS[SuperSix Website]:::external
        BF[Betfair Exchange API]:::external
    end

    %% Interface Layer
    subgraph Interfaces
        WD["Web Automation (Selenium)"]:::interface
        SSI["SuperSix Interface"]:::interface
        BFI["Betfair Interface"]:::interface
    end

    %% Strategy Engine
    subgraph StrategyEngine["Strategy Engine"]
        BS["Base Strategy"]:::strategy
        TNS["Top N Strategy"]:::strategy
        PS["Probability Sampling"]:::strategy
        MLS["Most Likely Strategy"]:::strategy
    end

    %% Data Models
    subgraph DataModels["Data Models"]
        SSC["SuperSix Competition"]:::model
        HOA["Home or Away"]:::model
        PSM["Picking Strategy Map"]:::model
    end

    %% Main Flow
    MAIN["Submit Predictions"]:::main

    %% Relationships
    SS --> WD
    BF --> BFI
    WD --> SSI
    BFI --> StrategyEngine
    BS --> TNS & PS & MLS
    StrategyEngine --> MAIN
    MAIN --> SSI
    DataModels --> StrategyEngine
    SSI --> SS

    %% Styles
    classDef external fill:#a8d1f0,stroke:#333
    classDef interface fill:#90EE90,stroke:#333
    classDef strategy fill:#FFE4B5,stroke:#333
    classDef model fill:#D3D3D3,stroke:#333
    classDef main fill:#FFA07A,stroke:#333

    %% Click Events
    click WD "https://github.com/miksyr/auto_super_six/blob/master/auto_super_six/utils/webdriver.py"
    click BFI "https://github.com/miksyr/auto_super_six/blob/master/auto_super_six/utils/betfair_events.py"
    click SSI "https://github.com/miksyr/auto_super_six/blob/master/auto_super_six/internal/super_six_webpage.py"
    click BS "https://github.com/miksyr/auto_super_six/blob/master/auto_super_six/internal/picking_strategies/base_picking_strategy.py"
    click TNS "https://github.com/miksyr/auto_super_six/blob/master/auto_super_six/internal/picking_strategies/sample_top_n_probabilities.py"
    click PS "https://github.com/miksyr/auto_super_six/blob/master/auto_super_six/internal/picking_strategies/sample_using_probabilities.py"
    click MLS "https://github.com/miksyr/auto_super_six/blob/master/auto_super_six/internal/picking_strategies/take_most_likely.py"
    click SSC "https://github.com/miksyr/auto_super_six/blob/master/auto_super_six/datamodel/super_six_competition.py"
    click HOA "https://github.com/miksyr/auto_super_six/blob/master/auto_super_six/datamodel/home_or_away.py"
    click PSM "https://github.com/miksyr/auto_super_six/blob/master/auto_super_six/datamodel/picking_strategy_map.py"
    click MAIN "https://github.com/miksyr/auto_super_six/blob/master/auto_super_six/scripts/submit_predictions.py"
    click StrategyEngine "https://github.com/miksyr/auto_super_six/tree/master/auto_super_six/internal/picking_strategies"
```
