/ramazon-api

🕌 API for Ramadan! Written in FastAPI

Primary LanguagePythonMIT LicenseMIT

🕌 Ramazon-API

FASTAPI_LOGO

Assalamu alaikum 👋
Ramadan Mubarak. Wishing you a blessed and Happy Ramadan 😀

🧰 Setup

Required: python +3.6

Clone this repository:

# git
$ git clone https://github.com/AbduazizZiyodov/ramazon-api.git
# github-cli:
$ gh repo clone AbduazizZiyodov/ramazon-api

Go to the project directory. Create virtual enviroment and activate it:

$ cd ramazon-api/
$ python -m venv env && source env/bin/activate

# env/Scripts/activate - windows

Install all required packages using pip from requirements.txt file.

$ pip install -r requirements.txt

Or, you can use poetry (if you have).

$ poetry install

🚀Running Server

To run fastapi application you will have to use uvicorn or gunicorn.

Uvicorn 🦄

--reload - reloading for development server.

$ uvicorn main:api --reload

Gunicorn (🟢)🦄

$ gunicorn main:api --worker-class uvicorn.workers.UvicornWorker --reload

SWAGGER_UI

  • http://{{ host }}/swagger - Swagger UI


✨Mocking Database

After running server, you should send GET request to /simulate endpoint from anywhere(swagger UI, curl, postman ...). The results of mocking will be logged on your terminal.

MOCK_RESULT

🧪 Running Tests

Running with poetry:

$ poetry run pytest

or

$ pytest

TEST

🐍 Abduaziz Ziyodov