Logo Lanfrica

MikeRock51/african_cuisines_recipe_api

Record type:

software
Creator:
Mik
Host:
A RESTFUL API for African foods, their recipes and general nutrition # Welcome to My Api *** ## Task Build a backend project providing an API, document and host it on the web. ## Description ### African Cuisines Recipe Restful API A RESTFUL API that provides detailed information about African cuisines. As well as step by step instructions on how to make them. The API features a GraphQL endpoint, Swagger documentation, Postman documentation and RESTFUL API endpoints. Authentication is done using API Key for protected route. ## Project Links - API Endpoints - Swagger Documentation - GraphQL Endpoint - Postman Documentation ## Installation #### In the root directory of the project 1. Install python and project dependencies and packages ```bash $ sudo apt update $ sudo apt install -y python3 $ sudo apt install -y python3-pip $ sudo apt install -y python3-venv $ sudo apt-get install -y pkg-config $ sudo apt-get install -y libmysqlclient-dev $ sudo apt install -y nginx $ pip install gunicorn $ sudo apt install redis-server $ sudo apt install mysql-server $ sudo systemctl start mysql.service $ pip install -r requirements.txt ``` 2. Setup database ```bash $ cat setupDatabase.sql | mysql ``` 3. Setup virtual environment ```bash $ python3 -m venv .venv $ source .venv/bin/activate $ pip install -r requirements.txt ``` 4. Start the API servers ```bash $ bash start_servers ``` 5. The RESTFUL API will be running on localhost while the graphql api on localhost and the swagger documentation on localhost ## Usage 1. Create a user account POST /users 2. Login to get your authentication token POST /login 3. Create a recipe on POST /recipes 4. Update a recipe on PUT /recipes/{id} 5. Delete your recipe on DELETE /recipes/{id} 6. Get a list of all available recipes on GET /recipes 7. Search a recipe by querying GET /recipes?search=Plantain 8. Data is paginated 10 items per page. You can specify a page to fetch by passing it in the query (e.g. GET /recipes?page=4) 9. You …