A robust, well-tested RESTful API for managing recipes with full CRUD operations, authentication, and image uploads.
| Feature | Description |
|---|---|
| ๐ Authentication | Token-based auth with custom email user model |
| ๐ Recipe Management | Full CRUD with image uploads & filtering |
| ๐ท๏ธ Tag System | Organize recipes with customizable tags |
| ๐ฅ Ingredient System | Manage recipe ingredients efficiently |
| ๐ API Documentation | Interactive Swagger/OpenAPI docs |
| ๐ณ Docker Ready | Production-ready containerization |
| โ Well Tested | 1000+ lines of comprehensive tests |
- Docker
- Docker Compose
- Clone & Setup
git clone https://github.com/SheikhIshere/django-recipe-api
cd recipe_api- Build & Run
docker-compose build
docker-compose up- Access the API
- API Documentation: http://localhost:8000/api/docs/
- Admin Panel: http://localhost:8000/admin/
- API Base: http://localhost:8000/api/
- Create Superuser (optional)
docker-compose run --rm app sh -c 'python manage.py createsuperuser'recipe_api/
โโโ App/
โ โโโ core/ # Project settings & config
โ โโโ users/ # Custom user model & auth
โ โโโ recipe/ # Recipe, Tag, Ingredient models
โ โโโ test/ # 1000+ lines of comprehensive tests
โโโ docker-compose.yml # Multi-service setup
โโโ Dockerfile # App container definition
โโโ requirements.txt # Python dependencies
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/users/ |
User registration |
POST |
/api/users/token/ |
Get auth token |
GET |
/api/recipes/ |
List recipes |
POST |
/api/recipes/ |
Create recipe |
GET |
/api/recipes/{id}/ |
Get recipe details |
PUT |
/api/recipes/{id}/ |
Update recipe |
DELETE |
/api/recipes/{id}/ |
Delete recipe |
GET/POST |
/api/tags/ |
Manage tags |
GET/POST |
/api/ingredients/ |
Manage ingredients |
docker-compose run --rm app sh -c 'python manage.py test'docker-compose run --rm app sh -c 'python manage.py migrate'docker-compose exec app sh- Custom user model with email authentication
- Token-based security for API access
- Protected endpoints with DRF permissions
- Image upload with UUID filename handling
- Many-to-many relationships with Tags & Ingredients
- Advanced filtering (
?tags=1,2,?ingredients=3) assigned_onlyquery parameter for clean responses
- PostgreSQL for production database
- Docker containerization
- Comprehensive test suite
- Modular and scalable architecture
POST /api/recipes/
Content-Type: application/json
Authorization: Token <your-token>
{
"title": "Pasta Carbonara",
"time_minutes": 30,
"price": 12.50,
"tags": [1, 2],
"ingredients": [1, 3, 5]
}GET /api/recipes/?tags=1&ingredients=3The project includes extensive testing with:
- โ Model tests
- โ API endpoint tests
- โ Authentication tests
- โ Serializer validation tests
- โ Image upload tests
- โ Filter and search tests
- Recipe rating system
- Advanced search with Elasticsearch
- Social features (sharing, comments)
- Meal planning functionality
- Recipe import from URLs
Contributions are welcome! Please feel free to submit a Pull Request.
Built with โค๏ธ using Django REST Framework | 100% Test Coverage