# siro098/vorlesungsfortschritt architecture

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

- Interactive diagram: https://gitdiagram.com/siro098/vorlesungsfortschritt
- Repository: https://github.com/siro098/vorlesungsfortschritt

## Overview

##### Project Type and Purpose
- This is a small desktop‐widget style application that calculates and displays the current progress of a DHBW lecture in percent.
- The “backend” is a Python script (`Vorlesungsfortschritt.py`) that parses `.ics` calendar data. The “frontend” is a Rainmeter skin (`Vorlesungsfortschritt.ini`) which runs on Windows and renders text/graphics on the desktop.
- A setup utility (`setup.py`) ties everything together by installing fonts, writing configuration, and placing files where Rainmeter expects them.

##### File‐Structure Analysis
- Top‐level:
- `.github/ISSUE_TEMPLATE` – issue templates for GitHub, not part of runtime
- `FondsInstalls/` – TrueType/OpenType font files to install for the Rainmeter skin
- `README.md`, `LICENSE` – documentation and license
- `setup.py` – installer/configurator that writes `config.txt` and copies the Rainmeter skin files into the Rainmeter directory
- `Vorlesungsfortschritt.py` – core Python logic
- `Vorlesungsfortschritt.ini` – Rainmeter skin definition (in project root)
- `config.txt` – stores user’s chosen course, wallpaper‐sync file path, thresholds, etc.
- `ical/` – holds downloaded or prepopulated `.ics` files from DHBW.app
- `txtfiles/` – text files (`Bar.txt`, `Zahl.txt`, `Vorlesung.txt`) used as the data exchange interface between Python and Rainmeter

##### Key Insights from README
- The Python script is triggered automatically by Rainmeter (using its “Run command” plugin or measure type).
- The script reads `.ics` calendar entries, computes percent complete, and writes three small text files for skin measures.
- Setup.py locates the user’s Rainmeter skin folder, installs fonts, writes `config.txt`, and places the `.ini` file.

##### Components
a. Main Components
- ICS Data Source (DHBW.app feed or local `.ics` under `ical/`)
- Python Processor (`Vorlesungsfortschritt.py`)
- Local Config Store (`config.txt`)
- Text‐file Bridge (`txtfiles/Bar.txt`, `Zahl.txt`, `Vorlesung.txt`)
- Rainmeter Skin (`Vorlesungsfortschritt.ini`)
- Font Assets (`FondsInstalls/` → OS Font Directory)
- Setup Utility (`setup.py`)
- Execution Environment: Python 3.x runtime & Rainmeter application

b. Relationships & Data Flow
1. Setup.py reads user input → writes `config.txt` + copies `.ini` and font files → installs fonts.
2. Rainmeter (Scheduler/Measure) invokes `Vorlesungsfortschritt.py` at intervals.
3. Python script reads:
– `config.txt` for course name & settings
– `.ics` files under `ical/`
Processes progress → writes to the three text files in `txtfiles/`.
4. Rainmeter skin measures read the three text files to update on‐screen meters (text, progress bar, percentage).
5. User sees desktop widget reflecting real‐time lecture progress.

c. Architectural Patterns & Principles
- Separation of Concerns:
- Data acquisition & computation in Python
- Presentation in Rainmeter UI
- File‐based IPC: Text files as a simple, robust bridge for data sharing on a single machine.
- Config Management: Single flat file (`config.txt`) to store user preferences.

d. Technologies & Frameworks
- Python 3.8–3.13
- Rainmeter (Windows desktop skin framework)
- iCalendar format (`.ics`)
- OS fonts (TTF/OTF)
- Simple flat‐file I/O for IPC

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Installation Phase
    subgraph "Installation Phase"
        Setup["Setup Utility (setup.py)"]:::installation
        Fonts["Font Assets (FondsInstalls/)"]:::installation
        IniFile["Rainmeter Skin (Vorlesungsfortschritt.ini)"]:::installation
        ConfigFile["Local Config Store (config.txt)"]:::installation
    end

    %% Data Processing Phase
    subgraph "Data Processing Phase"
        ICS["ICS Data Source (ical/)"]:::datasource
        Python["Python Processor (Vorlesungsfortschritt.py)"]:::runtime
        subgraph "Text-File Bridge (txtfiles/)"
            Bar["Bar.txt"]:::runtime
            Zahl["Zahl.txt"]:::runtime
            Vorlesung["Vorlesung.txt"]:::runtime
        end
    end

    %% Rendering Phase
    subgraph "Rendering Phase"
        Rainmeter["Rainmeter Application"]:::runtime
    end

    %% Connections
    Setup -->|writes config.txt & copies skin| ConfigFile
    Setup -->|deploys Rainmeter skin| IniFile
    Setup -->|installs fonts| Fonts

    Rainmeter -->|invokes| Python
    Python -->|reads| ConfigFile
    Python -->|reads| ICS
    Python -->|writes| Bar
    Python -->|writes| Zahl
    Python -->|writes| Vorlesung
    Rainmeter -->|reads| Bar
    Rainmeter -->|reads| Zahl
    Rainmeter -->|reads| Vorlesung
    Rainmeter -->|renders skin with fonts| Fonts

    %% Click Events
    click ICS "https://github.com/siro098/vorlesungsfortschritt/tree/main/ical/"
    click Python "https://github.com/siro098/vorlesungsfortschritt/blob/main/Vorlesungsfortschritt.py"
    click ConfigFile "https://github.com/siro098/vorlesungsfortschritt/blob/main/config.txt"
    click Bar "https://github.com/siro098/vorlesungsfortschritt/blob/main/txtfiles/Bar.txt"
    click Zahl "https://github.com/siro098/vorlesungsfortschritt/blob/main/txtfiles/Zahl.txt"
    click Vorlesung "https://github.com/siro098/vorlesungsfortschritt/blob/main/txtfiles/Vorlesung.txt"
    click IniFile "https://github.com/siro098/vorlesungsfortschritt/blob/main/Vorlesungsfortschritt.ini"
    click Fonts "https://github.com/siro098/vorlesungsfortschritt/tree/main/FondsInstalls/"
    click Setup "https://github.com/siro098/vorlesungsfortschritt/blob/main/setup.py"

    %% Styles
    classDef installation fill:#A3BE8C,stroke:#4C566A,stroke-width:2px
    classDef runtime fill:#88C0D0,stroke:#4C566A,stroke-width:2px
    classDef datasource fill:#EBCB8B,stroke:#4C566A,stroke-width:2px
```
