A modern, RESTful API for managing and sharing recipes. Built with FastAPI and designed for scalability and ease of use.
Features • Installation • API Documentation • Contributing • License
-
🔍 Recipe Management
- Get all recipes with pagination and filtering
- Search recipes by name, ingredients, or tags
- Get detailed recipe information
- Add new recipes with validation
- Update existing recipes
- Delete recipes
-
🛠️ Technical Features
- RESTful API design
- JSON response format
- Input validation
- Error handling
- Rate limiting
- CORS support
- Swagger/OpenAPI documentation
-
Clone the repository
git clone https://github.com/Just2Deep/recipe_api.git
-
Navigate to the project directory
cd recipe_api/smilecook -
Set up virtual environment
# Create virtual environment python -m venv venv # Activate virtual environment # On Windows venv\Scripts\activate # On Unix or MacOS source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Run the application
python main.py
The API will be available at http://localhost:8000
For detailed API documentation, visit our API Documentation
import requests
# Get all recipes
response = requests.get('http://localhost:8000/api/recipes')
# Get a specific recipe
response = requests.get('http://localhost:8000/api/recipes/1')
# Add a new recipe
new_recipe = {
"name": "Chocolate Cake",
"ingredients": ["flour", "sugar", "cocoa powder"],
"instructions": "Mix ingredients and bake"
}
response = requests.post('http://localhost:8000/api/recipes', json=new_recipe)We welcome contributions! Here's how you can help:
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature) - Make your changes
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
pytest
# Run linting
flake8This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions, please:
- Open an issue in the GitHub repository
- Contact the maintainers