mrsofiane / mawaqit-api

Mawaqi Api is a Rest Api for mawaqit.net, the mawaqit.net website gives you the prayer times for more than 8000 mosques around the world, the idea behind this api is to create an api web app that can be used as backend and data source with json format.
https://mrsofiane.me/mawaqit-api
MIT License
23 stars 6 forks source link

Could you give us more explanataion on how to use this api #7

Closed MusLead closed 5 months ago

MusLead commented 6 months ago

I tried to run using

uvicorn main:app
INFO:     Started server process [5763]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO:     127.0.0.1:49399 - "GET / HTTP/1.1" 404 Not Found
INFO:     127.0.0.1:49399 - "GET /favicon.ico HTTP/1.1" 404 Not Found
INFO:     127.0.0.1:49401 - "GET / HTTP/1.1" 404 Not Found

But as you see, it returns 404 not found.

could you also give us some more explanation on how to use this uvicorn for this purpose?

MusLead commented 6 months ago

as I tried to run this server and write http://127.0.0.1:8000/docs I see a documentation of using this api. that is great, but I do not know the mosque_id that is being used. How could we see the list of the mosque id?

MusLead commented 6 months ago

The round way solution is to open the app and share the link of the mosque and open it in the browser. then the address will be shown i.e: https://mawaqit.net/en/m/dawah-kassel .Therefore the mosque_id is dawah-kassel

MusLead commented 6 months ago

I stillhave difficulties to access them with docker... could please give us more explanation!

I got this error as I tried to build the docker

Dockerfile:3
--------------------
   1 |     FROM python:3.8.14-alpine3.16
   2 |     WORKDIR /app
   3 | >>> COPY main.py models.py script.py requirements.txt /app/
   4 |     RUN pip install -r requirements.txt
   5 |     CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 8f02780c-4ec5-4b26-b150-ff744ad68274::m7r92hckz5oz364m1rchcfmbo: "/script.py": not found
(base) 
mrsofiane commented 6 months ago

Hello @MusLead, i can see that i forgot to edit the docker file, because i made some changes in the project structure, i will drop a fix on this soon, also i will create docker compose file to run both the api and the redis database for caching. Thank you

mrsofiane commented 6 months ago

Resolved in #10 , fixed the bug in the dockerfile, and added a docker conpose file to run redis and mawaqit api together, also now redis is optional you can enable or disable it via env var.

MusLead commented 6 months ago

I sincerely appreciate the swift response you provided earlier. I am writing to suggest an enhancement to the documentation related to identifying the mosque_id. It would be immensely beneficial for users if the documentation included a section on how to find the mosque_id (i.e. by opening the app, sharing the mosque's link, and then opening it in a browser to reveal the address, such as https://mawaqit.net/en/m/dawah-kassel, thereby identifying the mosque_id as dawah-kassel.)

Furthermore, I believe it would be advantageous to incorporate a note within the documentation to inform users that accessing the service solely through IP addresses will not yield results. Instead, adding /docs to the URL will display a collection of paths for utilizing this REST-API, which is invaluable for individuals unfamiliar with FAST-API.

Additionally, guidance on accessing the REST-API through Docker, as it presents a slightly different approach compared to local Python environments, would greatly enhance the documentation. While the inclusion of Redis and other technologies is appreciated, a clearer explanation of their (Redis) functions and how they can be utilized within this context would be very helpful.

Your contributions to developing this REST-API have been truly remarkable, providing an essential resource for those looking to develop applications based on the Mawaqit database. I extend my gratitude for your innovative efforts and kindly ask you to consider these suggestions to further improve the documentation and user experience.

Thank you once again for your dedication and hard work.

mrsofiane commented 6 months ago

Hello @MusLead, thanks for this wonderful feedback, i'm planning to create a full documentation on how to use this API.

highwingers commented 5 months ago

is this offical API from Mawaqit?

mrsofiane commented 5 months ago

Hi @highwingers, No this is not an official API from Mawaqit, this api use Mawaqit.net website to get the prayer times in json.

mrsofiane commented 5 months ago

Hello @MusLead, a clear documentation is now available here https://mrsofiane.me/mawaqit-api/#/, documentation is generated with docsify, you can check the /docs folder.