Skip to content

TarteelAI/quranic-universal-library

Repository files navigation

Quranic Universal Library (QUL)

X (formerly Twitter) Follow Discord

Welcome to QUL! This project is a comprehensive Content Management System designed to manage Quranic data, including translations, tafsirs, Audio, Audio segments, Arabic scripts, Mushaf layouts, and much more.

QUL is implemented using Ruby on Rails, and Active Admin for implementing the admin interface.

Features

  • Translations and Tafsirs Management: Easily add, proofread, fix issues, and export different formats.
  • Audio Management: Easily add both ayah by ayah and gapless aduio, manage audio segments, and export segments data.
  • Arabic Scripts: Preview different Arabic scripts, both ayah by ayah and word by word.
  • Mushaf Layouts: Manage different Mushaf layouts, preview them, and export them.
  • User Management: Manage users, their roles, and permissions.
  • Mutashabihat ul Quran: Manage Mutashabihat ul Quran data.
  • Surah info: Manage Surah info data in multiple languages.
  • Content Versioning: Keep track of all changes made to the content.
  • Export Data: Export data in different formats.
  • Import Data: Import data from different sources.
  • Quranic grammar and morphology: Manage Quranic grammar and morphology data.

Setup Guide

This guide will help you set up the QUL project on your local machine. Follow the steps below to get started.

Prerequisites

  • Ruby: Version 3.3.3
  • Rails: Version 7.0.3
  • RVM or rbenv: For managing Ruby versions
  • PostgreSQL: 14.3 or higher
  • Redis: 7.0.0 or higher

1. Clone the repository

git clone [email protected]:TarteelAI/quranic-universal-library.git
cd quranic-universal-library

2. Install Ruby and setup environment

rvm install 3.3.3
rvm use 3.3.3
rvm gemset create qul
rvm gemset use qul

3. Install PostgreSQL

  • Ubuntu/Debian
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib libpq-dev
  • MacOS
brew install postgresql
  • Windows Download and install the latest version of PostgreSQL from the official website.

4. Install Dependencies

gem install bundler
bundle install

5. Database Configuration

The QUL project requires two databases:

  1. quran_dev: This database holds all Quranic data, including translations, tafsirs, audio etc. It's accessed through quran_api_db_dev for the development environment.
  2. quran_community_tarteel: This database manages user accounts, permissions, and user changes.

6. Create Databases

Create the quran_community_tarteel database for managing user content.

rails db:create

For quran_dev you can create it manually or change the database name to quran_dev for development group in database.yml file and run rails db:create again.

7. Load the data for quran_dev database

The quran_dev database dump is available in both SQL and binary formats. Follow the appropriate instructions below to restore the database.

Restoring from SQL Dump

7.1 Restore using SQL Dump: Download the SQL dump file and restore it using

  psql quran_dev < "path to sql dump file"

If it didn't work try running the following command:

psql -U postgres -d quran_dev -f path/to/quran_dev.sql

7.2 Restore using binary dump: Download the Binary dump file and restore it using

pg_restore --host localhost --port 5432 --no-owner --no-privileges --no-tablespaces --no-acl --dbname quran_dev -v "path to binary dump file"

8. Run the migrations for quran_community_tarteel database

rails db:migrate
rails db:migrate
rails db:seed

9. Run the Application

bin/dev

🌟Insha`Allah! Your application should be up and running at time point! 🌟

You can now visit http://localhost:3000 in your browser to explore the app.

🔐 Head over to the admin panel at http://localhost:3000/admin

10. Contributing to QUL

We welcome contributions to enhance the QUL project! If you'd like to contribute, please follow these steps:

10.1 Fork the Repository: Click on the "Fork" button at the top right of this page to create your own copy of the repository.

10.2 Clone Your Fork:

   git clone https://github.com/your_username/quranic-universal-library.git

10.3. Create a new feature branch:

   git checkout -b making-qul

10.4 Make Your Changes:

10.5 Push Your Changes:

git add .
git commit -m "Add a brief description of your changes"
git push origin your-feature-branch

10.6 Create a Pull Request:

May Allah reward your efforts and make them beneficial for the community! 🤲