# davinci05/azubireflektor architecture

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

- Interactive diagram: https://gitdiagram.com/davinci05/azubireflektor
- Repository: https://github.com/davinci05/azubireflektor

## Overview

##### Main System Components

a) Core Components:
- Frontend Display System (Browser/Electron)
- Backend Server (Node.js)
- Module System
- Configuration Management
- Translation System

b) Module Architecture:
- Default Modules Layer
- Custom Modules Layer
- Module Helper System

##### Key Architectural Elements

**[Display Layer]**
- ↑↓
**[Core System Layer]**
- ↑↓
**[Module Management Layer]**
- ↑↓
**[Module Layer]**
- ↑↓
**[Helper Layer]**

##### Specific Components

Frontend Components:
- Main Display Interface (index.html)
- CSS Styling System (css/main.css)
- JavaScript Core (js/main.js)
- Socket Client (js/socketclient.js)

Backend Components:
- Server (js/server.js)
- Node Helper System (js/node_helper.js)
- Module Loader (js/loader.js)
- Configuration Manager (config/config.js)

Module System:
- Default Modules (weather, clock, calendar, etc.)
- Custom Modules (MMM-PublicTransportHafas, MMM-EmbedURL, etc.)
- Module Registration System
- Module Communication Bus

##### Data Flow Indicators

- Socket.io communication between frontend and backend
- Module registration flow
- Configuration loading process
- Event broadcasting system

##### Implementation Details

- How modules are loaded and initialized
- How the configuration system affects different components
- How the translation system integrates with modules
- How the helper system supports modules

##### External Integrations

Connections to:
- Weather APIs
- Calendar Services
- Public Transport APIs
- Other External Services

##### Development Workflow

A small section showing:
- Auto-deployment process
- GitHub integration
- Testing pipeline

Key Relationships to Highlight:
- Frontend-Backend Communication
- Module-Core System Interaction
- Configuration System Impact
- Translation System Integration
- Helper System Support Structure

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Display ["Display (/index.html, /css, /js)"]
        FE[Frontend Interface]:::frontend
        CSS[CSS Styling]:::frontend
        JSCore[JavaScript Core]:::frontend
        Socket[Socket Client]:::frontend
    end

    subgraph Core ["/js Core Files"]
        Server[Server]:::backend
        NodeHelper[Node Helper]:::backend
        ModLoader[Module Loader]:::backend
        ServerFn[Server Functions]:::backend
        Config[Configuration Manager]:::config
        Trans[Translation System]:::core
        Utils[Utilities]:::core
        Logger[Logger]:::core
        ClassSys[Class System]:::core
    end

    subgraph "Module System (/modules)"
        ModBase[Module Base]:::module
        subgraph "Default Modules (/modules/default)"
            Clock[Clock Module]:::module
            Weather[Weather Module]:::module
            Calendar[Calendar Module]:::module
            Alert[Alert Module]:::module
        end
        subgraph "Custom Modules (/modules/custom)"
            Transport[MMM-PublicTransportHafas]:::module
            EmbedURL[MMM-EmbedURL]:::module
            WebView[MMM-WebView]:::module
        end
    end

    subgraph "Testing Layer (/tests)"
        E2E[E2E Tests]:::test
        Unit[Unit Tests]:::test
    end

    FE --> Socket
    Socket <--> Server
    Server --> NodeHelper
    Server --> ModLoader
    Server --> ServerFn
    ModLoader --> ModBase
    ModBase --> Clock
    ModBase --> Weather
    ModBase --> Calendar
    ModBase --> Alert
    ModBase --> Transport
    ModBase --> EmbedURL
    ModBase --> WebView
    Config --> Server
    Trans --> ModBase
    Utils --> Server
    Logger --> Server
    ClassSys --> ModBase

    click FE "https://github.com/davinci05/AzubiReflektor/blob/main/index.html"
    click CSS "https://github.com/davinci05/AzubiReflektor/blob/main/css/main.css"
    click JSCore "https://github.com/davinci05/AzubiReflektor/blob/main/js/main.js"
    click Socket "https://github.com/davinci05/AzubiReflektor/blob/main/js/socketclient.js"
    click Server "https://github.com/davinci05/AzubiReflektor/blob/main/js/server.js"
    click NodeHelper "https://github.com/davinci05/AzubiReflektor/blob/main/js/node_helper.js"
    click ModLoader "https://github.com/davinci05/AzubiReflektor/blob/main/js/loader.js"
    click ServerFn "https://github.com/davinci05/AzubiReflektor/blob/main/js/server_functions.js"
    click ModBase "https://github.com/davinci05/AzubiReflektor/blob/main/js/module.js"
    click Config "https://github.com/davinci05/AzubiReflektor/blob/main/config/config.js"
    click Trans "https://github.com/davinci05/AzubiReflektor/tree/main/translations/"
    click Utils "https://github.com/davinci05/AzubiReflektor/blob/main/js/utils.js"
    click Logger "https://github.com/davinci05/AzubiReflektor/blob/main/js/logger.js"
    click ClassSys "https://github.com/davinci05/AzubiReflektor/blob/main/js/class.js"
    click Clock "https://github.com/davinci05/AzubiReflektor/tree/main/modules/default/clock/"
    click Weather "https://github.com/davinci05/AzubiReflektor/tree/main/modules/default/weather/"
    click Calendar "https://github.com/davinci05/AzubiReflektor/tree/main/modules/default/calendar/"
    click Alert "https://github.com/davinci05/AzubiReflektor/tree/main/modules/default/alert/"
    click Transport "https://github.com/davinci05/AzubiReflektor/tree/main/modules/MMM-PublicTransportHafas/"
    click EmbedURL "https://github.com/davinci05/AzubiReflektor/tree/main/modules/MMM-EmbedURL/"
    click WebView "https://github.com/davinci05/AzubiReflektor/tree/main/modules/MMM-WebView/"
    click E2E "https://github.com/davinci05/AzubiReflektor/tree/main/tests/e2e/"
    click Unit "https://github.com/davinci05/AzubiReflektor/tree/main/tests/unit/"

    classDef frontend fill:#42A5F5,stroke:#1976D2,color:white
    classDef backend fill:#66BB6A,stroke:#388E3C,color:white
    classDef module fill:#AB47BC,stroke:#7B1FA2,color:white
    classDef config fill:#FFA726,stroke:#F57C00,color:white
    classDef core fill:#EC407A,stroke:#C2185B,color:white
    classDef test fill:#78909C,stroke:#546E7A,color:white
```
