# giorgiovilardo/tks architecture

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

## Overview

##### Project Type Identification
This is a standalone data processing application with a web interface that:
- Processes CSV files containing football data
- Performs statistical calculations
- Presents results through a web interface
- Is distributed as a single binary (embedding all assets)

##### Main Components

a) Core Application Layer:
- Subcomponents for:
- CSV Processing (from internal/csv.go)
- Domain Logic (from internal/domain.go)
- Result Matrix Processing (from internal/result_matrix.go)
- Configuration Management (from internal/config.go)

b) Web Interface Layer:
- Embedded web assets (from tks/assets)
- HTTP handlers (from internal/handlers.go)

c) Data Flow Layer:
- Input: CSV files
- Processing: Statistical calculations
- Output: Web interface

**[Input Layer]**
- CSV Files
- ↓
**[Core Processing Layer]**
- ┌─────────────────────────────┐
- Internal Components         │
- CSV Processor          │
- Domain Logic           │
- Result Matrix          │
- Configuration          │
- ┘
- ↓
**[Web Interface Layer]**
- ┌─────────────────────────────┐
- Web Server                  │
- HTTP Handlers          │
- Embedded Assets        │
- ┘
- ↓
**[User Interface]**
- Browser View

##### Technical Details
- Go runtime environment
- Tailwind JS for frontend styling
- CSV file handling capabilities
- In-memory processing indicators

##### Implementation Notes
- Use notes or annotations to indicate planned features from the roadmap

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Input Layer"
        CSV["CSV Files"]:::input
    end

    subgraph "Core Processing Layer"
        Main["Main Application"]:::core
        click Main "https://github.com/giorgiovilardo/tks/blob/main/tks/main.go"
        
        subgraph "Internal Components"
            CSVProc["CSV Processor"]:::processor
            click CSVProc "https://github.com/giorgiovilardo/tks/blob/main/internal/csv.go"
            
            Domain["Domain Logic"]:::processor
            click Domain "https://github.com/giorgiovilardo/tks/blob/main/internal/domain.go"
            
            Matrix["Result Matrix"]:::processor
            click Matrix "https://github.com/giorgiovilardo/tks/blob/main/internal/result_matrix.go"
            
            Config["Configuration"]:::processor
            click Config "https://github.com/giorgiovilardo/tks/blob/main/internal/config.go"
        end
    end

    subgraph "Web Interface Layer"
        WebServer["Web Server"]:::web
        
        subgraph "Server Components"
            Handlers["HTTP Handlers"]:::web
            click Handlers "https://github.com/giorgiovilardo/tks/blob/main/internal/handlers.go"
            
            Assets["Embedded Assets"]:::web
            click Assets "https://github.com/giorgiovilardo/tks/tree/main/tks/assets/"
            
            HTML["HTML Interface"]:::frontend
            click HTML "https://github.com/giorgiovilardo/tks/blob/main/tks/assets/index.html"
            
            Style["Frontend Styling"]:::frontend
            click Style "https://github.com/giorgiovilardo/tks/blob/main/tks/assets/tailwind.js"
        end
    end

    subgraph "User Interface"
        Browser["Browser View"]:::ui
    end

    %% Connections
    CSV --> Main
    Main --> CSVProc
    Main --> Domain
    Main --> Matrix
    Main --> Config
    
    CSVProc --> Domain
    Domain --> Matrix
    Config --> WebServer
    
    WebServer --> Handlers
    WebServer --> Assets
    Assets --> HTML
    Assets --> Style
    
    WebServer --> Browser

    %% Future Considerations
    subgraph "Future Extensions"
        direction TB
        DB["SQLite Database"]:::future
        Hex["Hexagonal Architecture"]:::future
        Test["Enhanced Testing"]:::future
    end

    %% Styles
    classDef input fill:#a0d8ef,stroke:#333,stroke-width:2px
    classDef core fill:#98fb98,stroke:#333,stroke-width:2px
    classDef processor fill:#90ee90,stroke:#333,stroke-width:2px
    classDef web fill:#ffa07a,stroke:#333,stroke-width:2px
    classDef frontend fill:#ffb6c1,stroke:#333,stroke-width:2px
    classDef ui fill:#dda0dd,stroke:#333,stroke-width:2px
    classDef future fill:#fff,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5

    %% Legend
    subgraph Legend
        L1["Input Components"]:::input
        L2["Core Components"]:::core
        L3["Processing Units"]:::processor
        L4["Web Components"]:::web
        L5["Frontend Elements"]:::frontend
        L6["User Interface"]:::ui
        L7["Future Features"]:::future
    end
```
