# user-zak/furqan architecture

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

- Interactive diagram: https://gitdiagram.com/user-zak/furqan
- Repository: https://github.com/user-zak/furqan

## Overview

Nadir is a Quran-focused reading and worship app with recitation practice, prayer tools, group reading, and a social recitation community. The main reader flow loads a Mushaf page, renders Quran text, and supports translation and recitation playback. Other user workflows include practicing memorization, publishing and discovering recitations, and coordinating group reading. The source index supports several connections; where implementation was not sampled, I show documented module references rather than assuming deeper control flow.

Main entry points: [`app/read/page.tsx`](https://github.com/user-zak/furqan/blob/main/app/read/page.tsx) (Mushaf reader), [`app/api/ayah/route.ts`](https://github.com/user-zak/furqan/blob/main/app/api/ayah/route.ts) (Ayah API), [`app/page.tsx`](https://github.com/user-zak/furqan/blob/main/app/page.tsx) (Home screen), [`app/api/halaqa/[id]/route.ts`](https://github.com/user-zak/furqan/blob/main/app/api/halaqa/%5Bid%5D/route.ts) (Group API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_quran["Quran reading"]
  node_reader["Mushaf reader<br/>[page.tsx]"]
  node_quran_view["Quran page view<br/>[QuranPageView.tsx]"]
  node_mushaf_engine["Mushaf layout"]
  node_quran_data["Quran data<br/>[quran.ts]"]
  node_ayah_api["Ayah API<br/>[route.ts]"]
  node_translation_data["Translations<br/>[translations.ts]"]
  node_reader_audio["Page recitation"]
end

subgraph group_practice["Practice and worship"]
  node_hifdh["Memorization practice<br/>[page.tsx]"]
  node_asr_hook["Recitation recognition<br/>[useQuranAsr.ts]"]
  node_asr_runtime["Offline recognizer"]
  node_prayer["Prayer and qibla<br/>[page.tsx]"]
end

subgraph group_community["Reading community"]
  node_halaqa_ui["Group reading<br/>[HalaqaScreen.tsx]"]
  node_halaqa_api["Group API<br/>[route.ts]"]
  node_halaqa_service["Group operations<br/>[halaqa-server.ts]"]
end

subgraph group_qari["Recitation community"]
  node_qari_feed["Recitation discovery<br/>[page.tsx]"]
  node_qari_api["Recitation API<br/>[route.ts]"]
  node_qari_storage[("Audio and image storage<br/>[qari-storage.ts]")]
end

subgraph group_platform["Shared platform"]
  node_home["Home screen<br/>[page.tsx]"]
  node_settings["App settings<br/>[page.tsx]"]
  node_settings_store["Settings persistence<br/>[app-settings.ts]"]
  node_auth["Authentication<br/>[auth.ts]"]
  node_database[("Application database<br/>[prisma.ts]")]
end

node_visitor(("App user"))

node_visitor -->|"opens"| node_home
node_home -.->|"navigates to"| node_reader
node_reader -->|"renders"| node_quran_view
node_reader -->|"loads pages"| node_quran_data
node_reader -->|"controls playback"| node_reader_audio
node_quran_view -.->|"uses layout"| node_mushaf_engine
node_visitor -->|"requests verses"| node_ayah_api
node_ayah_api -->|"reads Quran data"| node_quran_data
node_ayah_api -->|"checks editions"| node_translation_data
node_visitor -->|"practices"| node_hifdh
node_hifdh -->|"uses recognition"| node_asr_hook
node_asr_hook -.->|"delegates to"| node_asr_runtime
node_visitor -->|"checks prayer"| node_prayer
node_visitor -->|"joins reading"| node_halaqa_ui
node_halaqa_api -->|"queries"| node_database
node_halaqa_api -->|"uses group logic"| node_halaqa_service
node_visitor -->|"discovers recitations"| node_qari_feed
node_qari_api -->|"queries and saves"| node_database
node_qari_api -->|"stores media"| node_qari_storage
node_visitor -->|"configures app"| node_settings
node_settings -->|"updates preferences"| node_settings_store
node_home -->|"checks session"| node_auth

click node_reader "https://github.com/user-zak/furqan/blob/main/app/read/page.tsx"
click node_quran_view "https://github.com/user-zak/furqan/blob/main/components/QuranPageView.tsx"
click node_mushaf_engine "https://github.com/user-zak/furqan/blob/main/lib/mushaf-engine/build-page-lines.ts"
click node_quran_data "https://github.com/user-zak/furqan/blob/main/lib/quran.ts"
click node_ayah_api "https://github.com/user-zak/furqan/blob/main/app/api/ayah/route.ts"
click node_translation_data "https://github.com/user-zak/furqan/blob/main/lib/translations.ts"
click node_reader_audio "https://github.com/user-zak/furqan/blob/main/hooks/usePageRecitation.ts"
click node_hifdh "https://github.com/user-zak/furqan/blob/main/app/hifdh/random/page.tsx"
click node_asr_hook "https://github.com/user-zak/furqan/blob/main/hooks/useQuranAsr.ts"
click node_asr_runtime "https://github.com/user-zak/furqan/blob/main/lib/asr/offline-recognizer.ts"
click node_prayer "https://github.com/user-zak/furqan/blob/main/app/prayer/page.tsx"
click node_halaqa_ui "https://github.com/user-zak/furqan/blob/main/components/halaqa/HalaqaScreen.tsx"
click node_halaqa_api "https://github.com/user-zak/furqan/blob/main/app/api/halaqa/%5Bid%5D/route.ts"
click node_halaqa_service "https://github.com/user-zak/furqan/blob/main/lib/halaqa-server.ts"
click node_qari_feed "https://github.com/user-zak/furqan/blob/main/app/qari/page.tsx"
click node_qari_api "https://github.com/user-zak/furqan/blob/main/app/api/qari/route.ts"
click node_qari_storage "https://github.com/user-zak/furqan/blob/main/lib/qari-storage.ts"
click node_home "https://github.com/user-zak/furqan/blob/main/app/page.tsx"
click node_settings "https://github.com/user-zak/furqan/blob/main/app/settings/page.tsx"
click node_settings_store "https://github.com/user-zak/furqan/blob/main/lib/app-settings.ts"
click node_auth "https://github.com/user-zak/furqan/blob/main/lib/auth.ts"
click node_database "https://github.com/user-zak/furqan/blob/main/lib/prisma.ts"

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_reader,node_quran_view,node_mushaf_engine,node_quran_data,node_ayah_api,node_translation_data,node_reader_audio,node_visitor toneBlue
class node_hifdh,node_asr_hook,node_asr_runtime,node_prayer toneAmber
class node_halaqa_ui,node_halaqa_api,node_halaqa_service toneMint
class node_qari_feed,node_qari_api,node_qari_storage toneRose
class node_home,node_settings,node_settings_store,node_auth,node_database toneIndigo
```

## Components

### Quran reading

- [Mushaf reader](https://github.com/user-zak/furqan/blob/main/app/read/page.tsx): `app/read/page.tsx`
- [Quran page view](https://github.com/user-zak/furqan/blob/main/components/QuranPageView.tsx): `components/QuranPageView.tsx`
- [Mushaf layout](https://github.com/user-zak/furqan/blob/main/lib/mushaf-engine/build-page-lines.ts): `lib/mushaf-engine/build-page-lines.ts`
- [Quran data](https://github.com/user-zak/furqan/blob/main/lib/quran.ts): `lib/quran.ts`
- [Ayah API](https://github.com/user-zak/furqan/blob/main/app/api/ayah/route.ts): `app/api/ayah/route.ts`
- [Translations](https://github.com/user-zak/furqan/blob/main/lib/translations.ts): `lib/translations.ts`
- [Page recitation](https://github.com/user-zak/furqan/blob/main/hooks/usePageRecitation.ts): `hooks/usePageRecitation.ts`

### Practice and worship

- [Memorization practice](https://github.com/user-zak/furqan/blob/main/app/hifdh/random/page.tsx): `app/hifdh/random/page.tsx`
- [Recitation recognition](https://github.com/user-zak/furqan/blob/main/hooks/useQuranAsr.ts): `hooks/useQuranAsr.ts`
- [Offline recognizer](https://github.com/user-zak/furqan/blob/main/lib/asr/offline-recognizer.ts): `lib/asr/offline-recognizer.ts`
- [Prayer and qibla](https://github.com/user-zak/furqan/blob/main/app/prayer/page.tsx): `app/prayer/page.tsx`

### Reading community

- [Group reading](https://github.com/user-zak/furqan/blob/main/components/halaqa/HalaqaScreen.tsx): `components/halaqa/HalaqaScreen.tsx`
- [Group API](https://github.com/user-zak/furqan/blob/main/app/api/halaqa/%5Bid%5D/route.ts): `app/api/halaqa/[id]/route.ts`
- [Group operations](https://github.com/user-zak/furqan/blob/main/lib/halaqa-server.ts): `lib/halaqa-server.ts`

### Recitation community

- [Recitation discovery](https://github.com/user-zak/furqan/blob/main/app/qari/page.tsx): `app/qari/page.tsx`
- [Recitation API](https://github.com/user-zak/furqan/blob/main/app/api/qari/route.ts): `app/api/qari/route.ts`
- [Audio and image storage](https://github.com/user-zak/furqan/blob/main/lib/qari-storage.ts): `lib/qari-storage.ts`

### Shared platform

- [Home screen](https://github.com/user-zak/furqan/blob/main/app/page.tsx): `app/page.tsx`
- [App settings](https://github.com/user-zak/furqan/blob/main/app/settings/page.tsx): `app/settings/page.tsx`
- [Settings persistence](https://github.com/user-zak/furqan/blob/main/lib/app-settings.ts): `lib/app-settings.ts`
- [Authentication](https://github.com/user-zak/furqan/blob/main/lib/auth.ts): `lib/auth.ts`
- [Application database](https://github.com/user-zak/furqan/blob/main/lib/prisma.ts): `lib/prisma.ts`

### Other components

- **App user**

## Connections

- App user → Home screen: opens (evidence: `app/page.tsx`)
- Home screen → Mushaf reader: navigates to
- Mushaf reader → Quran page view: renders (evidence: `app/read/page.tsx`)
- Mushaf reader → Quran data: loads pages (evidence: `app/read/page.tsx`)
- Mushaf reader → Page recitation: controls playback (evidence: `app/read/page.tsx`)
- Quran page view → Mushaf layout: uses layout
- App user → Ayah API: requests verses (evidence: `app/api/ayah/route.ts`)
- Ayah API → Quran data: reads Quran data (evidence: `app/api/ayah/route.ts`)
- Ayah API → Translations: checks editions (evidence: `app/api/ayah/route.ts`)
- App user → Memorization practice: practices (evidence: `app/hifdh/random/page.tsx`)
- Memorization practice → Recitation recognition: uses recognition (evidence: `app/hifdh/random/page.tsx`)
- Recitation recognition → Offline recognizer: delegates to
- App user → Prayer and qibla: checks prayer (evidence: `app/prayer/page.tsx`)
- App user → Group reading: joins reading
- Group API → Application database: queries (evidence: `app/api/halaqa/[id]/route.ts`)
- Group API → Group operations: uses group logic (evidence: `app/api/halaqa/[id]/route.ts`)
- App user → Recitation discovery: discovers recitations (evidence: `app/qari/page.tsx`)
- Recitation API → Application database: queries and saves (evidence: `app/api/qari/route.ts`)
- Recitation API → Audio and image storage: stores media (evidence: `app/api/qari/route.ts`)
- App user → App settings: configures app (evidence: `app/settings/page.tsx`)
- App settings → Settings persistence: updates preferences (evidence: `app/settings/page.tsx`)
- Home screen → Authentication: checks session (evidence: `app/page.tsx`)
