# gymnd-informatik/teachertodoscreen architecture

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

- Interactive diagram: https://gitdiagram.com/gymnd-informatik/teachertodoscreen
- Repository: https://github.com/gymnd-informatik/teachertodoscreen

## Overview

##### Main Components
- Frontend (Root):
- HTML (index.html): Displays tasks, events, and announcements.
- JavaScript (script.js): Fetches and dynamically updates content from output.json, manages mode (light/dark) and pagination.
- CSS (style.css): Provides styles and theming (including light and dark mode support).
- Backend/Admin:
- HTML (admin/index.html): Provides administrator interface for managing content.
- JavaScript (admin/script.js): Integrates Quill for rich text editing, data fetching and updating display for events.
- CSS (admin/style.css): Provides styling for the admin panel.
- PHP Endpoint (admin/saveFile.php): Handles POST requests for content saving to the root output.json.
- .htaccess (in admin): Enforces HTTP basic authentication to protect the backend.
- Data Storage:
- JSON File (output.json): Acts as the central storage repository for events and tasks that the frontend displays.
- Auxiliary Files & Scripts:
- PHP file at the root (saveFile.php): Processes frontend POST requests.
- Shell scripts (within the scripts directory): Likely for installation, deployment, or maintenance tasks (e.g., install.sh, on.sh, off.sh, crontab).

##### Relationships and Data Flow
- The Frontend fetches updated event/task data from output.json via script.js.
- The Admin Panel, secured via .htaccess, allows users to update event details. Changes are sent via POST requests to admin/saveFile.php (or the corresponding PHP endpoint) which writes updates to output.json.
- The PHP scripts (both in the admin and at the root) act as middleware between the user interface and the JSON data file.
- Deployment and maintenance scripts are auxiliary elements that support the overall system.

##### Architectural Patterns and Technologies
- Separation of Concerns: The project is separated into two primary zones (frontend for presentation and admin for content management).
- Client-Side Dynamic Data Handling: JavaScript fetches JSON data dynamically.
- PHP as a simple backend for data processing.
- Basic authentication via Apache (.htaccess) for securing the admin panel.
- Lightweight web application architecture (not a typical MVC, but with clear separation between display and content management).

##### Final Touches
- Be as detailed as possible by breaking down components into sub-elements (like showing that the admin panel includes a rich text editor sub-component).

## Diagram (Mermaid)

```mermaid
graph TD
    %% Frontend UI Group
    subgraph "Frontend UI"
        FE_index["index.html"]:::client
        FE_script["script.js"]:::client
        FE_style["style.css"]:::client
    end

    %% Frontend PHP Endpoint
    FE_php["saveFile.php"]:::server

    %% Admin Panel Group
    subgraph "Admin Panel"
        admin_index["admin/index.html"]:::client
        admin_script["admin/script.js"]:::client
        admin_style["admin/style.css"]:::client
        admin_auth["admin/.htaccess"]:::server
        admin_php["admin/saveFile.php"]:::server
        quill["Quill Rich Text Editor"]:::client
    end

    %% Data Store
    data_store(("output.json")):::database

    %% Deployment/Maintenance Scripts
    deployment["Deployment Scripts (scripts/)"]:::deployment

    %% Data Flow Connections
    FE_script -->|"fetchesData"| data_store
    FE_php -->|"processesUpdate"| data_store
    admin_php -->|"updatesFile"| data_store
    admin_script -->|"integratesQuill"| quill
    admin_index -->|"securedBy"| admin_auth
    deployment -->|"maintenance"| data_store

    %% Classes
    classDef client fill:#a6cee3,stroke:#1f78b4,stroke-width:2px;
    classDef server fill:#fdbf6f,stroke:#ff7f00,stroke-width:2px;
    classDef database fill:#b2df8a,stroke:#33a02c,stroke-width:2px;
    classDef deployment fill:#cab2d6,stroke:#6a3d9a,stroke-width:2px;

    %% Click Events
    click FE_index "https://github.com/gymnd-informatik/teachertodoscreen/blob/main/index.html"
    click FE_script "https://github.com/gymnd-informatik/teachertodoscreen/blob/main/script.js"
    click FE_style "https://github.com/gymnd-informatik/teachertodoscreen/blob/main/style.css"
    click FE_php "https://github.com/gymnd-informatik/teachertodoscreen/blob/main/saveFile.php"
    click admin_index "https://github.com/gymnd-informatik/teachertodoscreen/blob/main/admin/index.html"
    click admin_script "https://github.com/gymnd-informatik/teachertodoscreen/blob/main/admin/script.js"
    click admin_style "https://github.com/gymnd-informatik/teachertodoscreen/blob/main/admin/style.css"
    click admin_php "https://github.com/gymnd-informatik/teachertodoscreen/blob/main/admin/saveFile.php"
    click admin_auth "https://github.com/gymnd-informatik/teachertodoscreen/blob/main/admin/.htaccess"
    click data_store "https://github.com/gymnd-informatik/teachertodoscreen/blob/main/output.json"
    click deployment "https://github.com/gymnd-informatik/teachertodoscreen/tree/main/scripts/"
```
