# liban-ahmed/taqwa architecture

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

- Interactive diagram: https://gitdiagram.com/liban-ahmed/taqwa
- Repository: https://github.com/liban-ahmed/taqwa

## Overview

Taqwa is an iOS Islamic-practice companion centered on location-based prayer times and reminders, with learning progress and Qibla direction as substantial companion features. The shown startup path requests notification permission and schedules prayer alerts; the prayer screen obtains location, calculates daily times, and exposes status and notification choices. Learning adds lessons, quizzes, progress, analytics, achievements, and local/cloud-sync abstraction. Several feature relationships are evidenced only by the source index; dashed links identify major but unverified UI paths rather than asserting source-level calls.

Main entry points: [`Taqwa App/Features/Prayer/ViewModels/PrayerTimesViewModel.swift`](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Prayer/ViewModels/PrayerTimesViewModel.swift) (Prayer times state), [`Taqwa App/Features/Learn/Views/Main/LearnView.swift`](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/Views/Main/LearnView.swift) (Learning hub), [`Taqwa App/Core/Services/NotificationService.swift`](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Core/Services/NotificationService.swift) (Prayer reminders), [`Taqwa App/Views/TrackerView.swift`](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Views/TrackerView.swift) (Prayer tracker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_launch["App startup<br/>[AppDelegate.swift]"]
  node_rootview["Root view<br/>[ContentView.swift]"]
  node_loading["Loading screen<br/>[LoadingView.swift]"]
  node_home["Home dashboard<br/>[HomeView.swift]"]
  node_navigation["Bottom navigation"]
  node_settings["Settings<br/>[SettingsView.swift]"]
end

subgraph group_prayer["Prayer and reminders"]
  node_prayer_screen["Prayer screen"]
  node_prayer_list["Prayer list"]
  node_prayer_vm["Prayer times state"]
  node_prayer_model["Prayer time records"]
  node_location["Location service"]
  node_calculation["Prayer calculations"]
  node_reminders["Prayer reminders"]
  node_permission["Notification permissions"]
  node_notify_option["Alert preferences"]
  node_tracker["Prayer tracker<br/>[TrackerView.swift]"]
  node_date_select["Date selector"]
  node_trend["Prayer trends<br/>[TrendView.swift]"]
end

subgraph group_learning["Islamic learning"]
  node_learn_view["Learning hub<br/>[LearnView.swift]"]
  node_lesson["Lessons<br/>[LessonView.swift]"]
  node_quiz["Quizzes<br/>[QuizView.swift]"]
  node_progress["Learning progress"]
  node_learning_data["Learning data"]
  node_analytics["Quiz analytics"]
  node_achievement_mgr["Achievement manager"]
  node_achievement_view["Achievement display"]
  node_achievement_model["Achievement records<br/>[Achievement.swift]"]
  node_cloud_sync["Progress sync"]
end

subgraph group_qibla["Qibla direction"]
  node_qibla_view["Qibla compass<br/>[QiblaView.swift]"]
  node_qibla_vm["Qibla direction state"]
  node_qibla_model["Qibla direction model"]
end

node_user(("App user"))
node_local_store[("Device storage")]
node_notification_center["iOS notifications"]

node_user -->|"opens app"| node_launch
node_launch -->|"requests access"| node_permission
node_launch -->|"schedules alerts"| node_reminders
node_launch -->|"sets delegate"| node_notification_center
node_rootview -->|"wraps content"| node_loading
node_rootview -->|"shows screen"| node_prayer_screen
node_user -.->|"selects feature"| node_navigation
node_navigation -.->|"opens dashboard"| node_home
node_prayer_screen -.->|"presents state"| node_prayer_vm
node_prayer_screen -.->|"shows times"| node_prayer_list
node_prayer_vm -->|"requests location"| node_location
node_prayer_vm -->|"calculates times"| node_calculation
node_calculation -->|"creates times"| node_prayer_model
node_prayer_vm -.->|"loads statuses"| node_prayer_model
node_prayer_list -->|"reads state"| node_prayer_vm
node_prayer_list -->|"offers choices"| node_notify_option
node_prayer_vm -->|"schedules reminders"| node_reminders
node_reminders -->|"calculates alerts"| node_calculation
node_reminders -->|"requests access"| node_permission
node_reminders -->|"uses preferences"| node_notify_option
node_reminders -->|"registers requests"| node_notification_center
node_user -.->|"tracks prayers"| node_tracker
node_tracker -->|"selects date"| node_date_select
node_tracker -->|"shows records"| node_prayer_list
node_tracker -->|"reads times"| node_prayer_vm
node_tracker -->|"shows trends"| node_trend
node_user -.->|"opens learning"| node_learn_view
node_learn_view -->|"reads progress"| node_progress
node_learn_view -->|"shows analytics"| node_analytics
node_learn_view -->|"loads achievements"| node_achievement_mgr
node_learn_view -.->|"opens lesson"| node_lesson
node_learn_view -.->|"opens quiz"| node_quiz
node_quiz -->|"saves quiz progress"| node_progress
node_progress -->|"checks achievements"| node_achievement_mgr
node_achievement_mgr -->|"manages records"| node_achievement_model
node_achievement_view -->|"reads achievements"| node_achievement_mgr
node_progress -->|"syncs progress"| node_cloud_sync
node_progress -->|"stores progress"| node_local_store
node_cloud_sync -->|"caches locally"| node_local_store
node_user -.->|"opens compass"| node_qibla_view
node_qibla_view -->|"reads direction"| node_qibla_vm
node_qibla_vm -.->|"uses direction model"| node_qibla_model
node_user -.->|"changes settings"| node_settings

click node_launch "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/App/AppDelegate.swift"
click node_rootview "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/App/ContentView.swift"
click node_loading "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Views/LoadingView.swift"
click node_home "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Views/HomeView.swift"
click node_navigation "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Core/Navigation/BottomNavigationBarView.swift"
click node_prayer_screen "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Prayer/Views/PrayerTimesView.swift"
click node_prayer_list "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Prayer/Views/PrayerTimesListView.swift"
click node_prayer_vm "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Prayer/ViewModels/PrayerTimesViewModel.swift"
click node_prayer_model "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Prayer/Models/PrayerTimesModel.swift"
click node_location "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Core/Services/LocationService.swift"
click node_calculation "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Core/Services/PrayerCalculationService.swift"
click node_reminders "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Core/Services/NotificationService.swift"
click node_permission "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Core/Utilities/NotificationPermissionManager.swift"
click node_notify_option "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Core/Utilities/NotificationOption.swift"
click node_tracker "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Views/TrackerView.swift"
click node_date_select "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Views/DateSelectorView.swift"
click node_trend "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Views/TrendView.swift"
click node_learn_view "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/Views/Main/LearnView.swift"
click node_lesson "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/Views/LessonView.swift"
click node_quiz "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/Views/QuizView.swift"
click node_progress "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/ViewModels/LearningProgressManager.swift"
click node_learning_data "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Core/Services/LearningDataManger.swift"
click node_analytics "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/Views/QuizAnalyticsView.swift"
click node_achievement_mgr "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/ViewModels/AchievementManager.swift"
click node_achievement_view "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/Views/AchievementView.swift"
click node_achievement_model "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/Models/Achievement.swift"
click node_cloud_sync "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/Models/CloudSyncManager.swift"
click node_qibla_view "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Qibla/Views/QiblaView.swift"
click node_qibla_vm "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Qibla/ViewModels/QiblaDirectionViewModel.swift"
click node_qibla_model "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Qibla/Models/QiblaDirectionModel.swift"
click node_settings "https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Settings/Views/SettingsView.swift"

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_launch,node_rootview,node_loading,node_home,node_navigation,node_settings,node_user toneBlue
class node_prayer_screen,node_prayer_list,node_prayer_vm,node_prayer_model,node_location,node_calculation,node_reminders,node_permission,node_notify_option,node_tracker,node_date_select,node_trend,node_local_store toneAmber
class node_learn_view,node_lesson,node_quiz,node_progress,node_learning_data,node_analytics,node_achievement_mgr,node_achievement_view,node_achievement_model,node_cloud_sync toneMint
class node_qibla_view,node_qibla_vm,node_qibla_model toneRose
class node_notification_center toneIndigo
```

## Components

### App shell

- [App startup](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/App/AppDelegate.swift): `Taqwa App/App/AppDelegate.swift`
- [Root view](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/App/ContentView.swift): `Taqwa App/App/ContentView.swift`
- [Loading screen](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Views/LoadingView.swift): `Taqwa App/Views/LoadingView.swift`
- [Home dashboard](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Views/HomeView.swift): `Taqwa App/Views/HomeView.swift`
- [Bottom navigation](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Core/Navigation/BottomNavigationBarView.swift): `Taqwa App/Core/Navigation/BottomNavigationBarView.swift`
- [Settings](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Settings/Views/SettingsView.swift): `Taqwa App/Features/Settings/Views/SettingsView.swift`

### Prayer and reminders

- [Prayer screen](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Prayer/Views/PrayerTimesView.swift): `Taqwa App/Features/Prayer/Views/PrayerTimesView.swift`
- [Prayer list](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Prayer/Views/PrayerTimesListView.swift): `Taqwa App/Features/Prayer/Views/PrayerTimesListView.swift`
- [Prayer times state](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Prayer/ViewModels/PrayerTimesViewModel.swift): `Taqwa App/Features/Prayer/ViewModels/PrayerTimesViewModel.swift`
- [Prayer time records](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Prayer/Models/PrayerTimesModel.swift): `Taqwa App/Features/Prayer/Models/PrayerTimesModel.swift`
- [Location service](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Core/Services/LocationService.swift): `Taqwa App/Core/Services/LocationService.swift`
- [Prayer calculations](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Core/Services/PrayerCalculationService.swift): `Taqwa App/Core/Services/PrayerCalculationService.swift`
- [Prayer reminders](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Core/Services/NotificationService.swift): `Taqwa App/Core/Services/NotificationService.swift`
- [Notification permissions](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Core/Utilities/NotificationPermissionManager.swift): `Taqwa App/Core/Utilities/NotificationPermissionManager.swift`
- [Alert preferences](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Core/Utilities/NotificationOption.swift): `Taqwa App/Core/Utilities/NotificationOption.swift`
- [Prayer tracker](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Views/TrackerView.swift): `Taqwa App/Views/TrackerView.swift`
- [Date selector](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Views/DateSelectorView.swift): `Taqwa App/Views/DateSelectorView.swift`
- [Prayer trends](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Views/TrendView.swift): `Taqwa App/Views/TrendView.swift`

### Islamic learning

- [Learning hub](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/Views/Main/LearnView.swift): `Taqwa App/Features/Learn/Views/Main/LearnView.swift`
- [Lessons](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/Views/LessonView.swift): `Taqwa App/Features/Learn/Views/LessonView.swift`
- [Quizzes](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/Views/QuizView.swift): `Taqwa App/Features/Learn/Views/QuizView.swift`
- [Learning progress](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/ViewModels/LearningProgressManager.swift): `Taqwa App/Features/Learn/ViewModels/LearningProgressManager.swift`
- [Learning data](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Core/Services/LearningDataManger.swift): `Taqwa App/Core/Services/LearningDataManger.swift`
- [Quiz analytics](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/Views/QuizAnalyticsView.swift): `Taqwa App/Features/Learn/Views/QuizAnalyticsView.swift`
- [Achievement manager](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/ViewModels/AchievementManager.swift): `Taqwa App/Features/Learn/ViewModels/AchievementManager.swift`
- [Achievement display](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/Views/AchievementView.swift): `Taqwa App/Features/Learn/Views/AchievementView.swift`
- [Achievement records](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/Models/Achievement.swift): `Taqwa App/Features/Learn/Models/Achievement.swift`
- [Progress sync](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Learn/Models/CloudSyncManager.swift): `Taqwa App/Features/Learn/Models/CloudSyncManager.swift`

### Qibla direction

- [Qibla compass](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Qibla/Views/QiblaView.swift): `Taqwa App/Features/Qibla/Views/QiblaView.swift`
- [Qibla direction state](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Qibla/ViewModels/QiblaDirectionViewModel.swift): `Taqwa App/Features/Qibla/ViewModels/QiblaDirectionViewModel.swift`
- [Qibla direction model](https://github.com/liban-ahmed/taqwa/blob/main/Taqwa%20App/Features/Qibla/Models/QiblaDirectionModel.swift): `Taqwa App/Features/Qibla/Models/QiblaDirectionModel.swift`

### Other components

- **App user**
- **Device storage**
- **iOS notifications**

## Connections

- App user → App startup: opens app (evidence: `Taqwa App/App/AppDelegate.swift`)
- App startup → Notification permissions: requests access (evidence: `Taqwa App/App/AppDelegate.swift`)
- App startup → Prayer reminders: schedules alerts (evidence: `Taqwa App/App/AppDelegate.swift`)
- App startup → iOS notifications: sets delegate (evidence: `Taqwa App/App/AppDelegate.swift`)
- Root view → Loading screen: wraps content (evidence: `Taqwa App/App/ContentView.swift`)
- Root view → Prayer screen: shows screen (evidence: `Taqwa App/App/ContentView.swift`)
- App user → Bottom navigation: selects feature
- Bottom navigation → Home dashboard: opens dashboard
- Prayer screen → Prayer times state: presents state
- Prayer screen → Prayer list: shows times
- Prayer times state → Location service: requests location (evidence: `Taqwa App/Features/Prayer/ViewModels/PrayerTimesViewModel.swift`)
- Prayer times state → Prayer calculations: calculates times (evidence: `Taqwa App/Features/Prayer/ViewModels/PrayerTimesViewModel.swift`)
- Prayer calculations → Prayer time records: creates times (evidence: `Taqwa App/Core/Services/PrayerCalculationService.swift`)
- Prayer times state → Prayer time records: loads statuses
- Prayer list → Prayer times state: reads state (evidence: `Taqwa App/Features/Prayer/Views/PrayerTimesListView.swift`)
- Prayer list → Alert preferences: offers choices (evidence: `Taqwa App/Features/Prayer/Views/PrayerTimesListView.swift`)
- Prayer times state → Prayer reminders: schedules reminders (evidence: `Taqwa App/Features/Prayer/ViewModels/PrayerTimesViewModel.swift`)
- Prayer reminders → Prayer calculations: calculates alerts (evidence: `Taqwa App/Core/Services/NotificationService.swift`)
- Prayer reminders → Notification permissions: requests access (evidence: `Taqwa App/Core/Services/NotificationService.swift`)
- Prayer reminders → Alert preferences: uses preferences (evidence: `Taqwa App/Core/Services/NotificationService.swift`)
- Prayer reminders → iOS notifications: registers requests (evidence: `Taqwa App/Core/Services/NotificationService.swift`)
- App user → Prayer tracker: tracks prayers
- Prayer tracker → Date selector: selects date (evidence: `Taqwa App/Views/TrackerView.swift`)
- Prayer tracker → Prayer list: shows records (evidence: `Taqwa App/Views/TrackerView.swift`)
- Prayer tracker → Prayer times state: reads times (evidence: `Taqwa App/Views/TrackerView.swift`)
- Prayer tracker → Prayer trends: shows trends (evidence: `Taqwa App/Views/TrackerView.swift`)
- App user → Learning hub: opens learning
- Learning hub → Learning progress: reads progress (evidence: `Taqwa App/Features/Learn/Views/Main/LearnView.swift`)
- Learning hub → Quiz analytics: shows analytics (evidence: `Taqwa App/Features/Learn/Views/Main/LearnView.swift`)
- Learning hub → Achievement manager: loads achievements (evidence: `Taqwa App/Features/Learn/Views/Main/LearnView.swift`)
- Learning hub → Lessons: opens lesson
- Learning hub → Quizzes: opens quiz
- Quizzes → Learning progress: saves quiz progress (evidence: `Taqwa App/Features/Learn/Views/QuizView.swift`)
- Learning progress → Achievement manager: checks achievements (evidence: `Taqwa App/Features/Learn/ViewModels/LearningProgressManager.swift`)
- Achievement manager → Achievement records: manages records (evidence: `Taqwa App/Features/Learn/ViewModels/AchievementManager.swift`)
- Achievement display → Achievement manager: reads achievements (evidence: `Taqwa App/Features/Learn/Views/AchievementView.swift`)
- Learning progress → Progress sync: syncs progress (evidence: `Taqwa App/Features/Learn/ViewModels/LearningProgressManager.swift`)
- Learning progress → Device storage: stores progress (evidence: `Taqwa App/Features/Learn/ViewModels/LearningProgressManager.swift`)
- Progress sync → Device storage: caches locally (evidence: `Taqwa App/Features/Learn/Models/CloudSyncManager.swift`)
- App user → Qibla compass: opens compass
- Qibla compass → Qibla direction state: reads direction (evidence: `Taqwa App/Features/Qibla/Views/QiblaView.swift`)
- Qibla direction state → Qibla direction model: uses direction model
- App user → Settings: changes settings
