Etha3a-API is an enterprise-grade, high-performance API built with Node.js, Fastify, and TypeScript. It is specifically designed to provide seamless and reliable broadcasting of the Holy Quran and Islamic supplications.
Engineered for maximum uptime and resilience, the service features an intelligent automatic fallback mechanism. This system dynamically cycles through multiple pre-configured data sources to ensure an uninterrupted listening experience, mitigating the impact of third-party server downtimes. By providing a clean, unified, and type-safe data interface, Etha3a-API empowers developers to effortlessly integrate diverse spiritual content into web, mobile, and desktop applications, serving as a robust backbone for modern Islamic digital platforms.
- High Performance: Built on top of
Fastify, ensuring minimal overhead and maximum throughput for API requests. - Intelligent Fallback Mechanism: Automatically detects source failures and switches to alternative data streams without interrupting the client.
- Type-Safe Architecture: Developed entirely in
TypeScript, ensuring high code quality, predictability, and excellent developer experience. - Modular Design: Organized using a feature-based modular structure, making it highly scalable and easy to maintain.
- Container Ready: Includes a highly optimized
DOCKERFILEfor consistent deployment across different environments. - Monorepo Support: Configured with
pnpm-workspacefor scalable workspace management.
- Runtime: Node.js (v18+ Recommended)
- Language: TypeScript
- Framework: Fastify (^5.7.4)
- Environment Management: dotenv (^17.3.1)
- Package Manager: pnpm
Ensure you have the following installed on your local machine:
- Node.js (Version 18.x or higher)
- pnpm (Version 8.x or higher)
- Docker (Optional, for containerized environments)
-
Clone the repository:
git clone https://github.com/RlxChap2/Etha3a-API.git cd Etha3a-API -
Install dependencies:
pnpm install
-
Environment Configuration: Create a
.envfile in the root directory and configure your environment variables based on standard requirements. -
Code Formatting & Linting (Crucial Step): Before running or building the project, ensure your code adheres to our formatting standards.
pnpm run lint
-
Development Mode: Starts the server with hot-reloading enabled.
pnpm run dev
-
Production Build & Start:
pnpm run build pnpm run start
For a consistent and isolated environment, Etha3a-API is fully equipped to run via Docker. This is the recommended approach for production deployments.
-
Build the Docker Image:
docker build -t etha3a-api . -
Run the Container: Replace
3000with your configured port if different.docker run -p 3000:3000 --env-file .env etha3a-api
We welcome collaborations and contributions! To ensure the highest security and code quality standards, direct pushes to the main branch are strictly prohibited.
All contributions must go through a Pull Request (PR). We have automated CI/CD Security Workflows (Continuous Integration) in place. When you submit a PR, our automated systems will scan your code for security vulnerabilities, run automated tests, and enforce formatting rules (pnpm run lint).
Contribution Steps:
- Fork the repository and clone it locally.
- Create a feature branch:
git checkout -b feature/your-feature-name. - Lint your code:
pnpm run lint(Your PR will fail the CI pipeline if formatting is incorrect). - Commit your changes:
git commit -m 'feat: add specific feature'. - Push to your branch:
git push origin feature/your-feature-name. - Open a Pull Request against the
mainbranch and await review from the maintainers.
This software is released under the MIT License.
Etha3a-API هي واجهة برمجة تطبيقات (API) بمستوى الشركات، تتميز بالأداء العالي والموثوقية، مبنية باستخدام Node.js و Fastify و TypeScript. تم تصميمها خصيصاً لتوفير بث سلس ومستمر للقرآن الكريم والأدعية الإسلامية.
تمت هندسة هذا النظام لضمان أعلى مستويات الاستقرار، حيث يتميز بـ آلية استرجاع ذكية (Fallback Mechanism). تقوم هذه الآلية بالتنقل التلقائي بين عدة مصادر بيانات معدة مسبقاً في حال تعطل أحدها، مما يضمن تجربة استماع غير منقطعة للمستخدم النهائي. من خلال توفير واجهة بيانات موحدة وآمنة، يُمكّن النظام المطورين من دمج المحتوى الإسلامي بسهولة في تطبيقات الويب والهواتف الذكية، ليكون بمثابة العمود الفقري الرقمي للمنصات الإسلامية الحديثة.
- أداء فائق: مبني على إطار عمل
Fastifyلضمان سرعة الاستجابة والتعامل مع عدد هائل من الطلبات بأقل استهلاك للموارد. - آلية استرجاع ذكية: اكتشاف تلقائي لأعطال الخوادم المصدرية والانتقال الفوري إلى خوادم بديلة دون انقطاع البث عن العميل.
- بنية آمنة النوع (Type-Safe): مطور بالكامل باستخدام
TypeScript، مما يقلل من الأخطاء البرمجية ويسهل عملية التطوير والصيانة. - تصميم تركيبي (Modular): مقسم إلى وحدات مستقلة بناءً على الميزات، مما يجعله قابلاً للتوسع بسهولة.
- جاهز للحاويات (Container Ready): يتضمن ملف
DOCKERFILEمحسن لتسهيل النشر في مختلف بيئات الاستضافة السحابية. - دعم بيئات العمل المتعددة: مُهيأ باستخدام
pnpm-workspaceلإدارة المشاريع الضخمة.
- بيئة التشغيل: Node.js (يُنصح بالإصدار 18 فما فوق)
- لغة البرمجة: TypeScript
- إطار العمل: Fastify (^5.7.4)
- إدارة البيئة: dotenv (^17.3.1)
- مدير الحزم: pnpm
تأكد من تثبيت البرامج التالية على جهازك:
-
نسخ المستودع (Clone):
git clone https://github.com/RlxChap2/Etha3a-API.git cd Etha3a-API -
تثبيت الحزم (Dependencies):
pnpm install
-
إعداد المتغيرات البيئية: قم بإنشاء ملف
.envفي المجلد الجذري، وقم بضبط المتغيرات المطلوبة. -
فحص وتنسيق الكود (خطوة الزامية): قبل تشغيل أو بناء المشروع، يجب التأكد من توافق الكود مع معايير الجودة والتنسيق الخاصة بنا.
pnpm run lint
-
التشغيل في بيئة التطوير: يبدأ تشغيل الخادم مع تفعيل ميزة التحديث التلقائي عند الحفظ.
pnpm run dev
-
البناء والتشغيل لبيئة الإنتاج:
pnpm run build pnpm run start
لضمان بيئة تشغيل معزولة ومستقرة، يدعم المشروع التشغيل بالكامل عبر Docker. وهي الطريقة الموصى بها لعمليات النشر (Deployment).
-
بناء صورة الحاوية (Build Image):
docker build -t etha3a-api . -
تشغيل الحاوية (Run Container): مع التأكد من تمرير ملف المتغيرات البيئية وتحديد المنفذ الصحيح.
docker run -p 3000:3000 --env-file .env etha3a-api
نحن نرحب بكافة الشراكات والمساهمات البرمجية! ومع ذلك، ولضمان أعلى معايير الأمان وجودة الكود، يُمنع الدفع المباشر (Direct Push) للفرع الرئيسي.
يجب أن تتم أي مساهمة حصرياً عبر فتح طلب سحب (Pull Request).
لقد قمنا بتأسيس مسارات عمل أمنية مؤتمتة (CI/CD Security Workflows). عند تقديمك لطلب سحب (PR)، ستقوم خوادمنا تلقائياً بفحص الكود بحثاً عن أي ثغرات أمنية، والتأكد من توافقه مع معايير التنسيق الصارمة (لن يتم قبول الـ PR إذا لم تقم بتشغيل pnpm run lint).
خطوات المساهمة:
- قم بعمل Fork للمستودع ونسخه محلياً.
- قم بإنشاء فرع (Branch) للميزة الجديدة:
git checkout -b feature/your-feature. - نسّق الكود الخاص بك:
pnpm run lint(لتجنب رفض التعديل من قبل النظام المؤتمت). - قم بتأكيد التغييرات (Commit):
git commit -m 'feat: add specific feature'. - قم برفع التغييرات (Push) إلى فرعك الخاص:
git push origin feature/your-feature. - افتح طلب سحب (Pull Request) وانتظر مراجعة الفريق الهندسي.
هذا المشروع مرخص بموجب رخصة MIT.