# sshafiuddin-dev/salahhub architecture

> Architecture diagram of the GitHub repository sshafiuddin-dev/salahhub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sshafiuddin-dev/salahhub
- Repository: https://github.com/sshafiuddin-dev/salahhub

## Overview

Iqama Times is an installable, local-settings prayer hub for an always-on tablet. The main flow runs from the app’s location and preferences through prayer-time calculation and schedule assembly to clock displays and alerts; parallel features provide weather, adhkar, Quran playback, and feedback. Cloudflare endpoints supply live iqama times and US weather alerts, while committed data supports daily use. Edges reflect calls visible in excerpts or explicit README statements; unsampled capability links are omitted rather than inferred.

Main entry points: [`app.js`](https://github.com/sshafiuddin-dev/salahhub/blob/main/app.js) (App orchestration), [`quran.js`](https://github.com/sshafiuddin-dev/salahhub/blob/main/quran.js) (Quran player), [`feedback.js`](https://github.com/sshafiuddin-dev/salahhub/blob/main/feedback.js) (Feedback UI), [`adhkar.js`](https://github.com/sshafiuddin-dev/salahhub/blob/main/adhkar.js) (Adhkar controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Prayer Hub"]
  node_app["App orchestration<br/>[app.js]"]
  node_clock["Clock displays<br/>[clocks.js]"]
  node_weather["Weather display<br/>[weather.js]"]
  node_sky["Sky and sun<br/>[sky.js]"]
  node_feedback["Feedback UI<br/>[feedback.js]"]
end

subgraph group_content["Daily Content"]
  node_adhkar["Adhkar controls<br/>[adhkar.js]"]
  node_hisn["Hisn text<br/>[hisn.js]"]
  node_hisndata["Hisn al-Muslim data<br/>[hisn-text.json]"]
  node_quran["Quran player<br/>[quran.js]"]
  node_qlogic["Queue logic<br/>[quran-logic.js]"]
end

subgraph group_services["Cloud Services"]
  node_iqamaapi["Live iqama API<br/>[iqama.js]"]
  node_parser["Schedule parser<br/>[parse.js]"]
  node_iqamadata["Stored iqama schedule<br/>[iqama.json]"]
  node_alertsapi["Weather alerts API<br/>[alerts.js]"]
  node_feedbackapi["Feedback endpoint<br/>[feedback.js]"]
end

subgraph group_calc["Prayer Calculation"]
  node_timing["Time logic<br/>[logic.js]"]
  node_praytimes["Prayer calculator<br/>[PrayTimes.js]"]
  node_methods["Calculation methods"]
end

node_resident(("Tablet user"))
node_iscj["ISCJ schedule"]
node_nws["US weather service"]
node_recitations["Quran recitations"]
node_resend["Resend email"]

node_resident -->|"uses"| node_app
node_app -->|"calculates prayers"| node_praytimes
node_praytimes -->|"uses methods"| node_methods
node_app -->|"uses time logic"| node_timing
node_app -->|"renders"| node_clock
node_app -.->|"fetches live times"| node_iqamaapi
node_iqamaapi -->|"reads schedule"| node_parser
node_parser -->|"fetches schedule"| node_iscj
node_app -.->|"loads schedule"| node_iqamadata
node_app -->|"uses weather"| node_weather
node_app -->|"uses sky data"| node_sky
node_app -.->|"fetches alerts"| node_alertsapi
node_alertsapi -->|"requests warnings"| node_nws
node_app -->|"controls"| node_adhkar
node_adhkar -->|"uses text"| node_hisn
node_hisn -.->|"loads"| node_hisndata
node_app -->|"opens player"| node_quran
node_quran -->|"uses queue logic"| node_qlogic
node_quran -.->|"plays audio"| node_recitations
node_app -->|"opens feedback"| node_feedback
node_feedback -.->|"submits feedback"| node_feedbackapi
node_feedbackapi -->|"sends email"| node_resend

click node_app "https://github.com/sshafiuddin-dev/salahhub/blob/main/app.js"
click node_clock "https://github.com/sshafiuddin-dev/salahhub/blob/main/clocks.js"
click node_timing "https://github.com/sshafiuddin-dev/salahhub/blob/main/logic.js"
click node_praytimes "https://github.com/sshafiuddin-dev/salahhub/blob/main/lib/PrayTimes.js"
click node_methods "https://github.com/sshafiuddin-dev/salahhub/blob/main/lib/CalculationMethods.js"
click node_iqamaapi "https://github.com/sshafiuddin-dev/salahhub/blob/main/functions/api/iqama.js"
click node_parser "https://github.com/sshafiuddin-dev/salahhub/blob/main/functions/_lib/parse.js"
click node_iqamadata "https://github.com/sshafiuddin-dev/salahhub/blob/main/iqama.json"
click node_weather "https://github.com/sshafiuddin-dev/salahhub/blob/main/weather.js"
click node_sky "https://github.com/sshafiuddin-dev/salahhub/blob/main/sky.js"
click node_alertsapi "https://github.com/sshafiuddin-dev/salahhub/blob/main/functions/api/alerts.js"
click node_adhkar "https://github.com/sshafiuddin-dev/salahhub/blob/main/adhkar.js"
click node_hisn "https://github.com/sshafiuddin-dev/salahhub/blob/main/hisn.js"
click node_hisndata "https://github.com/sshafiuddin-dev/salahhub/blob/main/hisn-text.json"
click node_quran "https://github.com/sshafiuddin-dev/salahhub/blob/main/quran.js"
click node_qlogic "https://github.com/sshafiuddin-dev/salahhub/blob/main/quran-logic.js"
click node_feedback "https://github.com/sshafiuddin-dev/salahhub/blob/main/feedback.js"
click node_feedbackapi "https://github.com/sshafiuddin-dev/salahhub/blob/main/functions/api/feedback.js"

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_app,node_clock,node_weather,node_sky,node_feedback,node_resident toneBlue
class node_adhkar,node_hisn,node_hisndata,node_quran,node_qlogic toneAmber
class node_iqamaapi,node_parser,node_iqamadata,node_alertsapi,node_feedbackapi toneMint
class node_timing,node_praytimes,node_methods toneRose
class node_iscj,node_nws,node_recitations,node_resend toneIndigo
```

## Components

### Prayer Hub

- [App orchestration](https://github.com/sshafiuddin-dev/salahhub/blob/main/app.js): `app.js`
- [Clock displays](https://github.com/sshafiuddin-dev/salahhub/blob/main/clocks.js): `clocks.js`
- [Weather display](https://github.com/sshafiuddin-dev/salahhub/blob/main/weather.js): `weather.js`
- [Sky and sun](https://github.com/sshafiuddin-dev/salahhub/blob/main/sky.js): `sky.js`
- [Feedback UI](https://github.com/sshafiuddin-dev/salahhub/blob/main/feedback.js): `feedback.js`

### Daily Content

- [Adhkar controls](https://github.com/sshafiuddin-dev/salahhub/blob/main/adhkar.js): `adhkar.js`
- [Hisn text](https://github.com/sshafiuddin-dev/salahhub/blob/main/hisn.js): `hisn.js`
- [Hisn al-Muslim data](https://github.com/sshafiuddin-dev/salahhub/blob/main/hisn-text.json): `hisn-text.json`
- [Quran player](https://github.com/sshafiuddin-dev/salahhub/blob/main/quran.js): `quran.js`
- [Queue logic](https://github.com/sshafiuddin-dev/salahhub/blob/main/quran-logic.js): `quran-logic.js`

### Cloud Services

- [Live iqama API](https://github.com/sshafiuddin-dev/salahhub/blob/main/functions/api/iqama.js): `functions/api/iqama.js`
- [Schedule parser](https://github.com/sshafiuddin-dev/salahhub/blob/main/functions/_lib/parse.js): `functions/_lib/parse.js`
- [Stored iqama schedule](https://github.com/sshafiuddin-dev/salahhub/blob/main/iqama.json): `iqama.json`
- [Weather alerts API](https://github.com/sshafiuddin-dev/salahhub/blob/main/functions/api/alerts.js): `functions/api/alerts.js`
- [Feedback endpoint](https://github.com/sshafiuddin-dev/salahhub/blob/main/functions/api/feedback.js): `functions/api/feedback.js`

### Prayer Calculation

- [Time logic](https://github.com/sshafiuddin-dev/salahhub/blob/main/logic.js): `logic.js`
- [Prayer calculator](https://github.com/sshafiuddin-dev/salahhub/blob/main/lib/PrayTimes.js): `lib/PrayTimes.js`
- [Calculation methods](https://github.com/sshafiuddin-dev/salahhub/blob/main/lib/CalculationMethods.js): `lib/CalculationMethods.js`

### Other components

- **Tablet user**
- **ISCJ schedule**
- **US weather service**
- **Quran recitations**
- **Resend email**

## Connections

- Tablet user → App orchestration: uses (evidence: `README.md`)
- App orchestration → Prayer calculator: calculates prayers (evidence: `app.js`)
- Prayer calculator → Calculation methods: uses methods (evidence: `lib/PrayTimes.js`)
- App orchestration → Time logic: uses time logic (evidence: `app.js`)
- App orchestration → Clock displays: renders (evidence: `app.js`)
- App orchestration → Live iqama API: fetches live times
- Live iqama API → Schedule parser: reads schedule (evidence: `functions/api/iqama.js`)
- Schedule parser → ISCJ schedule: fetches schedule (evidence: `functions/_lib/parse.js`)
- App orchestration → Stored iqama schedule: loads schedule
- App orchestration → Weather display: uses weather (evidence: `app.js`)
- App orchestration → Sky and sun: uses sky data (evidence: `app.js`)
- App orchestration → Weather alerts API: fetches alerts
- Weather alerts API → US weather service: requests warnings (evidence: `functions/api/alerts.js`)
- App orchestration → Adhkar controls: controls (evidence: `app.js`)
- Adhkar controls → Hisn text: uses text (evidence: `adhkar.js`)
- Hisn text → Hisn al-Muslim data: loads
- App orchestration → Quran player: opens player (evidence: `app.js`)
- Quran player → Queue logic: uses queue logic (evidence: `quran.js`)
- Quran player → Quran recitations: plays audio
- App orchestration → Feedback UI: opens feedback (evidence: `app.js`)
- Feedback UI → Feedback endpoint: submits feedback
- Feedback endpoint → Resend email: sends email (evidence: `functions/api/feedback.js`)
