A robust REST API built with Django REST Framework that allows users to manage recipes, ingredients, and tags. The API includes features like user authentication, image upload, and filtering capabilities.
- User Authentication
- Create, Read, Update, and Delete Recipes
- Manage Recipe Tags and Ingredients
- Image Upload for Recipes
- Filtering and Sorting
- Comprehensive Test Suite
- Docker Support
- CI/CD with GitHub Actions
- Python 3.9
- Django & Django REST Framework
- PostgreSQL
- Docker & Docker Compose
- GitHub Actions for CI/CD
- Pillow for Image Processing
- DRF Spectacular for automating Django REST APIs documentation
- Docker and Docker Compose installed
- Python 3.9 or higher (if running locally)
- Git
- Clone the repository:
git clone https://github.com/Hungle2911/rarecipe-api
cd rarecipe-api- Create environment file:
cp .env.example .env- Build and run the containers:
docker-compose up --build- Run migrations:
docker-compose run --rm app sh -c "python manage.py migrate"- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Set up the database:
python manage.py migrate- Run the development server:
python manage.py runserverdocker-compose run --rm app sh -c "python manage.py test"python manage.py test/api/docs/- See what endpoints available
Common commands for managing the application:
# Build and start containers
docker-compose up --build
# Run migrations
docker-compose exec app python manage.py migrate
# Run tests
docker-compose run --rm app sh -c "python manage.py test"
# Stop containers
docker-compose down- Create a new branch for your feature:
git checkout -b feature/your-feature-name- Make your changes and commit them:
git commit -m "Add your message"- Push to your branch:
git push origin feature/your-feature-name- Create a Pull Request
The project includes comprehensive tests for:
- User Authentication
- Recipe Management
- Tag and Ingredient Operations
- Image Upload Functionality
Ensure all tests pass before submitting pull requests:
python manage.py testThis project follows PEP 8 guidelines. Install and run flake8:
pip install flake8
flake8- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
- Django REST Framework documentation
- Docker documentation
- GitHub Actions documentation
