# faridrashidi/kaggle-solutions architecture

> Architecture diagram of the GitHub repository faridrashidi/kaggle-solutions, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/faridrashidi/kaggle-solutions
- Repository: https://github.com/faridrashidi/kaggle-solutions

## Overview

##### Project Type and Purpose
- This is a static site generator project built with Jekyll, intended to compile and present a comprehensive list of Kaggle competition solutions.
- Markdown files in `resources/`, YAML data in `_data/competitions.yml`, and HTML templates under `_layouts` and `_includes` produce the final static pages.

##### Main Components
- Content & Data Layer
- `resources/` (kernels.md, symbols.md, videos.md)
- `_data/competitions.yml` (structured competition metadata)
- Template Layer
- `_layouts` (default.html, resource.html)
- `_includes` (header.html, footer.html, head.html)
- Asset Layer
- `assets/css/` (Bootstrap, custom styles)
- `assets/images/`, `assets/logos/`
- Script Layer
- `_scripts/extract.py` (possibly updates or extracts competition data)
- Configuration
- `_config.yml` (Jekyll settings)
- Build Engine
- Jekyll (Ruby-based static site generator, invoked via `bundle install` / `jekyll build`)
- Version Control & Hosting
- GitHub repository + GitHub Pages for deployment

##### Component Interactions
1. Data & Markdown files feed into Jekyll, guided by `_config.yml`.
2. Templates (`_layouts` & `_includes`) render that content into HTML.
3. Assets (CSS/images) are copied into the output.
4. The build script (`extract.py`) may preprocess or refresh `_data/competitions.yml`.
5. Resulting static site is pushed to the `gh-pages` branch or served directly by GitHub Pages.
6. End users browse the rendered HTML over the web.

##### Architectural Patterns & Design Principles
- Static Site Generation: separation of content, template, and assets.
- Convention over Configuration: Jekyll directory naming drives build.
- Single responsibility: scripts only handle data extraction; templates only handle presentation.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Content & Data Layer
    subgraph "Content & Data Layer"
        direction TB
        Kernels["kernels.md"]:::content
        Symbols["symbols.md"]:::content
        Videos["videos.md"]:::content
        Competitions["competitions.yml"]:::content
    end

    %% Template Layer
    subgraph "Template Layer"
        direction TB
        DefaultLayout["default.html"]:::code
        ResourceLayout["resource.html"]:::code
        HeaderInclude["header.html"]:::code
        HeadInclude["head.html"]:::code
        FooterInclude["footer.html"]:::code
    end

    %% Asset Layer
    subgraph "Asset Layer"
        direction TB
        BootstrapCSS["bootstrap.css"]:::content
        BootstrapMap["bootstrap.css.map"]:::content
        StyleCSS["style.css"]:::content
        Images["assets/images/"]:::content
        Logos["assets/logos/"]:::content
    end

    %% Script Layer
    subgraph "Script Layer"
        direction TB
        ExtractScript["extract.py"]:::code
    end

    %% Configuration
    subgraph "Configuration"
        direction TB
        ConfigFile["_config.yml"]:::code
    end

    %% Build Engine
    subgraph "Build Engine"
        direction TB
        GemfileNode["Gemfile"]:::build
        GemfileLock["Gemfile.lock"]:::build
        JekyllEngine["Jekyll (Ruby)"]:::build
    end

    %% Deployment / Hosting
    subgraph "Deployment & Hosting"
        direction TB
        GitIgnore[".gitignore"]:::build
        Gitattributes[".gitattributes"]:::build
        Readme["README.md"]:::build
        GitHubPages["GitHub Pages"]:::external
    end

    %% Entry Point
    Index["index.html"]:::build

    %% User
    UserBrowser["End‑User Browser"]:::external

    %% Connections to Build Engine
    Kernels -->|feeds into| JekyllEngine
    Symbols -->|feeds into| JekyllEngine
    Videos -->|feeds into| JekyllEngine
    Competitions -->|feeds into| JekyllEngine

    DefaultLayout -->|used by| JekyllEngine
    ResourceLayout -->|used by| JekyllEngine
    HeaderInclude -->|used by| JekyllEngine
    HeadInclude -->|used by| JekyllEngine
    FooterInclude -->|used by| JekyllEngine

    BootstrapCSS -->|copied to output| JekyllEngine
    BootstrapMap -->|copied to output| JekyllEngine
    StyleCSS -->|copied to output| JekyllEngine
    Images -->|copied to output| JekyllEngine
    Logos -->|copied to output| JekyllEngine

    ExtractScript -->|updates| Competitions

    ConfigFile -->|configures| JekyllEngine

    GemfileNode -->|dependencies| JekyllEngine
    GemfileLock -->|locks| JekyllEngine

    %% Build output and deployment
    JekyllEngine -->|generates| Index
    JekyllEngine -->|deploys| GitHubPages

    %% Deployment configs in repo
    GitIgnore -->|repo config| GitHubPages
    Gitattributes -->|repo config| GitHubPages
    Readme -->|instructions| GitHubPages

    %% User access
    GitHubPages -->|serves site| UserBrowser
    Index -->|first page| UserBrowser

    %% Click Events
    click Kernels "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/resources/kernels.md"
    click Symbols "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/resources/symbols.md"
    click Videos "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/resources/videos.md"
    click Competitions "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/_data/competitions.yml"
    click DefaultLayout "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/_layouts/default.html"
    click ResourceLayout "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/_layouts/resource.html"
    click HeaderInclude "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/_includes/header.html"
    click HeadInclude "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/_includes/head.html"
    click FooterInclude "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/_includes/footer.html"
    click BootstrapCSS "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/assets/css/bootstrap.css"
    click BootstrapMap "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/assets/css/bootstrap.css.map"
    click StyleCSS "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/assets/css/style.css"
    click Images "https://github.com/faridrashidi/kaggle-solutions/tree/gh-pages/assets/images/"
    click Logos "https://github.com/faridrashidi/kaggle-solutions/tree/gh-pages/assets/logos/"
    click ExtractScript "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/_scripts/extract.py"
    click ConfigFile "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/_config.yml"
    click GemfileNode "https://github.com/faridrashidi/kaggle-solutions/tree/gh-pages/Gemfile"
    click GemfileLock "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/Gemfile.lock"
    click GitIgnore "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/.gitignore"
    click Gitattributes "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/.gitattributes"
    click Readme "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/README.md"
    click Index "https://github.com/faridrashidi/kaggle-solutions/blob/gh-pages/index.html"

    %% Styles
    classDef content fill:#90EE90,stroke:#333,stroke-width:1px
    classDef code fill:#add8e6,stroke:#333,stroke-width:1px
    classDef build fill:#FFA500,stroke:#333,stroke-width:1px
    classDef external fill:#dda0dd,stroke:#333,stroke-width:1px
```
