# sircharlo/meeting-media-manager architecture

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

- Interactive diagram: https://gitdiagram.com/sircharlo/meeting-media-manager
- Repository: https://github.com/sircharlo/meeting-media-manager

## Overview

##### Project Type and Purpose
- M³ is a cross-platform desktop application built to automatically download, synchronize, share, and present meeting media used in congregations. It uses a combination of Electron (for desktop integration) and a Vue (with Quasar) frontend to render the user interface.
- The README emphasizes media downloading, multi-language support, media presentation (including integration with OBS Studio), and multi-congregation management.

##### High-Level Architectural Components
a. Electron Main Process:
- Located in the “src-electron” directory.
- Manages system-level tasks: window management, file system operations, session control, security, updater logic, and integration with external tools (e.g., ffmpeg for media processing, OBS integration for scene switching, etc.).
- Includes submodules for downloads, IPC (inter-process communication), file system, session management, and security.

b. Preload Scripts:
- Found under “src-electron/preload”.
- Serve as the bridge between the Electron main process and the renderer process (i.e., the Vue frontend). They expose safe APIs such as for filesystem access, logging, and handling IPC events.

c. Renderer Process (Frontend Application):
- Main application code is under “src” which includes:
- Vue components (in folders like “components”, “pages”, “layouts”) that handle UI rendering, media display, dialogs, and form inputs.
- Routing (from “src/router”) and state management (in “src/stores”).
- Internationalization and localization with language JSON files in “src/i18n”.
- The UI is built using Quasar (as evidenced by quasar.config.ts and related styling files) to ensure a responsive and modern interface.

d. Build, Documentation, and Testing:
- “docs” holds documentation source files (including multilingual support for user guides) and configurations for the documentation site.
- Test configurations and mocks (in “test” and __tests__ directories) are used for unit and integration testing.

##### Component Relationships and Data Flows
- The Electron Main Process initializes the application and opens application windows. It listens for events (like media downloads or updates) and handles file system operations.
- Preload scripts provide a secure API that the Renderer Process can call via IPC. They act as a gatekeeper, ensuring that the Vue application (running in a sandboxed environment) can interact with native modules safely.
- The Renderer Process (Vue frontend) is responsible for rendering the UI, handling user interactions, and displaying media. It communicates via the preload interface with the Electron main process for tasks like downloading media, invoking OBS integrations, and running file operations.
- External services (e.g., OBS Studio, remote media servers for downloading, cloud sync services like Dropbox or OneDrive) should be represented as external connectors that interface primarily with the Electron main process.

##### Key Architectural Patterns and Design Principles
- Separation of Concerns: The architecture distinctively separates the native desktop layer (Electron main and preload scripts) from the presentation layer (Vue frontend).
- IPC Communication: Clear, secure communication channels via IPC between the main and renderer processes.
- Modular Components: The Vue portion is broken down into reusable components (dialogs, headers, media components, inputs) and pages that follow MVC-like responsibilities.
- Cross-Platform Build and Packaging: The “build” directory and configuration files (Quasar, Yarn, GitHub Actions workflows) indicate a design built with continuous integration/deployment in mind.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Electron Environment
    subgraph "Electron Environment"
        EMain["Electron Main Process<br/>(Downloads, IPC, FS, Security, Session, Updater, Window)"]:::electron
        EPreload["Preload Scripts (Bridge)"]:::preload
    end

    %% Renderer Process (Vue Frontend)
    subgraph "Renderer Process (Vue Frontend)"
        VComp["Vue Components (UI: Components, Pages, Layouts)"]:::renderer
        VRoute["Routing & State (Router, Stores)"]:::renderer
        VI18n["Internationalization (i18n)"]:::renderer
        VQuasar["Quasar Configuration"]:::renderer
    end

    %% External Services
    subgraph "External Services"
        OBS["OBS Studio Integration"]:::external
        FFMPEG["Media Processing (ffmpeg)"]:::external
        CLOUD["Cloud Sync/Remote Media Servers"]:::external
    end

    %% Build, Documentation, and Testing
    subgraph "Project Build & Maintenance"
        BUILD["Build & Packaging"]:::utility
        DOC["Documentation"]:::utility
        TEST["Testing & Mocks"]:::utility
    end

    %% Connections
    %% Communication between Renderer and Electron
    VComp -->|"IPC_Call"| EPreload
    EPreload -->|"Native_API"| EMain

    %% Electron Main Process communicates with External Services
    EMain -->|"OBS_Integration"| OBS
    EMain -->|"MediaProcessing"| FFMPEG
    EMain -->|"CloudSync"| CLOUD

    %% Styles
    classDef electron fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef preload fill:#FFC0CB,stroke:#333,stroke-width:2px;
    classDef renderer fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef external fill:#FFA500,stroke:#333,stroke-width:2px,stroke-dasharray: 5, 5;
    classDef utility fill:#D3D3D3,stroke:#333,stroke-width:2px;

    %% Click Events
    click EMain "https://github.com/sircharlo/meeting-media-manager/tree/master/src-electron/main"
    click EPreload "https://github.com/sircharlo/meeting-media-manager/tree/master/src-electron/preload"
    click VComp "https://github.com/sircharlo/meeting-media-manager/tree/master/src/components"
    click VRoute "https://github.com/sircharlo/meeting-media-manager/tree/master/src/router"
    click VI18n "https://github.com/sircharlo/meeting-media-manager/tree/master/src/i18n"
    click VQuasar "https://github.com/sircharlo/meeting-media-manager/blob/master/quasar.config.ts"
    click BUILD "https://github.com/sircharlo/meeting-media-manager/tree/master/build"
    click DOC "https://github.com/sircharlo/meeting-media-manager/tree/master/docs"
    click TEST "https://github.com/sircharlo/meeting-media-manager/tree/master/test"
```
