Quran Data Foundation v4
========================

Goal
----
Import the complete Quran text through an auditable, repeatable pipeline.

Files
-----
sql/data_foundation_v4.sql
app/services/QuranTextImporter.php
admin/quran_import.php
admin/quran_validate.php
sample_quran_import.txt

Important
---------
Take a database backup before installation.

Installation
------------
1. Run sql/data_foundation_v4.sql in the Quran database.

2. Upload:
   app/services/QuranTextImporter.php
   admin/quran_import.php
   admin/quran_validate.php

3. Create and protect:
   uploads/quran/

   Recommended permissions:
   directory 0750

4. Protect the /admin path using cPanel Directory Privacy or your own authentication.
   Do not leave the importer publicly accessible.

5. Open:
   /Quran/admin/quran_import.php

Input format
------------
One UTF-8 record per line:

surah|ayah|uthmani_text|simple_text|global_number|page|juz|hizb|sajdah_type

Required:
- surah
- ayah
- uthmani_text

Optional:
- simple_text
- global_number
- page
- juz
- hizb
- sajdah_type

Validation
----------
Open:
 /Quran/admin/quran_validate.php

Expected with the common Kufan numbering:
- 114 surahs
- 6236 ayahs
- no empty Uthmani text
- no duplicate Surah_ID + Ayah_Number pairs

Note about rerunning the SQL
----------------------------
MySQL does not support ADD COLUMN IF NOT EXISTS in your environment.
Run the migration once. If a column or index already exists, skip that statement manually.
