# recite-quran/natlu architecture

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

- Interactive diagram: https://gitdiagram.com/recite-quran/natlu
- Repository: https://github.com/recite-quran/natlu

## Overview

Natlu is a Flutter Quran recitation and study application. The documented core workflow is recitation through an on-device ASR and acoustic Tajweed pipeline, with feedback displayed on a vector Mushaf; users can also join Maglis study circles. The supplied tree omits the Dart application and package sources, so those documented subsystems have null paths. Relationships among them follow the README; sampled native, web, and relay files support only the implementation links shown.

Main entry points: [`web/js/sherpa_official_app.js`](https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/web/js/sherpa_official_app.js) (Web recitation app), [`android/app/src/main/kotlin/com/recitequran/app/MainActivity.kt`](https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/android/app/src/main/kotlin/com/recitequran/app/MainActivity.kt) (Flutter app), [`android/app/src/main/kotlin/com/recitequran/app/MaglisCallService.kt`](https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/android/app/src/main/kotlin/com/recitequran/app/MaglisCallService.kt) (Android call service), [`packages/qvp_flutter/ios/qvp_flutter/Sources/qvp_flutter/qvp_flutter.c`](https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/packages/qvp_flutter/ios/qvp_flutter/Sources/qvp_flutter/qvp_flutter.c) (Native vector engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Recitation App"]
  node_flutter_app["Flutter app<br/>[MainActivity.kt]"]
  node_mushaf_ui["Mushaf interface"]
  node_feedback["Recitation feedback"]
end

subgraph group_quran["Quran Engine"]
  node_asr["Speech recognition"]
  node_audio["Audio processing"]
  node_alignment["Phoneme alignment"]
  node_tajweed["Tajweed analysis"]
  node_quran_data["Quran search"]
  node_qvp_flutter["Native vector engine<br/>[qvp_flutter.c]"]
end

subgraph group_maglis["Maglis Circles"]
  node_maglis_engine["P2P study engine"]
  node_relay["Relay signaling<br/>[index.js]"]
end

subgraph group_platform["Platform Integrations"]
  node_call_service["Android call service"]
end

subgraph group_web["Web Runtime"]
  node_web_asr["Web speech engine<br/>[sherpa-onnx-asr.js]"]
  node_web_mushaf["Web vector Mushaf<br/>[qvp.js]"]
  node_model_download["Model delivery<br/>[download-model.js]"]
  node_web_app["Web recitation app"]
  node_qvp_api["QVP API route<br/>[qvp.js]"]
end

node_reader(("Quran reader"))
node_web_user(("Web user"))

node_reader -->|"opens"| node_flutter_app
node_flutter_app -.->|"runs recognition"| node_asr
node_asr -.->|"processes audio"| node_audio
node_audio -.->|"supplies audio"| node_alignment
node_alignment -.->|"checks phonemes"| node_tajweed
node_tajweed -.->|"reports findings"| node_feedback
node_feedback -.->|"highlights words"| node_mushaf_ui
node_mushaf_ui -.->|"renders pages"| node_qvp_flutter
node_asr -.->|"searches text"| node_quran_data
node_reader -.->|"uses web app"| node_web_user
node_web_user -->|"recites"| node_web_app
node_web_app -.->|"runs recognition"| node_web_asr
node_web_app -.->|"renders pages"| node_web_mushaf
node_web_app -.->|"downloads model"| node_model_download
node_web_app -.->|"requests QVP"| node_qvp_api
node_reader -.->|"joins circle"| node_maglis_engine
node_maglis_engine -.->|"signals peers"| node_relay
node_maglis_engine -.->|"syncs Mushaf"| node_flutter_app
node_maglis_engine -.->|"supports voice call"| node_call_service
node_flutter_app -->|"handles service channel"| node_call_service

click node_flutter_app "https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/android/app/src/main/kotlin/com/recitequran/app/MainActivity.kt"
click node_qvp_flutter "https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/packages/qvp_flutter/ios/qvp_flutter/Sources/qvp_flutter/qvp_flutter.c"
click node_relay "https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/maglis_relay/src/index.js"
click node_call_service "https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/android/app/src/main/kotlin/com/recitequran/app/MaglisCallService.kt"
click node_web_asr "https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/web/js/sherpa-onnx-asr.js"
click node_web_mushaf "https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/web/js/qvp.js"
click node_model_download "https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/web/cloudflare/functions/download-model.js"
click node_web_app "https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/web/js/sherpa_official_app.js"
click node_qvp_api "https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/web/cloudflare/functions/api/qvp.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_flutter_app,node_mushaf_ui,node_feedback,node_web_user toneBlue
class node_asr,node_audio,node_alignment,node_tajweed,node_quran_data,node_qvp_flutter toneAmber
class node_maglis_engine,node_relay toneMint
class node_call_service toneRose
class node_web_asr,node_web_mushaf,node_model_download,node_web_app,node_qvp_api,node_reader toneIndigo
```

## Components

### Recitation App

- [Flutter app](https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/android/app/src/main/kotlin/com/recitequran/app/MainActivity.kt): `android/app/src/main/kotlin/com/recitequran/app/MainActivity.kt`
- **Mushaf interface**
- **Recitation feedback**

### Quran Engine

- **Speech recognition**
- **Audio processing**
- **Phoneme alignment**
- **Tajweed analysis**
- **Quran search**
- [Native vector engine](https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/packages/qvp_flutter/ios/qvp_flutter/Sources/qvp_flutter/qvp_flutter.c): `packages/qvp_flutter/ios/qvp_flutter/Sources/qvp_flutter/qvp_flutter.c`

### Maglis Circles

- **P2P study engine**
- [Relay signaling](https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/maglis_relay/src/index.js): `maglis_relay/src/index.js`

### Platform Integrations

- [Android call service](https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/android/app/src/main/kotlin/com/recitequran/app/MaglisCallService.kt): `android/app/src/main/kotlin/com/recitequran/app/MaglisCallService.kt`

### Web Runtime

- [Web speech engine](https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/web/js/sherpa-onnx-asr.js): `web/js/sherpa-onnx-asr.js`
- [Web vector Mushaf](https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/web/js/qvp.js): `web/js/qvp.js`
- [Model delivery](https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/web/cloudflare/functions/download-model.js): `web/cloudflare/functions/download-model.js`
- [Web recitation app](https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/web/js/sherpa_official_app.js): `web/js/sherpa_official_app.js`
- [QVP API route](https://github.com/recite-quran/natlu/blob/Natlu-%D8%A7%D9%84%D8%AD%D9%85%D8%AF%D9%84%D9%84%D9%87/web/cloudflare/functions/api/qvp.js): `web/cloudflare/functions/api/qvp.js`

### Other components

- **Quran reader**
- **Web user**

## Connections

- Quran reader → Flutter app: opens
- Flutter app → Speech recognition: runs recognition
- Speech recognition → Audio processing: processes audio
- Audio processing → Phoneme alignment: supplies audio
- Phoneme alignment → Tajweed analysis: checks phonemes
- Tajweed analysis → Recitation feedback: reports findings
- Recitation feedback → Mushaf interface: highlights words
- Mushaf interface → Native vector engine: renders pages
- Speech recognition → Quran search: searches text
- Quran reader → Web user: uses web app
- Web user → Web recitation app: recites
- Web recitation app → Web speech engine: runs recognition
- Web recitation app → Web vector Mushaf: renders pages
- Web recitation app → Model delivery: downloads model
- Web recitation app → QVP API route: requests QVP
- Quran reader → P2P study engine: joins circle
- P2P study engine → Relay signaling: signals peers
- P2P study engine → Flutter app: syncs Mushaf
- P2P study engine → Android call service: supports voice call
- Flutter app → Android call service: handles service channel (evidence: `android/app/src/main/kotlin/com/recitequran/app/MainActivity.kt`)
