Skip to content

API to access Hadiths of Bukhari, Muslim, Abu-Dawud, Ahmed Ibn-Hanbal, Muwataa, Ibn-Maja, Al Tirmidhi, Al Nasai, Al Darimi

Notifications You must be signed in to change notification settings

tahmid198/The9Books

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

An API to retrieve hadith of nine famous books:

Book Hadith count
Sahih Bukhari 7008
Sahih Muslim 5362
Sunan Nasai 5662
Sunan Abi Dawud 4590
Sunan Tirmidhi 3891
Sunan Ibn Majah 4332
Muwatta Imam Malik 1594
Sunan Darimi 3367
Musnad Ahmad 26363

Development Setup

Starting the Development Server

Open up Terminal and navigate to the directory where you want the project to live.

Clone this repository:

git clone https://github.com/MohamedAbdelghani/The9Books.git

Extract database file from "src/Api/SunnahDb.rar" in the same directory, it was compressed because it exceeded github file size limit.
The original Hadith CSV files can be found in Open-Hadith-Data repository.

Navigate to api project:

cd The9Books/src/Api

Ensure that Docker Desktop is up and running, then run the following commands:

  docker build -t 9books/dev . 
  docker run   -p 5000:80 --name 9hadithbooks 9books/dev

Wait for the logs to show "server started on port 5000", then navigate to localhost:5000 to access api.

Routes

GET /books

Retrieves list of all books

GET /{bookId}/{hadithNumber}

Retrieves specific hadith from specific book.
book ids can be obtained from end point GET /books

GET /{bookId}/{startHadithNumber}/{rangeSize}

Retrieves a range of hadiths from speific book starting from specific hadith.
Maximum range size is 50.

GET /random

Retrieves a random hadith from Sahih al-Bukhari.

GET /random/{bookId}

Retrieves a random hadith from specific book.

About

API to access Hadiths of Bukhari, Muslim, Abu-Dawud, Ahmed Ibn-Hanbal, Muwataa, Ibn-Maja, Al Tirmidhi, Al Nasai, Al Darimi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 93.6%
  • Dockerfile 6.4%