• Stars
    star
    227
  • Rank 175,400 (Top 4 %)
  • Language
    PHP
  • License
    GNU General Publi...
  • Created almost 7 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The AlQuran.Cloud API - https://alquran.cloud/api

بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيْمِ

CircleCI GitHub All Releases

AlQuran API - api.alquran.cloud

This repository powers the AlQuran.cloud API on http://api.alquran.cloud.

Technology Stack

Adding Qur'an Editions

Add a new Text Edition

  1. You will need a file with with 6236 lines for each ayah.
  2. Place the file in the edition-importer directory.
  3. Fill in the edition-importer/edition.yml file.
  4. From the edition importer directory, run php import.php.

Add a new Audio Edition

  1. Add entry in the edition table.
  2. The files then need to be uploaded to the Wasabi / s3 bucket with the folder name matching the edition name. https://github.com/islamic-network/cdn.alquran.cloud/blob/master/html/media/index.php#L37 needs to be updated with the appropriate information.
  3. https://github.com/islamic-network/api.alquran.cloud/blob/master/src/Quran/Helper/Meta.php#L98 needs to be updated.
  4. https://github.com/islamic-network/api.alquran.cloud/blob/master/cdn.txt needs to be updated.

Running the App

The api and all its dependencies are fully Dockerised. You just need docker and docker-compose to spin everything up.

A production ready Docker image of the api is published as:

  • islamicnetwork/api.alquran.cloud on Docker Hub

To get your own instance up, simply run:

composer install
docker-compose up

This will bring up several containers:

  1. api - This is the actual PHP / Apache instance. This runs on https://localhost - see https://localhost/v1/ayah/1.
  2. mysql - This is the Percona DB Container.
  3. memcached - This is the Memcached Container.

Build and Contribute

Please note that the Dockerfile included builds a production ready container which has opcache switched on and xdebug turned off, so you will only see your changes every 5 minutes if you are developing. To actively develop, change the FROM islamicnetwork/php:8.1-apache line to islamicnetwork/php:8.1-apache-dev.

With the above docker-compose up command your code is mapped to the quran-app docker container. You can make any changes and simply refresh the page to see them in real-time.

Scaling and Sizing

This app takes 18-19 MB per apache process / worker and is set to have a maximum of 15 Apache workers.

OpCache takes 100 MB RAM.

A single instance should be sized with a maximum of 400 MB RAM, after which you should scale it horizontally.

Contributing Code

You can contribute code by raising a pull request.

There's a backlog of stuff under issues for things that potentially need to be worked on, so please feel free to pick something up from there or contribute your own improvements.

You can also join the community at https://community.islamic.network/ or the Islamic Network Discord Server to discuss any of the apps or APIs @ https://discord.gg/FwUy69M.

More Repositories

1

alquran.cloud

Web App that powers https://alquran.cloud
HTML
315
star
2

api.aladhan.com

The AlAdhan API
PHP
122
star
3

alquran-tools

Various tools for Parsing Quran Tajweed, Buck, etc.
PHP
112
star
4

prayer-times

An Islamic Prayer Times Library written in PHP. It performs the core calculations for the AlAdhan API @ https://aladhan.com.
PHP
63
star
5

aladhan.com

The AlAdhan.com website and app
HTML
51
star
6

alquran-api-client-php

A PHP API Client for the AlQuran.cloud REST API
PHP
10
star
7

aladhan-api-client-php

PHP Client for Prayer Times using the AlAdhan.com API
PHP
10
star
8

api.alquran.cloud-db

Dockerfile
9
star
9

waf

The Islamic Network WAF
PHP
8
star
10

prayer-times-moonsighting

A prayer times library to calculate Fajr and Isha timings per moonsighting.com
PHP
7
star
11

marifa.org

Code for Marifa.org - Metaphysical Truths and Quotes
JavaScript
6
star
12

alquran-apidotnet-client

An AlQuran DotNet API Client
C#
5
star
13

alquran-api-client-node

TypeScript
5
star
14

aladhan-api-jquery-plugin

A Jquery Plugin to get Prayer Times
JavaScript
4
star
15

islamic-calendar

A library to calculate Islamic Dates
PHP
3
star
16

openapi

OpenAPI Specifications for Islamic Network APIs
HTML
3
star
17

islamic-apps-docker

Docker Container for AlAdhan.com and AlQuran.cloud
Dockerfile
3
star
18

cdn

CDN Setup
Shell
3
star
19

qibla-direction

Calculates the angle of the Qibla from a given pair of co-ordinates.
PHP
3
star
20

islamic.network

HTML
3
star
21

quran-line-by-line

A line by line text rendition of the Qur'an for the Al Quran API
PHP
2
star
22

alquran-word

Printable Qur'an Al Kareem
Rich Text Format
1
star
23

alquran-api-golang-client

A Golang client for the AlQuran API
1
star
24

php74

Dockerfile
1
star
25

php72

Dockerfile
1
star
26

everyayah.com-audio-scraper

PHP script to scrape audio from everyayah.com
PHP
1
star
27

cdn.aladhan.com

JavaScript
1
star
28

api.aladhan.com-db

TSQL
1
star
29

sermons.islamic.network

The sermons portal and API
HTML
1
star