spa5k / quran

https://salam-next.vercel.app/
6 stars 0 forks source link

Salah API standardization #255

Open spa5k opened 1 year ago

spa5k commented 1 year ago

Background: Currently, we have developed various APIs, such as the Mushaf API, and we would like to create a professional Salah API that follows a similar structure. The Salah API will provide prayer times information to users. We have an existing API that uses the salah-js library, but we also want to incorporate an additional method that utilizes the aladhan.com Prayer Times API. The goal is to create similar methods for both sources, allowing users to choose their preferred method.

Tasks:

Create a class for the Salah API and implement the necessary methods accordingly. Move the existing API code, which uses the salah-js library, to the new Salah API class. Add another method to the Salah API class that fetches prayer times from the aladhan.com Prayer Times API. Ensure that the new methods in the Salah API class have a consistent structure, regardless of the chosen source. Implement a toggle or similar functionality that allows users to select their preferred method/source. Deliverables: Upon completion, we should have a professional Salah API class that offers multiple methods for retrieving prayer times. The API class should include the existing method using the salah-js library, as well as a new method using the aladhan.com Prayer Times API. The class should provide a toggle or similar mechanism for users to choose between the available sources. The methods should adhere to a consistent structure, allowing users to seamlessly switch between sources without needing to modify their code.

Additional Notes:

Ensure that the Salah API class is properly organized and follows best practices for code structure and readability. Handle any necessary error checking and validation within the API methods. Document the usage and available methods of the Salah API for ease of use by other developers. Consider any potential performance implications when making API requests to the external aladhan.com API. Test the Salah API thoroughly to ensure accurate and reliable prayer times retrieval. Let me know if you have any further questions or clarifications on the requirements.