Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yash-kk/recipe-drf

Recipe-DRF is a RESTful API built with Django and Django REST Framework (DRF) for managing recipes.
https://github.com/yash-kk/recipe-drf

django django-rest-framework docker swagger-ui

Last synced: about 1 month ago
JSON representation

Recipe-DRF is a RESTful API built with Django and Django REST Framework (DRF) for managing recipes.

Awesome Lists containing this project

README

        

# Recipe-DRF Application
### Technologies used: Django, Django Rest Framework, Docker.




## Description
Recipe-DRF is a RESTful API built with Django and Django REST Framework (DRF) for managing recipes. It allows users to create, retrieve, update and delete recipes. Each recipe consists of a title, description, cooking time, price, link, tags, ingredients, and an optional image. Users can also filter recipes based on tags.


## Key Features


  • User Authentication: Users can register, login, and authenticate to perform CRUD operations on recipes.


  • Recipe Management: Users can create new recipes, view existing recipes, update recipe details, and delete recipes.


  • Tag and Ingredient Management: Users can manage tags and ingredients associated with recipes.


  • Image Upload: Users can upload images for recipes using a separate API endpoint.


  • Filtering: Recipes can be filtered based on tags, allowing users to find recipes with specific tags.



## Setup
Clone the git repository locally:

```
[email protected]:Yash-KK/recepi-drf.git
```

Build and Run the Docker Container:

```
sudo docker-compose up -d --build
sudo docker-compose run --rm app sh -c "python manage.py migrate"
sudo docker-compose run --rm app sh -c "python manage.py runserver"
```

Stopping a running container:

```
sudo docker-compose stop
```

Removing the volumes and containers:

```
sudo docker-compose down -v
```


## API
After successfull deployment of the image containers our backend is up and running on :

* [localhost:8000](http://127.0.0.1:8000/)


The application generally supports all type of crud operations for an app:

* View all existing recipes[GET] and Create a new recipe instance[POST]:

[http://127.0.0.1:8000/api/recipe/recipes/](http://127.0.0.1:8000/api/recipe/recipes/)

* View a particular recipe[GET], Update[PUT/PATCH] and Delete[DELETE] :

[http://127.0.0.1:8000/api/recipe/recipes//](http://127.0.0.1:8000/api/recipe/recipes//)

For more information, visit:

* [http://127.0.0.1:8000/api/docs/](http://127.0.0.1:8000/api/docs/)




## Debugging

To check running docker containers:

```
sudo docker container ls
```

To see all docker containers :

```
sudo docker container ls -a
```

To view logs of a particular container while facing some issue:
```
sudo docker logs [container_id]
```


## Testing

One can use clients like Thunder Cient extension in Vscode or Postman to test these API's