# akg418/quraan architecture

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

- Interactive diagram: https://gitdiagram.com/akg418/quraan
- Repository: https://github.com/akg418/quraan

## Overview

قرآني is a Quran reader for the web and Android. Readers navigate printed mushaf pages, then use search, tafsir and meanings, recitation, or memorization tools; the frontend requests Quran and study data from a Go API. The API also serves offline inside the Android app. Browser-local stores keep reader settings and personal study data. The README documents major capabilities and API roles; sampled frontend excerpts show page loading, search requests, and app routing, but most backend route-to-search calls and several UI implementations were not sampled, so those links rely on README evidence.

Main entry points: [`frontend/src/components/MushafPage.tsx`](https://github.com/akg418/quraan/blob/main/frontend/src/components/MushafPage.tsx) (Page rendering), [`backend/app/app.go`](https://github.com/akg418/quraan/blob/main/backend/app/app.go) (Go API routes), [`frontend/src/App.tsx`](https://github.com/akg418/quraan/blob/main/frontend/src/App.tsx) (Quran reader), [`frontend/src/components/Book.tsx`](https://github.com/akg418/quraan/blob/main/frontend/src/components/Book.tsx) (Book navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reader["Reading experience"]
  node_reader["Quran reader<br/>[App.tsx]"]
  node_page_view["Page rendering<br/>[MushafPage.tsx]"]
  node_book_view["Book navigation<br/>[Book.tsx]"]
  node_scroll_view["Scroll reading<br/>[ScrollView.tsx]"]
  node_page_data["Page data client<br/>[api.ts]"]
end

subgraph group_study["Study tools"]
  node_search_ui["Quran search<br/>[Search.tsx]"]
  node_find_ui["Page find<br/>[FindBar.tsx]"]
  node_tafsir_ui["Tafsir panel<br/>[TafsirPanel.tsx]"]
  node_meaning_state["Meanings and tafsir state<br/>[meanings.ts]"]
  node_similar_ui["Similar verses<br/>[Similar.tsx]"]
  node_hifz_ui["Memorization drills<br/>[Hifz.tsx]"]
  node_recite_ui["Next-verse drill<br/>[Recite.tsx]"]
  node_player_state["Recitation queue<br/>[player.ts]"]
end

subgraph group_server["API and search"]
  node_api_handler["Go API routes<br/>[app.go]"]
  node_search_index[("Search index<br/>[index.go]")]
  node_search_query["Search and counts<br/>[query.go]"]
  node_similar_engine["Verse similarity engine<br/>[similar.go]"]
end

subgraph group_state["Local state and offline"]
  node_hifz_state["Memorization schedule<br/>[hifz.ts]"]
  node_marks_state["Bookmarks and highlights<br/>[marks.ts]"]
  node_notes_state["Reader notes<br/>[notes.ts]"]
  node_settings_state["Reader settings<br/>[settings.ts]"]
end

subgraph group_platform["App platform"]
  node_offline_state["Offline content<br/>[offline.ts]"]
  node_downloads_ui["Offline downloads<br/>[Downloads.tsx]"]
  node_android_host["Android WebView<br/>[MainActivity.java]"]
end

node_user(("Reader"))
node_tafsir_service{{"Quran.com tafsir"}}
node_word_audio{{"Word audio CDN"}}
node_verse_audio{{"EveryAyah audio"}}

node_user -->|"uses"| node_reader
node_reader -->|"renders"| node_book_view
node_reader -->|"routes to"| node_search_ui
node_reader -->|"routes to"| node_hifz_ui
node_reader -->|"routes to"| node_downloads_ui
node_book_view -->|"renders"| node_page_view
node_book_view -->|"loads pages"| node_page_data
node_scroll_view -.->|"renders"| node_page_view
node_search_ui -->|"requests search"| node_api_handler
node_find_ui -->|"requests find"| node_api_handler
node_api_handler -->|"dispatches queries"| node_search_query
node_search_query -->|"queries index"| node_search_index
node_api_handler -->|"serves similarity"| node_similar_engine
node_tafsir_ui -->|"reads content"| node_meaning_state
node_meaning_state -->|"requests asbab"| node_api_handler
node_meaning_state -->|"fetches tafsir"| node_tafsir_service
node_similar_ui -->|"requests verses"| node_api_handler
node_hifz_ui -->|"uses schedule"| node_hifz_state
node_recite_ui -->|"requests verses"| node_api_handler
node_page_view -->|"reads marks"| node_marks_state
node_page_view -->|"reads notes"| node_notes_state
node_page_view -->|"reads drill state"| node_hifz_state
node_page_view -->|"reads playback"| node_player_state
node_page_view -->|"reads settings"| node_settings_state
node_player_state -->|"streams verses"| node_verse_audio
node_downloads_ui -->|"manages downloads"| node_offline_state
node_android_host -->|"hosts offline API"| node_api_handler
node_android_host -.->|"hosts WebView"| node_downloads_ui
node_page_view -.->|"plays word audio"| node_word_audio

click node_reader "https://github.com/akg418/quraan/blob/main/frontend/src/App.tsx"
click node_page_view "https://github.com/akg418/quraan/blob/main/frontend/src/components/MushafPage.tsx"
click node_book_view "https://github.com/akg418/quraan/blob/main/frontend/src/components/Book.tsx"
click node_scroll_view "https://github.com/akg418/quraan/blob/main/frontend/src/components/ScrollView.tsx"
click node_page_data "https://github.com/akg418/quraan/blob/main/frontend/src/api.ts"
click node_search_ui "https://github.com/akg418/quraan/blob/main/frontend/src/components/Search.tsx"
click node_find_ui "https://github.com/akg418/quraan/blob/main/frontend/src/components/FindBar.tsx"
click node_tafsir_ui "https://github.com/akg418/quraan/blob/main/frontend/src/components/TafsirPanel.tsx"
click node_meaning_state "https://github.com/akg418/quraan/blob/main/frontend/src/meanings.ts"
click node_similar_ui "https://github.com/akg418/quraan/blob/main/frontend/src/components/Similar.tsx"
click node_hifz_ui "https://github.com/akg418/quraan/blob/main/frontend/src/components/Hifz.tsx"
click node_recite_ui "https://github.com/akg418/quraan/blob/main/frontend/src/components/Recite.tsx"
click node_hifz_state "https://github.com/akg418/quraan/blob/main/frontend/src/hifz.ts"
click node_marks_state "https://github.com/akg418/quraan/blob/main/frontend/src/marks.ts"
click node_notes_state "https://github.com/akg418/quraan/blob/main/frontend/src/notes.ts"
click node_settings_state "https://github.com/akg418/quraan/blob/main/frontend/src/settings.ts"
click node_player_state "https://github.com/akg418/quraan/blob/main/frontend/src/player.ts"
click node_offline_state "https://github.com/akg418/quraan/blob/main/frontend/src/offline.ts"
click node_downloads_ui "https://github.com/akg418/quraan/blob/main/frontend/src/components/Downloads.tsx"
click node_android_host "https://github.com/akg418/quraan/blob/main/android/app/src/main/java/app/quraan/MainActivity.java"
click node_api_handler "https://github.com/akg418/quraan/blob/main/backend/app/app.go"
click node_search_index "https://github.com/akg418/quraan/blob/main/backend/search/index.go"
click node_search_query "https://github.com/akg418/quraan/blob/main/backend/search/query.go"
click node_similar_engine "https://github.com/akg418/quraan/blob/main/backend/search/similar.go"

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_page_view,node_book_view,node_scroll_view,node_page_data toneBlue
class node_search_ui,node_find_ui,node_tafsir_ui,node_meaning_state,node_similar_ui,node_hifz_ui,node_recite_ui,node_player_state toneAmber
class node_api_handler,node_search_index,node_search_query,node_similar_engine toneMint
class node_hifz_state,node_marks_state,node_notes_state,node_settings_state toneRose
class node_offline_state,node_downloads_ui,node_android_host,node_user,node_tafsir_service,node_word_audio,node_verse_audio toneIndigo
```

## Components

### Reading experience

- [Quran reader](https://github.com/akg418/quraan/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Page rendering](https://github.com/akg418/quraan/blob/main/frontend/src/components/MushafPage.tsx): `frontend/src/components/MushafPage.tsx`
- [Book navigation](https://github.com/akg418/quraan/blob/main/frontend/src/components/Book.tsx): `frontend/src/components/Book.tsx`
- [Scroll reading](https://github.com/akg418/quraan/blob/main/frontend/src/components/ScrollView.tsx): `frontend/src/components/ScrollView.tsx`
- [Page data client](https://github.com/akg418/quraan/blob/main/frontend/src/api.ts): `frontend/src/api.ts`

### Study tools

- [Quran search](https://github.com/akg418/quraan/blob/main/frontend/src/components/Search.tsx): `frontend/src/components/Search.tsx`
- [Page find](https://github.com/akg418/quraan/blob/main/frontend/src/components/FindBar.tsx): `frontend/src/components/FindBar.tsx`
- [Tafsir panel](https://github.com/akg418/quraan/blob/main/frontend/src/components/TafsirPanel.tsx): `frontend/src/components/TafsirPanel.tsx`
- [Meanings and tafsir state](https://github.com/akg418/quraan/blob/main/frontend/src/meanings.ts): `frontend/src/meanings.ts`
- [Similar verses](https://github.com/akg418/quraan/blob/main/frontend/src/components/Similar.tsx): `frontend/src/components/Similar.tsx`
- [Memorization drills](https://github.com/akg418/quraan/blob/main/frontend/src/components/Hifz.tsx): `frontend/src/components/Hifz.tsx`
- [Next-verse drill](https://github.com/akg418/quraan/blob/main/frontend/src/components/Recite.tsx): `frontend/src/components/Recite.tsx`
- [Recitation queue](https://github.com/akg418/quraan/blob/main/frontend/src/player.ts): `frontend/src/player.ts`

### API and search

- [Go API routes](https://github.com/akg418/quraan/blob/main/backend/app/app.go): `backend/app/app.go`
- [Search index](https://github.com/akg418/quraan/blob/main/backend/search/index.go): `backend/search/index.go`
- [Search and counts](https://github.com/akg418/quraan/blob/main/backend/search/query.go): `backend/search/query.go`
- [Verse similarity engine](https://github.com/akg418/quraan/blob/main/backend/search/similar.go): `backend/search/similar.go`

### Local state and offline

- [Memorization schedule](https://github.com/akg418/quraan/blob/main/frontend/src/hifz.ts): `frontend/src/hifz.ts`
- [Bookmarks and highlights](https://github.com/akg418/quraan/blob/main/frontend/src/marks.ts): `frontend/src/marks.ts`
- [Reader notes](https://github.com/akg418/quraan/blob/main/frontend/src/notes.ts): `frontend/src/notes.ts`
- [Reader settings](https://github.com/akg418/quraan/blob/main/frontend/src/settings.ts): `frontend/src/settings.ts`

### App platform

- [Offline content](https://github.com/akg418/quraan/blob/main/frontend/src/offline.ts): `frontend/src/offline.ts`
- [Offline downloads](https://github.com/akg418/quraan/blob/main/frontend/src/components/Downloads.tsx): `frontend/src/components/Downloads.tsx`
- [Android WebView](https://github.com/akg418/quraan/blob/main/android/app/src/main/java/app/quraan/MainActivity.java): `android/app/src/main/java/app/quraan/MainActivity.java`

### Other components

- **Reader**
- **Quran.com tafsir**
- **Word audio CDN**
- **EveryAyah audio**

## Connections

- Reader → Quran reader: uses
- Quran reader → Book navigation: renders (evidence: `frontend/src/App.tsx`)
- Quran reader → Quran search: routes to (evidence: `frontend/src/App.tsx`)
- Quran reader → Memorization drills: routes to (evidence: `frontend/src/App.tsx`)
- Quran reader → Offline downloads: routes to (evidence: `frontend/src/App.tsx`)
- Book navigation → Page rendering: renders (evidence: `frontend/src/components/Book.tsx`)
- Book navigation → Page data client: loads pages (evidence: `frontend/src/components/Book.tsx`)
- Scroll reading → Page rendering: renders
- Quran search → Go API routes: requests search (evidence: `frontend/src/components/Search.tsx`)
- Page find → Go API routes: requests find
- Go API routes → Search and counts: dispatches queries
- Search and counts → Search index: queries index
- Go API routes → Verse similarity engine: serves similarity
- Tafsir panel → Meanings and tafsir state: reads content (evidence: `frontend/src/components/TafsirPanel.tsx`)
- Meanings and tafsir state → Go API routes: requests asbab (evidence: `frontend/src/meanings.ts`)
- Meanings and tafsir state → Quran.com tafsir: fetches tafsir
- Similar verses → Go API routes: requests verses
- Memorization drills → Memorization schedule: uses schedule (evidence: `frontend/src/components/Hifz.tsx`)
- Next-verse drill → Go API routes: requests verses
- Page rendering → Bookmarks and highlights: reads marks (evidence: `frontend/src/components/MushafPage.tsx`)
- Page rendering → Reader notes: reads notes (evidence: `frontend/src/components/MushafPage.tsx`)
- Page rendering → Memorization schedule: reads drill state (evidence: `frontend/src/components/MushafPage.tsx`)
- Page rendering → Recitation queue: reads playback (evidence: `frontend/src/components/MushafPage.tsx`)
- Page rendering → Reader settings: reads settings (evidence: `frontend/src/components/MushafPage.tsx`)
- Recitation queue → EveryAyah audio: streams verses
- Offline downloads → Offline content: manages downloads (evidence: `frontend/src/components/Downloads.tsx`)
- Android WebView → Go API routes: hosts offline API
- Android WebView → Offline downloads: hosts WebView
- Page rendering → Word audio CDN: plays word audio
