# thevoidmonarch/msuite-clang architecture

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

- Interactive diagram: https://gitdiagram.com/thevoidmonarch/msuite-clang
- Repository: https://github.com/thevoidmonarch/msuite-clang

## Overview

MasjidSuite is a console-led mosque prayer-time display application. Its main workflow fetches prayer times, then shows them in the console or passes them to a local graphical display with a live next-prayer countdown. The menu also offers an Azan test, basic admin options, and syslog viewing. API retrieval, SDL presentation/audio, and logging are implemented; the admin actions shown in the menu are placeholders. Edges reflect the README or shown source; unsampled capabilities are not inferred beyond documentation.

Main entry points: [`src/main.c`](https://github.com/thevoidmonarch/msuite-clang/blob/main/src/main.c) (Console menu), [`src/api_handler.c`](https://github.com/thevoidmonarch/msuite-clang/blob/main/src/api_handler.c) (Prayer-time fetch), [`src/sdl_handler.c`](https://github.com/thevoidmonarch/msuite-clang/blob/main/src/sdl_handler.c) (Graphical display), [`src/api_handler.h`](https://github.com/thevoidmonarch/msuite-clang/blob/main/src/api_handler.h) (PrayerTimes data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Menu and administration"]
  node_menu["Console menu<br/>[main.c]"]
  node_console_times["Console times<br/>[main.c]"]
  node_admin["Admin options<br/>[main.c]"]
  node_syslog_view["Syslog viewer<br/>[main.c]"]
end

subgraph group_prayer_data["Prayer-time retrieval"]
  node_fetch["Prayer-time fetch<br/>[api_handler.c]"]
  node_location["IP geolocation<br/>[api_handler.c]"]
  node_prayer_api["Aladhan API"]
  node_geo_api["IP geolocation API"]
  node_prayer_times["PrayerTimes data<br/>[api_handler.h]"]
end

subgraph group_presentation["Display and audio"]
  node_graphic_display["Graphical display<br/>[sdl_handler.c]"]
  node_countdown["Next-prayer countdown<br/>[sdl_handler.c]"]
  node_text_render["Text rendering<br/>[sdl_handler.c]"]
  node_azan_control["Azan playback<br/>[sdl_handler.c]"]
  node_azan_audio["Azan audio files"]
end

subgraph group_logging["Logging"]
  node_logger["Logger<br/>[logger.c]"]
  node_syslog_file[("Syslog file<br/>[logger.c]")]
end

node_user(("User"))

node_user -->|"chooses options"| node_menu
node_menu -->|"requests times"| node_fetch
node_fetch -->|"looks up location"| node_location
node_location -->|"requests location"| node_geo_api
node_fetch -->|"requests timings"| node_prayer_api
node_fetch -->|"returns times"| node_prayer_times
node_menu -->|"prints times"| node_console_times
node_prayer_times -->|"supplies data"| node_console_times
node_menu -->|"launches display"| node_graphic_display
node_prayer_times -->|"supplies data"| node_graphic_display
node_graphic_display -->|"computes countdown"| node_countdown
node_graphic_display -->|"renders labels"| node_text_render
node_menu -->|"tests playback"| node_azan_control
node_azan_control -->|"loads audio"| node_azan_audio
node_menu -->|"opens settings"| node_admin
node_menu -->|"views logs"| node_syslog_view
node_syslog_view -->|"reads"| node_syslog_file
node_menu -->|"records activity"| node_logger
node_fetch -->|"records requests"| node_logger
node_logger -->|"appends entries"| node_syslog_file

click node_menu "https://github.com/thevoidmonarch/msuite-clang/blob/main/src/main.c"
click node_console_times "https://github.com/thevoidmonarch/msuite-clang/blob/main/src/main.c"
click node_admin "https://github.com/thevoidmonarch/msuite-clang/blob/main/src/main.c"
click node_syslog_view "https://github.com/thevoidmonarch/msuite-clang/blob/main/src/main.c"
click node_fetch "https://github.com/thevoidmonarch/msuite-clang/blob/main/src/api_handler.c"
click node_location "https://github.com/thevoidmonarch/msuite-clang/blob/main/src/api_handler.c"
click node_prayer_times "https://github.com/thevoidmonarch/msuite-clang/blob/main/src/api_handler.h"
click node_graphic_display "https://github.com/thevoidmonarch/msuite-clang/blob/main/src/sdl_handler.c"
click node_countdown "https://github.com/thevoidmonarch/msuite-clang/blob/main/src/sdl_handler.c"
click node_text_render "https://github.com/thevoidmonarch/msuite-clang/blob/main/src/sdl_handler.c"
click node_azan_control "https://github.com/thevoidmonarch/msuite-clang/blob/main/src/sdl_handler.c"
click node_azan_audio "https://github.com/thevoidmonarch/msuite-clang/tree/main/assets"
click node_logger "https://github.com/thevoidmonarch/msuite-clang/blob/main/src/logger.c"
click node_syslog_file "https://github.com/thevoidmonarch/msuite-clang/blob/main/src/logger.c"

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_menu,node_console_times,node_admin,node_syslog_view,node_user toneBlue
class node_fetch,node_location,node_prayer_api,node_geo_api,node_prayer_times toneAmber
class node_graphic_display,node_countdown,node_text_render,node_azan_control,node_azan_audio toneMint
class node_logger,node_syslog_file toneRose
```

## Components

### Menu and administration

- [Console menu](https://github.com/thevoidmonarch/msuite-clang/blob/main/src/main.c): `src/main.c`
- [Console times](https://github.com/thevoidmonarch/msuite-clang/blob/main/src/main.c): `src/main.c`
- [Admin options](https://github.com/thevoidmonarch/msuite-clang/blob/main/src/main.c): `src/main.c`
- [Syslog viewer](https://github.com/thevoidmonarch/msuite-clang/blob/main/src/main.c): `src/main.c`

### Prayer-time retrieval

- [Prayer-time fetch](https://github.com/thevoidmonarch/msuite-clang/blob/main/src/api_handler.c): `src/api_handler.c`
- [IP geolocation](https://github.com/thevoidmonarch/msuite-clang/blob/main/src/api_handler.c): `src/api_handler.c`
- **Aladhan API**
- **IP geolocation API**
- [PrayerTimes data](https://github.com/thevoidmonarch/msuite-clang/blob/main/src/api_handler.h): `src/api_handler.h`

### Display and audio

- [Graphical display](https://github.com/thevoidmonarch/msuite-clang/blob/main/src/sdl_handler.c): `src/sdl_handler.c`
- [Next-prayer countdown](https://github.com/thevoidmonarch/msuite-clang/blob/main/src/sdl_handler.c): `src/sdl_handler.c`
- [Text rendering](https://github.com/thevoidmonarch/msuite-clang/blob/main/src/sdl_handler.c): `src/sdl_handler.c`
- [Azan playback](https://github.com/thevoidmonarch/msuite-clang/blob/main/src/sdl_handler.c): `src/sdl_handler.c`
- [Azan audio files](https://github.com/thevoidmonarch/msuite-clang/tree/main/assets): `assets`

### Logging

- [Logger](https://github.com/thevoidmonarch/msuite-clang/blob/main/src/logger.c): `src/logger.c`
- [Syslog file](https://github.com/thevoidmonarch/msuite-clang/blob/main/src/logger.c): `src/logger.c`

### Other components

- **User**

## Connections

- User → Console menu: chooses options (evidence: `src/main.c`)
- Console menu → Prayer-time fetch: requests times (evidence: `src/main.c`)
- Prayer-time fetch → IP geolocation: looks up location (evidence: `src/api_handler.c`)
- IP geolocation → IP geolocation API: requests location (evidence: `src/api_handler.c`)
- Prayer-time fetch → Aladhan API: requests timings (evidence: `README.md`)
- Prayer-time fetch → PrayerTimes data: returns times (evidence: `src/api_handler.c`)
- Console menu → Console times: prints times (evidence: `src/main.c`)
- PrayerTimes data → Console times: supplies data (evidence: `src/main.c`)
- Console menu → Graphical display: launches display (evidence: `src/main.c`)
- PrayerTimes data → Graphical display: supplies data (evidence: `src/sdl_handler.c`)
- Graphical display → Next-prayer countdown: computes countdown (evidence: `src/sdl_handler.c`)
- Graphical display → Text rendering: renders labels (evidence: `src/sdl_handler.c`)
- Console menu → Azan playback: tests playback (evidence: `src/main.c`)
- Azan playback → Azan audio files: loads audio
- Console menu → Admin options: opens settings (evidence: `src/main.c`)
- Console menu → Syslog viewer: views logs (evidence: `src/main.c`)
- Syslog viewer → Syslog file: reads (evidence: `src/main.c`)
- Console menu → Logger: records activity (evidence: `src/main.c`)
- Prayer-time fetch → Logger: records requests (evidence: `src/api_handler.c`)
- Logger → Syslog file: appends entries (evidence: `src/logger.c`)
