# تثبيت المتطلباتpip install -r src/requirements.txt
# تحميل جميع الملفات (صوت + PDF)python src/downloader.py --mode full
# تحميل الصوت فقطpython src/downloader.py --mode audio
# تحميل PDF فقطpython src/downloader.py --mode pdf
# تحميل فيديوهات يوتيوبpython src/downloader.py --mode youtube
# التحقق من الملفاتpython src/downloader.py --mode verify
# الذهاب لمجلد APIcd api
# تثبيت التبعياتnpm install# تشغيل في وضع التطويرnpm run dev# اختبار APInpm test# تشغيل الإنتاجnpm start
# بناء الصورةdocker build -t albitaqat-api -f api/Dockerfile .
# تشغيل الحاويةdocker run -p 3000:3000 albitaqat-api
# أو عبر docker-composecd api
docker compose up -d --build
# عرض السجلاتdocker compose logs -f
# إيقافdocker compose down
# جميع السورcurl http://localhost:3000/api/surahs
# سورة محددةcurl http://localhost:3000/api/surahs/1
# بحث عن سورةcurl "http://localhost:3000/api/surahs/search?q=بقرة"
# روابط الصوتcurl http://localhost:3000/api/audio
# إحصائياتcurl http://localhost:3000/api/stats
lightbulbأمثلة الاستخدام
أمثلة الاستخدام
كيف تستخدم البيانات في مشاريعك
code
Python
import json
# قراءة بيانات السورwithopen('data/quran_cards_full.json') as f:
data = json.load(f)
# عرض جميع السورfor surah in data['surahs']:
print(f"{surah['number']} - {surah['name_arabic']}")
# البحث عن سورة
baqarah = next(
s for s in data['surahs']
if s['number'] == 2
)
print(baqarah['downloads']['audio']['url'])
javascript
Node.js
const fs = require('fs');
// قراءة بيانات السورconst data = JSON.parse(
fs.readFileSync('data/quran_cards_full.json')
);
// عرض جميع السور
data.surahs.forEach(surah => {
console.log(`${surah.number} - ${surah.name_arabic}`);
});
// جلب سورة عبر APIconst res = awaitfetch('http://localhost:3000/api/surahs/1');
const surah = await res.json();
console.log(surah.data.name_english);
terminal
cURL
# جلب جميع السورcurl http://localhost:3000/api/surahs
# جلب سورة الفاتحةcurl http://localhost:3000/api/surahs/1
# بحث عن سورةcurl"http://localhost:3000/api/surahs/search?q=رعد"# جلب روابط الصوتcurl http://localhost:3000/api/audio/1
# جلب فيديوهات يوتيوبcurl http://localhost:3000/api/youtube/1
# إحصائيات المشروعcurl http://localhost:3000/api/stats
language
JavaScript (Browser)
// جلب البيانات من APIconst response = awaitfetch(
'http://localhost:3000/api/surahs'
);
const { data } = await response.json();
// عرض السور في الصفحةconst list = document.getElementById('surahs');
data.forEach(surah => {
list.innerHTML += `
<div class="surah-card">
<h3>${surah.name_arabic}</h3>
<p>${surah.name_english}</p>
<a href="${surah.downloads.audio.url}">
استمع
</a>
</div>
`;
});