This project is a FastAPI server that provides endpoints to retrieve dish data and images. The server is designed to handle requests for dish information and images efficiently and securely.
The FastAPI server exposes the following endpoints:
-
GET /dishes/
- Returns a JSON object containing dish data.
- Example response:
{"data": {"dish_1": ["img_1.jpg", "img_2.jpg"], ...}}
- This endpoint provides an overview of all available dishes and their associated images.
-
GET /img_1.jpg
- Returns a blob of the requested image.
- This endpoint allows clients to retrieve specific images by their filename.
-
GET /dishes/dish_1
- Returns a list of image filenames associated with a specific dish.
- Example response:
["img_1", "img_2", ...]
- This endpoint provides detailed information about a specific dish, including its associated images.
Please access the UI client with this URL: https://github.com/SoftwareGirl/Dishes-Client
This project relies on the following dependencies:
- FastAPI: A modern, fast (high-performance), web framework for building APIs with Python.
- Uvicorn: A lightning-fast ASGI server implementation, using uvloop and httptools.
- Other dependencies specified in the
requirements.txt
file. - In addition to Python requirements, one needs to download dishes image collection from this Google drive Link and unzip it to the project root: https://drive.google.com/file/d/1WYjnjsDGQp-icIRSs6JVslNqfy4FoBHz/view?usp=sharing
To get started with this project, follow these steps:
- Clone the repository from GitHub.
- Install the required dependencies by running
pip install -r requirements.txt
. - Start the FastAPI server by running
uvicorn main:app --reload
. - Access the endpoints using the provided URLs, such as
http://127.0.0.1:8000/dishes/
.