# mesteriis/g060525-e-pt architecture

> Architecture diagram of the GitHub repository mesteriis/g060525-e-pt, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mesteriis/g060525-e-pt
- Repository: https://github.com/mesteriis/g060525-e-pt

## Overview

##### Project Type and Purpose
- This is an open-source, content-centric repository hosting course presentations, code samples and supporting materials.
- Its primary function is to store slide decks (PPTX/DOCX), code examples (Python, shell), and auto-generate the README with up-to-date metadata (slide counts, modification dates, table of contents).

##### High-Level Architectural Components
a. Content Store
- “Модуль X…” directories: contain PPTX, DOCX, PDFs, .py/.sh examples/homeworks.
- Docs.md, CONTRIBUTORS.md, Makefile, pyproject.toml, uv.lock at top level.

b. Automation Scripts
- `.github/scripts/bash/*.sh`: common.sh, config.sh, logger.sh, process_presentations.sh
- `.github/scripts/*.py`: get_presentation_metadata.py, get_presentation_toc.py, update_progress.py

c. CI/CD Workflows
- `.github/workflows/update-readme.yml`: triggers on push, calls scripts to rebuild README.md
- `.github/workflows/update-progress.yml`: updates per-lesson progress, invokes update_progress.py

d. Repository and Version Control
- GitHub as VCS & hosting, .gitignore for exclusions
- Branch protection, action logs in `.github/logs/action.log`

e. Generated Artifacts
- README.md (auto-updated TOC + metadata)
- Progress indicators or badges (if any)
- Logs in `.github/logs/`

##### Relationships and Data Flow
1. Developer pushes new/updated slide or code file →
2. GitHub workflow (`update-readme.yml`) fires →
3. Bash wrapper (`.github/scripts/bash/process_presentations.sh`) orchestrates:
- Calls Python scripts (`get_presentation_metadata.py`, `get_presentation_toc.py`) to scan module directories → extract slide counts, update dates, generate markdown snippets.
- Uses `common.sh`/`config.sh` for environment variables and logging.
4. Assembled output replaces README.md and is committed back or used in GitHub Pages.
5. `update-progress.yml` may run periodically or on demand to recalculate completion metrics via `update_progress.py`.

##### Architectural Patterns and Principles
- Separation of Concerns: content vs processing logic vs orchestration vs CI config.
- Scripted pipeline: small focussed scripts (one responsibility each) called by a shell orchestrator.
- Declarative CI: workflows define triggers and high-level steps, use scripts for implementation.
- Idempotency: scripts read file tree and metadata and regenerate docs deterministically.

## Diagram (Mermaid)

```mermaid
flowchart TB
    GitHubCloud["GitHub"] 
    class GitHubCloud cloud

    subgraph "GitHub Repository"
        subgraph "Content Store"
            mod0["Модуль 0. Вводный/"]
            mod1["Модуль 1. Introduction/"]
            mod2["Модуль 2. Core Python/"]
        end

        subgraph "Supporting Files"
            docs["Docs.md"]
            contrib["CONTRIBUTORS.md"]
            gitignore[".gitignore"]
            makefile["Makefile"]
            pyproj["pyproject.toml"]
            uvlock["uv.lock"]
            pyver[".python-version"]
        end

        subgraph "Automation"
            subgraph "Bash Orchestrator"
                common["common.sh"]
                configsh["config.sh"]
                logger["logger.sh"]
                process["process_presentations.sh"]
            end
            subgraph "Python Metadata Extractors"
                meta["get_presentation_metadata.py"]
                toc["get_presentation_toc.py"]
                prog["update_progress.py"]
            end
        end

        subgraph "CI Workflows"
            wf1["update-readme.yml"]
            wf2["update-progress.yml"]
        end

        subgraph "Artifacts"
            readme["README.md"]
            log[".github/logs/action.log"]
        end
    end

    GitHubCloud -->|push/schedule| wf1
    GitHubCloud -->|schedule/on demand| wf2

    wf1 -->|"calls"| process
    wf2 -->|"invokes"| prog

    process -->|"uses"| common
    process -->|"uses"| configsh
    process -->|"uses"| logger
    process -->|"calls"| meta
    process -->|"calls"| toc

    mod0 -->|"input"| process
    mod1 -->|"input"| process
    mod2 -->|"input"| process
    docs -->|"config/readme"| process
    contrib -->|"authors"| process

    meta -->|"generates snippets"| readme
    toc -->|"generates TOC"| readme
    prog -->|"updates metrics"| readme
    prog -->|"logs to"| log

    readme -->|"commits back"| GitHubCloud
    log -->|"stores logs"| GitHubCloud

    click mod0 "https://github.com/mesteriis/g060525-e-pt/tree/main/Модуль 0. Вводный/"
    click mod1 "https://github.com/mesteriis/g060525-e-pt/tree/main/Модуль 1. Introduction/"
    click mod2 "https://github.com/mesteriis/g060525-e-pt/tree/main/Модуль 2. Core Python/"
    click common "https://github.com/mesteriis/g060525-e-pt/blob/main/.github/scripts/bash/common.sh"
    click configsh "https://github.com/mesteriis/g060525-e-pt/blob/main/.github/scripts/bash/config.sh"
    click logger "https://github.com/mesteriis/g060525-e-pt/blob/main/.github/scripts/bash/logger.sh"
    click process "https://github.com/mesteriis/g060525-e-pt/blob/main/.github/scripts/bash/process_presentations.sh"
    click meta "https://github.com/mesteriis/g060525-e-pt/blob/main/.github/scripts/get_presentation_metadata.py"
    click toc "https://github.com/mesteriis/g060525-e-pt/blob/main/.github/scripts/get_presentation_toc.py"
    click prog "https://github.com/mesteriis/g060525-e-pt/blob/main/.github/scripts/update_progress.py"
    click wf1 "https://github.com/mesteriis/g060525-e-pt/blob/main/.github/workflows/update-readme.yml"
    click wf2 "https://github.com/mesteriis/g060525-e-pt/blob/main/.github/workflows/update-progress.yml"
    click readme "https://github.com/mesteriis/g060525-e-pt/blob/main/README.md"
    click log "https://github.com/mesteriis/g060525-e-pt/blob/main/.github/logs/action.log"
    click gitignore "https://github.com/mesteriis/g060525-e-pt/blob/main/.gitignore"
    click docs "https://github.com/mesteriis/g060525-e-pt/blob/main/Docs.md"
    click contrib "https://github.com/mesteriis/g060525-e-pt/blob/main/CONTRIBUTORS.md"
    click makefile "https://github.com/mesteriis/g060525-e-pt/tree/main/Makefile"
    click pyproj "https://github.com/mesteriis/g060525-e-pt/blob/main/pyproject.toml"
    click uvlock "https://github.com/mesteriis/g060525-e-pt/blob/main/uv.lock"
    click pyver "https://github.com/mesteriis/g060525-e-pt/blob/main/.python-version"

    class mod0,mod1,mod2 content
    class docs,contrib,gitignore,makefile,pyproj,uvlock,pyver config
    class common,configsh,logger,process,meta,toc,prog scripts
    class wf1,wf2 workflows
    class readme,log artifacts

    classDef content fill:#B3D7FF,stroke:#000
    classDef scripts fill:#D5F5E3,stroke:#090
    classDef workflows fill:#E8DAEF,stroke:#800080
    classDef artifacts fill:#FAD7A0,stroke:#ff6600
    classDef config fill:#D6DBDF,stroke:#555
    classDef cloud fill:#D6EAF8,stroke:#5499C7,shape:cloud
```
