# asmaklad/mmm-prayertime architecture

> Architecture diagram of the GitHub repository asmaklad/mmm-prayertime, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/asmaklad/mmm-prayertime
- Repository: https://github.com/asmaklad/mmm-prayertime

## Overview

MMM-PrayerTime is a MagicMirror module that fetches prayer times, presents today’s and optionally tomorrow’s schedule, and can announce selected prayer times. Its main flow runs from the MagicMirror module through a Node helper to the prayer-times API and back; the module then prepares schedules and triggers display alerts or audio playback. Configuration also covers calculation methods, time formats, and display choices. Telegram-related code is visible in the frontend excerpt, but its backend behavior is not shown, so that integration is represented as unverified.

Main entry points: [`MMM-PrayerTime.js`](https://github.com/asmaklad/mmm-prayertime/blob/master/MMM-PrayerTime.js) (PrayerTime module), [`node_helper.js`](https://github.com/asmaklad/mmm-prayertime/blob/master/node_helper.js) (Node helper), [`res`](https://github.com/asmaklad/mmm-prayertime/tree/master/res) (Adhan audio files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_schedule["Prayer schedules"]
  node_prayer_module["PrayerTime module<br/>[MMM-PrayerTime.js]"]
  node_node_helper["Node helper<br/>[node_helper.js]"]
  node_schedule_data["Prayer schedules<br/>[MMM-PrayerTime.js]"]
end

subgraph group_presentation["Display and alerts"]
  node_schedule_display["Schedule display<br/>[MMM-PrayerTime.js]"]
  node_alert_trigger["Adhan alert trigger<br/>[MMM-PrayerTime.js]"]
  node_telegram_alert["Telegram alert<br/>[MMM-PrayerTime.js]"]
end

subgraph group_announcements["Audio announcements"]
  node_audio_player["Audio playback<br/>[node_helper.js]"]
  node_audio_files["Adhan audio files"]
end

node_magicmirror(("MagicMirror host"))
node_prayer_api["Prayer-time API"]

node_magicmirror -->|"hosts module"| node_prayer_module
node_prayer_module -->|"requests fetch"| node_node_helper
node_node_helper -->|"fetches timings"| node_prayer_api
node_node_helper -->|"returns timings"| node_prayer_module
node_prayer_module -->|"processes timings"| node_schedule_data
node_prayer_module -->|"renders schedule"| node_schedule_display
node_prayer_module -->|"sends alert"| node_alert_trigger
node_prayer_module -->|"requests playback"| node_node_helper
node_node_helper -->|"runs player"| node_audio_player
node_audio_player -->|"plays audio"| node_audio_files
node_prayer_module -.->|"requests notification"| node_telegram_alert

click node_prayer_module "https://github.com/asmaklad/mmm-prayertime/blob/master/MMM-PrayerTime.js"
click node_node_helper "https://github.com/asmaklad/mmm-prayertime/blob/master/node_helper.js"
click node_schedule_data "https://github.com/asmaklad/mmm-prayertime/blob/master/MMM-PrayerTime.js"
click node_schedule_display "https://github.com/asmaklad/mmm-prayertime/blob/master/MMM-PrayerTime.js"
click node_alert_trigger "https://github.com/asmaklad/mmm-prayertime/blob/master/MMM-PrayerTime.js"
click node_telegram_alert "https://github.com/asmaklad/mmm-prayertime/blob/master/MMM-PrayerTime.js"
click node_audio_player "https://github.com/asmaklad/mmm-prayertime/blob/master/node_helper.js"
click node_audio_files "https://github.com/asmaklad/mmm-prayertime/tree/master/res"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_prayer_module,node_node_helper,node_schedule_data toneBlue
class node_schedule_display,node_alert_trigger,node_telegram_alert toneAmber
class node_audio_player,node_audio_files,node_prayer_api toneMint
class node_magicmirror toneIndigo
```

## Components

### Prayer schedules

- [PrayerTime module](https://github.com/asmaklad/mmm-prayertime/blob/master/MMM-PrayerTime.js): `MMM-PrayerTime.js`
- [Node helper](https://github.com/asmaklad/mmm-prayertime/blob/master/node_helper.js): `node_helper.js`
- [Prayer schedules](https://github.com/asmaklad/mmm-prayertime/blob/master/MMM-PrayerTime.js): `MMM-PrayerTime.js`

### Display and alerts

- [Schedule display](https://github.com/asmaklad/mmm-prayertime/blob/master/MMM-PrayerTime.js): `MMM-PrayerTime.js`
- [Adhan alert trigger](https://github.com/asmaklad/mmm-prayertime/blob/master/MMM-PrayerTime.js): `MMM-PrayerTime.js`
- [Telegram alert](https://github.com/asmaklad/mmm-prayertime/blob/master/MMM-PrayerTime.js): `MMM-PrayerTime.js`

### Audio announcements

- [Audio playback](https://github.com/asmaklad/mmm-prayertime/blob/master/node_helper.js): `node_helper.js`
- [Adhan audio files](https://github.com/asmaklad/mmm-prayertime/tree/master/res): `res`

### Other components

- **MagicMirror host**
- **Prayer-time API**

## Connections

- MagicMirror host → PrayerTime module: hosts module (evidence: `README.md`)
- PrayerTime module → Node helper: requests fetch (evidence: `MMM-PrayerTime.js`)
- Node helper → Prayer-time API: fetches timings (evidence: `node_helper.js`)
- Node helper → PrayerTime module: returns timings (evidence: `node_helper.js`)
- PrayerTime module → Prayer schedules: processes timings (evidence: `MMM-PrayerTime.js`)
- PrayerTime module → Schedule display: renders schedule (evidence: `MMM-PrayerTime.js`)
- PrayerTime module → Adhan alert trigger: sends alert (evidence: `MMM-PrayerTime.js`)
- PrayerTime module → Node helper: requests playback (evidence: `MMM-PrayerTime.js`)
- Node helper → Audio playback: runs player (evidence: `node_helper.js`)
- Audio playback → Adhan audio files: plays audio (evidence: `node_helper.js`)
- PrayerTime module → Telegram alert: requests notification (evidence: `MMM-PrayerTime.js`)
