Tutorial 10: Ayah Topics End-to-End

This tutorial is for users who want to browse Quran content by topics and concept groups.

1) What This Resource Is

Ayah Topics resources map topics/concepts to related ayahs and often include topic taxonomy details.

Typical content includes:

  • Topic entities (name, category, description)
  • Topic-to-ayah mappings
  • Topic counts and searchable labels

Primary category:

2) When to Use It

Use ayah-topics data when building:

  • Topic-first discovery experiences
  • Educational thematic study flows
  • Search interfaces by concept/theme

3) How to Get Your First Example Resource

  1. Open https://qul.tarteel.ai/resources/ayah-topics.
  2. Keep default listing order and open the first published card.
  3. Confirm page sections include:
    • Topics listing/search area
    • Help tab
  4. Confirm available download formats (commonly sqlite on this resource type).

This keeps onboarding concrete without hardcoded IDs.

4) What the Preview Shows (Website-Aligned)

On ayah-topics detail pages:

  • Topics pane:
    • Search input for topic names/metadata
    • Topic list with ayah counts
    • Topic detail navigation
  • Help tab:
    • Explains topic families and usage
    • Documents mapping behavior between topics and ayahs

Practical meaning:

  • Topic rows and topic-ayah mapping rows should be treated as separate layers.
  • Build topic indexes first, then resolve ayah lists for display.

5) Download and Use (Step-by-Step)

  1. Download the package (commonly sqlite).
  2. Import topic tables and mapping tables.
  3. Normalize topic IDs and ayah keys.
  4. Build searchable topic index.
  5. On topic selection, fetch mapped ayah keys and join with script/translation.

Starter integration snippet (JavaScript):

JavaScript
const buildTopicIndex = (topics) =>
  topics.reduce((index, topic) => {
    index[topic.topic_id] = topic;
    return index;
  }, {});

const ayahKeysForTopic = (topicAyahMappings, topicId) =>
  topicAyahMappings
    .filter((row) => row.topic_id === topicId)
    .map((row) => row.ayah_key);

6) Real-World Example: Browse by Topic

Goal:

  • User picks a topic and sees related ayahs.

Inputs:

  • Ayah Topics package
  • Quran Script package

Processing:

  1. User searches/selects topic.
  2. App loads mapped ayah keys.
  3. App resolves ayah text and displays results.

Expected output:

  • Topic-driven ayah browsing works with stable mapping.

Interactive preview (temporary sandbox):

You can edit this code for testing. Edits are not saved and may not persist after refresh.

JavaScript Playground
Editor
Preview

7) Common Mistakes to Avoid

  • Mixing topic metadata and topic-ayah mapping tables.
  • Assuming topic IDs are globally stable across different resources.
  • Rendering topic results without pagination for large topic sets.

8) When to Request Updates or Changes

Open an issue if you find:

  • Broken topic-to-ayah mappings
  • Missing topic labels/descriptions
  • Broken download links

Issue tracker:

Related Docs