This repository powers the AlQuran.cloud API on http://api.alquran.cloud.
- PHP 8.0
- PerconaDB 5.7
- Memcached 1.5
- Slim Framework v3
- You will need a file with with 6236 lines for each ayah.
- Place the file in the
edition-importer
directory. - Fill in the
edition-importer/edition.yml
file. - From the edition importer directory, run
php import.php
.
- Add entry in the edition table.
- 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.
- https://github.com/islamic-network/api.alquran.cloud/blob/master/src/Quran/Helper/Meta.php#L98 needs to be updated.
- https://github.com/islamic-network/api.alquran.cloud/blob/master/cdn.txt needs to be updated.
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:
- quran-app - This is the actual PHP / Apache instance. This runs on https://localhost:7070 - see https://localhost:7070/ayah/1.
- quran-db - This is the Percona DB Container.
- quran-memcached - This is the Memcached Container.
- quran-pma - PHPMYAdmin to acccess your Percona DB. This runs on https://localhost:7071. The default username and password are both 'quran' and 'quran'.
- quran-memadmin - PHPMemcachedAdmin to access your Memcached container. This runs on https://localhost:7072. The default username and password are both 'quran'
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/php73:latest
line to islamicnetwork/php73: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.
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.
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.