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