# mcsymiv/gost architecture

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

- Interactive diagram: https://gitdiagram.com/mcsymiv/gost
- Repository: https://github.com/mcsymiv/gost

## Overview

##### Main Components Identification

a) Core Components:
- Driver Management Layer (driver/)
- Client Communication Layer (client/)
- Service Layer (service/)
- Command Processing Layer (command/)
- Configuration Management (config/)
- Test Execution Layer (gost/)
- JavaScript Integration (js/)

##### Architectural Layers

**┌─ Test Layer ─────────────────────┐**
- (test/*.go)                      │
- ┬──────────────────┘
- ↓
**┌─ GOST Framework Core ────────────┐**
- ┌─────────────┐  ┌────────────┐  │
- Configuration│  │Capabilities │  │
- ┘  └────────────┘  │
- ┌─────────────┐  ┌────────────┐  │
- Service   │←→│   Client   │  │
- ┘  └────────────┘  │
- ┌─────────────┐  ┌────────────┐  │
- Driver    │←→│  Command   │  │
- ┘  └────────────┘  │
- ┬──────────────────┘
- ↓
**┌─ WebDriver Layer ────────────────┐**
- (ChromeDriver/GeckoDriver)       │
- ┬──────────────────┘
- ↓
**┌─ Browser Layer ─────────────────┐**
- (Chrome/Firefox)                │
- ┘

##### Component Relationships

a) Data Flow:
- Test Layer → GOST Framework (test execution)
- GOST Framework → WebDriver (W3C protocol commands)
- WebDriver → Browser (browser automation)

b) Internal Communications:
- Service ↔ Client (HTTP communication)
- Driver ↔ Command (command execution)
- Configuration → All Components (config distribution)

##### Additional Details

a) Port Configuration:
- WebServer: 8080
- WebDriver: 4444

b) File Paths:
- Screenshots Directory
- Driver Logs Location
- JS Files Location
- Records Directory

##### Notes Section
Important notes about:
- Manual browser/driver versioning
- Configuration defaults
- Timeout settings
- Screenshot behavior

Remember to include version compatibility information and the supported browsers as this is crucial for understanding the framework's capabilities and limitations.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Test_Layer
        Tests["Test Files"]:::test
    end

    subgraph GOST_Framework
        subgraph Core_Components
            Config["Configuration Management"]:::core
            click Config "https://github.com/mcsymiv/gost/blob/main/config/config.go"
            
            Service["Service Layer"]:::core
            click Service "https://github.com/mcsymiv/gost/blob/main/service/service.go"
            
            Client["Client Communication"]:::core
            click Client "https://github.com/mcsymiv/gost/blob/main/client/client.go"
            
            Driver["Driver Management"]:::core
            click Driver "https://github.com/mcsymiv/gost/blob/main/driver/driver.go"
            
            Command["Command Processing"]:::core
            click Command "https://github.com/mcsymiv/gost/blob/main/command/command.go"
            
            Capabilities["Capabilities"]:::core
            click Capabilities "https://github.com/mcsymiv/gost/blob/main/capabilities/capabilities.go"
            
            DataModels["Data Models"]:::core
            click DataModels "https://github.com/mcsymiv/gost/blob/main/data/models.go"
        end

        subgraph JS_Integration
            JSHandler["JavaScript Handlers"]:::js
            click JSHandler "https://github.com/mcsymiv/gost/tree/main/js"
        end

        subgraph Framework_Core
            GostCore["GOST Core"]:::framework
            click GostCore "https://github.com/mcsymiv/gost/blob/main/gost/gost.go"
            
            Recording["Recording"]:::framework
            click Recording "https://github.com/mcsymiv/gost/blob/main/gost/record.go"
            
            Steps["Test Steps"]:::framework
            click Steps "https://github.com/mcsymiv/gost/blob/main/gost/steps.go"
        end
    end

    subgraph WebDriver_Layer
        ChromeDriver["ChromeDriver"]:::driver
        GeckoDriver["GeckoDriver"]:::driver
    end

    subgraph Browser_Layer
        Chrome["Chrome"]:::browser
        Firefox["Firefox"]:::browser
    end

    %% Relationships
    Tests --> GostCore
    GostCore --> Config
    GostCore --> Service
    Service <--> Client
    Client --> Driver
    Driver <--> Command
    Driver --> JSHandler
    Driver --> Capabilities
    Driver --> DataModels
    
    ChromeDriver --> Chrome
    GeckoDriver --> Firefox
    
    Driver --> ChromeDriver
    Driver --> GeckoDriver

    %% Styles
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef js fill:#f1c40f,stroke:#f39c12,color:black
    classDef framework fill:#2ecc71,stroke:#27ae60,color:white
    classDef driver fill:#e74c3c,stroke:#c0392b,color:white
    classDef browser fill:#9b59b6,stroke:#8e44ad,color:white
    classDef test fill:#e67e22,stroke:#d35400,color:white

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["JavaScript Integration"]:::js
        L3["Framework Components"]:::framework
        L4["WebDriver"]:::driver
        L5["Browser"]:::browser
        L6["Test Layer"]:::test
    end
```
