The Recipe App API is a backend API built using Django and Django REST Framework. It allows users to create, update, and view recipes and ingredients. Users can also create accounts, authenticate with the API using a token, and manage their own recipes.
-
Clone the repository
git clone https://github.com/Palwisha-18/recipe-app-api.git
-
Navigate to the project directory
cd recipe-app-api
-
Build the Docker image
docker build -t recipe-app-api .
-
Run the Docker container
docker run -p 8000:8000 recipe-app-api
-
The API should now be available at http://localhost:8000
The Recipe App API has the following endpoints:
POST /api/user/create/
- create a new userPOST /api/user/token/
- authenticate and get an API tokenPOST /api/user/me/
- update the authenticated user's information
GET /api/recipe/
- list all recipesGET /api/recipe/{id}/
- retrieve a specific recipe by IDPOST /api/recipe/
- create a new recipePUT /api/recipe/{id}/
- update a specific recipe by IDDELETE /api/recipe/{id}/
- delete a specific recipe by ID
GET /api/ingredient/
- list all ingredientsGET /api/ingredient/{id}/
- retrieve a specific ingredient by IDPOST /api/ingredient/
- create a new ingredientPUT /api/ingredient/{id}/
- update a specific ingredient by IDDELETE /api/ingredient/{id}/
- delete a specific ingredient by ID
To authenticate, include an Authorization
header in your request with the value Token {token}
, where {token}
is the token obtained from the /api/user/token/
endpoint.
If you'd like to contribute to the Recipe App API, please follow these steps:
- Fork the repository
- Create a new branch for your feature or bugfix
- Make your changes and write tests if applicable
- Run the tests with
docker-compose run app sh -c "python manage.py test && flake8"
- Submit a pull request