A comprehensive API for managing recipes, allowing users to create, read, update, and delete their recipes. This project is built with Django REST Framework and follows best practices for a RESTful API.
- User Authentication: User management via authentication tokens (JWT).
- Recipes (CRUD):
- Create, view, edit, and delete your own recipes.
- Support for multiple ingredients and preparation steps per recipe.
- Search and filter by title, ingredients, or categories.
- Public/private flag for recipes.
- Categories and Ingredients: Management of categories and ingredients associated with each recipe.
- API Statistics: A public endpoint to view total recipe, user, and category counts.
- Backend:
- Django: Python web framework.
- Django REST Framework (DRF): For building the API.
- drf-spectacular: For interactive documentation (OpenAPI 3.0).
- Pillow: For handling recipe cover images.
- Database:
- SQLite (default, for development)
- Support for other databases like PostgreSQL and MySQL (just configure in
settings.py
).
Follow these instructions to set up and run the project locally.
Make sure you have Python 3.8+ and pip
installed.
- Clone the repository:
git clone https://github.com/Joao-sl/RecipesAPI.git cd RecipesAPI
- Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # or `./venv/Scripts/activate` on Windows
- Install project dependencies:
pip install -r requirements.txt
- Run database migrations:
python manage.py migrate
- Start the development server:
The API will be available at
python manage.py runserver
http://127.0.0.1:8000/
.
The interactive API documentation can be accessed at:
- Swagger UI:
http://127.0.0.1:8000/api/schema/swagger-ui/
- ReDoc:
http://127.0.0.1:8000/api/schema/redoc/
Made with ❤️ by João. Feel free to get in touch!
This project is licensed under the MIT License.