# museum-rietberg/megascreen architecture

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

- Interactive diagram: https://gitdiagram.com/museum-rietberg/megascreen
- Repository: https://github.com/museum-rietberg/megascreen

## Overview

- Content Manager Module – Represented by the JavaScript file(s) (contentManager.js and its variant _contentManagerVideo.js). This module is responsible for loading new scheduled content every 3 minutes from the JSON schedule files.
- Language Switcher Module – Represented by languageSwitcher.js, which changes the language of the displayed content every minute by toggling CSS classes.
- JSON Data Sources – Include files such as content/_contentVideoImgSchedule.json, content/scheduledContent.json, and _signageContent.json. These are used to drive content scheduling and layout.
- Styling Assets – Include the CSS folder (with files like mega-screen-animation.css, mega-screen.css, mrz-corporate-design.css) that provide the look and animated transitions.
- Media and Supporting Assets – The content folder containing slides, images (slides/img), text files (slides/txt), and the fonts directory which is used for branding and corporate design.
- (Optionally) Signage Manager – Noted as _signageManager.js in the JS folder, which may encapsulate further control logic for managing the digital signage display.

##### Relationships and interactions
- Any sketches or experimental assets (files that begin with an underscore, like _contentVideoImgSchedule.json) can be noted as “Draft/Experimental Content Data” or “Sketches” for clarity.

##### Architectural patterns and design principles
- This is a client-side application relying on scheduled content updates, so the architecture follows a modular design where different JS modules are responsible for separate concerns (content scheduling/updating vs. language switching).
- The system demonstrates separation of concerns: the business logic (content management) is kept distinct from the presentation layer (CSS, fonts, media).
- The use of JSON files as a content source reinforces a data-driven approach, where presentation and content timing are managed externally.

##### Technology specifics
- JavaScript for the content logic and dynamic page updates.
- HTML and CSS drive the application styling and layout.
- JSON for the configuration and content scheduling data.
- Any dependencies visible in the code structure (for example, if any additional libraries were referenced in the actual code, they should be noted; however, based on provided details, it appears to be a standard vanilla JS solution).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Assets & Data"
        subgraph "JSON Data Sources"
            DS1["scheduledContent.json"]:::json
            DS2["_contentVideoImgSchedule.json"]:::json
            DS3["_signageContent.json"]:::json
        end
        subgraph "Styling Assets"
            CSS1["mega-screen-animation.css"]:::css
            CSS2["mega-screen.css"]:::css
            CSS3["mrz-corporate-design.css"]:::css
        end
        subgraph "Media & Supporting Assets"
            MA1["Slides (img/txt)"]:::asset
            FNT["Fonts"]:::asset
        end
    end

    subgraph "JS Modules"
        CM["Content Manager Module"]:::js
        LS["Language Switcher Module"]:::js
        SM["Signage Manager"]:::js
    end

    DDM["Display & DOM (Rendered Page)"]:::display

    %% Data flow arrows
    DS1 -->|"fetch_content(3min)"| CM
    DS2 -->|"fetch_content(3min)"| CM
    DS3 -->|"fetch_content(3min)"| CM

    CM -->|"update_content"| DDM
    LS -->|"update_language(1min)"| DDM
    SM -->|"control_logic"| DDM

    CSS1 --> DDM
    CSS2 --> DDM
    CSS3 --> DDM

    MA1 --> DDM
    FNT --> DDM

    %% Click Events
    click CM "https://github.com/museum-rietberg/megascreen/blob/main/js/contentManager.js"
    click CM "https://github.com/museum-rietberg/megascreen/blob/main/js/_contentManagerVideo.js"
    click LS "https://github.com/museum-rietberg/megascreen/blob/main/js/languageSwitcher.js"
    click DS1 "https://github.com/museum-rietberg/megascreen/blob/main/content/scheduledContent.json"
    click DS2 "https://github.com/museum-rietberg/megascreen/blob/main/content/_contentVideoImgSchedule.json"
    click DS3 "https://github.com/museum-rietberg/megascreen/blob/main/content/_signageContent.json"
    click CSS1 "https://github.com/museum-rietberg/megascreen/blob/main/css/mega-screen-animation.css"
    click CSS2 "https://github.com/museum-rietberg/megascreen/blob/main/css/mega-screen.css"
    click CSS3 "https://github.com/museum-rietberg/megascreen/blob/main/css/mrz-corporate-design.css"
    click MA1 "https://github.com/museum-rietberg/megascreen/tree/main/content/slides"
    click FNT "https://github.com/museum-rietberg/megascreen/tree/main/fonts"
    click SM "https://github.com/museum-rietberg/megascreen/blob/main/js/_signageManager.js"

    %% Class Definitions for Colors
    classDef js fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef json fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef css fill:#A9DFBF,stroke:#1E8449,stroke-width:2px;
    classDef asset fill:#E8DAEF,stroke:#8E44AD,stroke-width:2px;
    classDef display fill:#F5CBA7,stroke:#D35400,stroke-width:2px;
```
