Skip to content

mileiny1/stir-craft

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

163 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍸 StirCraft: Cocktail Recipe Manager

Your Personal Mixology Companion - Now Live!
🌐 Try StirCraft Live

StirCraft Logo

πŸš€ Live Demo Available

StirCraft is live and ready to use!


🎯 What is StirCraft?

StirCraft is a comprehensive cocktail recipe management application that empowers mixology enthusiasts to discover, create, and organize their favorite cocktail recipes. Whether you're a professional bartender or a home cocktail enthusiast, StirCraft provides the tools you need to build your personal cocktail library.

πŸ’‘ The Problem We Solve

Cocktail enthusiasts face scattered recipe sources, inconsistent measurements, and no way to organize their growing collection of favorites. StirCraft centralizes everything in one elegant, user-friendly platform.

🎯 Our Solution

A complete cocktail management ecosystem featuring:

  • Discovery: 400+ professionally curated cocktails
  • Creation: Custom recipe builder with smart ingredients
  • Organization: Personal lists, favorites, and collections
  • Community: Share and discover recipes with fellow mixologists

✨ Key Features & Demo

πŸ” User Authentication & Profiles

  • βœ… Secure user registration and login
  • βœ… Personalized user profiles with location and preferences
  • βœ… Age verification (21+) for responsible service
  • Try Registration β†’

🍹 Comprehensive Cocktail Management

  • βœ… Discover: Browse 416+ cocktails including classics like Martini, Margarita, Old Fashioned
  • βœ… Create: Build custom cocktail recipes with detailed ingredients
  • βœ… Edit: Modify and perfect your recipes
  • βœ… Organize: Add cocktails to custom lists and favorites
  • Explore Cocktails β†’

πŸ“‹ Smart List Management

  • βœ… Favorites: One-click favoriting system
  • βœ… Your Creations: Automatic collection of user-created recipes
  • βœ… Custom Lists: Create themed collections (e.g., "Summer Cocktails", "Party Drinks")
  • βœ… Quick Actions: Easy add/remove functionality
  • View Dashboard β†’

πŸ₯ƒ Ingredient & Vessel Database

  • βœ… Extensive ingredient catalog with 325+ ingredients
  • βœ… Alcohol content tracking and calculations
  • βœ… 15 vessel types with proper glassware recommendations
  • βœ… Smart measurement conversion
  • Browse Ingredients β†’

🎨 Modern, Responsive Design

  • βœ… Clean, professional interface built with Bootstrap
  • βœ… Mobile-responsive design for on-the-go access
  • βœ… Intuitive navigation and user experience
  • βœ… Accessibility-compliant design

πŸ† Technical Excellence

πŸ†• Recent Improvements (August 2025)

  • βœ… Color Filtering System: Visual color filter buttons with database-matched values
  • βœ… Vibe Detection AI: Intelligent cocktail categorization with 40+ vibe types (tropical, winter, party, etc.)
  • βœ… JavaScript Optimization: Resolved favorites button conflicts and improved error handling
  • βœ… Enhanced Testing: 245+ Django tests + 23+ JavaScript tests with 100% critical path coverage
  • βœ… Advanced Search: Multi-field filtering with real-time updates and progressive enhancement

πŸ“Š Production Stats

  • βœ… 245/245 Python Tests + 23/23 JavaScript Tests Passing (100% test coverage on critical functionality)
  • βœ… Live Deployment on Heroku with PostgreSQL (v17)
  • βœ… Security Headers and HTTPS enabled
  • βœ… Performance Optimized with static file compression and image processing

πŸ›  Tech Stack

  • Backend: Django 5.2.5, Python 3.13
  • Database: PostgreSQL with 416+ cocktails, 325+ ingredients, 15 vessel types
  • Frontend: Bootstrap 5, Responsive HTML/CSS/JS
  • Deployment: Heroku with WhiteNoise for static files
  • APIs: TheCocktailDB integration for cocktail data

🎯 Ready to Start Mixing?

πŸš€ Try It Now - No Installation Required!

🌐 Launch StirCraft

  1. Sign Up - Create your free account
  2. Explore - Browse 416+ cocktails including classics
  3. Create - Build your own recipes
  4. Organize - Manage your collections

🏠 Local Development Setup

Try StirCraft

πŸ‘‰ Visit StirCraft Live Application (Coming Soon)

Explore the Code

πŸ› οΈ Technologies Used

Backend

  • Python 3.12 - Core programming language
  • Django 5.2.5 - Web framework for rapid development
  • PostgreSQL - Robust database for data persistence
  • Django REST Framework - API development (future enhancement)

Frontend

  • HTML5 & CSS3 - Modern web standards
  • Bootstrap 5 - Responsive design framework
  • Django Templates - Server-side rendering
  • JavaScript - Interactive user experiences

External Integrations

  • TheCocktailDB API - Cocktail recipe data source
  • django-taggit - Flexible tagging system
  • Redis - Caching and session management

Deployment & DevOps

  • Heroku - Cloud application hosting
  • Gunicorn - Production WSGI server
  • WhiteNoise - Static file serving
  • PostgreSQL - Production database

🎯 Next Steps: Planned Enhancements

User Experience

  • Recipe Ratings & Reviews - Community-driven quality feedback
  • Advanced Search - Filter by ingredients, difficulty, time to make
  • Recipe Recommendations - AI-powered suggestions based on preferences
  • Social Features - Follow other users and share recipe collections

Technical Enhancements

  • Mobile App - Native iOS and Android applications
  • Recipe Import/Export - Import from popular cocktail apps and websites
  • Inventory Tracking - Track your home bar ingredients
  • Shopping Lists - Generate ingredient shopping lists for recipes

Community Features

  • Recipe Comments - Discussion and tips on recipes
  • Photo Uploads - Share photos of your cocktail creations
  • Recipe Contests - Monthly themed cocktail competitions
  • Expert Profiles - Verified bartender and mixologist accounts

πŸ† Project Attributions

External Resources

Team

General Assembly Team 1 - Full-stack development team specializing in Django web applications

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


🍸 Ready to mix things up? Start exploring StirCraft today!

Built with ❀️ by cocktail enthusiasts, for cocktail enthusiasts

🎨 Frontend Styling: Bootstrap

This project uses Bootstrap for frontend styling. Bootstrap provides CSS classes (e.g., card-header, btn, etc.) used throughout our templates.

How to Enable Bootstrap

Recommended (CDN): Add the following line to the <head> section of your base.html template:

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">

This loads Bootstrap from the web. No installation is required.

Optional (Local Install): If you prefer to use a local copy, you can download Bootstrap or install it via npm:

npm install bootstrap

Then link to the CSS file in your static files setup. See the Bootstrap docs for details.

Why Bootstrap?

Bootstrap makes it easy to create responsive, modern layouts and UI components. All team members should ensure Bootstrap is enabled to see the intended styles.


🎯 MVP Goals

Core Features

  • User authentication (Sign Up / Sign In)
  • Dashboard with editable profile, user-created lists, and recipes
  • Ingredient and vessel management with reusable forms
  • Recipe creation with dynamic ingredient and vessel selection
  • Recipe catalog with filtering by vibe, flavor tags, and color
  • Error handling views for bad paths, restricted access, and failed requests

Technical Stack

  • Backend: Django 5.2.5 + PostgreSQL
  • API Integration: TheCocktailDB API for real cocktail data
  • Data Processing: Intelligent ingredient categorization and measurement parsing
  • Frontend: Django templates with Bootstrap CSS
  • Tagging: django-taggit for flavor profiles
  • Testing: Django's built-in test framework
  • Version Control: Git + GitHub

βœ… Wireframes Completed

βœ… Models & Testing

  • Ingredient model uses django-taggit for flavor tags
  • Model tests scaffolded for Ingredient, Recipe, and List
  • Sample test for Ingredient.flavor_tags using TaggableManager
  • Plan to modularize form logic for reuse across views

βœ… Cocktail Forms & Views (NEW!)

  • Advanced Form System: Complete cocktail creation with inline formsets for multiple ingredients
  • Dynamic Ingredient Management: Add/remove ingredients with proper Django formset validation
  • Pure Django Solution: No JavaScript required - leverages Django's built-in formset capabilities
  • Comprehensive Views: Create, list, detail, and search functionality for cocktails
  • Professional Templates: Bootstrap-styled forms with proper error handling and user feedback
  • Search & Filter: Advanced cocktail filtering by ingredients, vessel type, alcohol content, and more

βœ… Git Workflow

  • Shell script created to update all local branches from remote (origin)
  • Testing strategy outlined using Django’s TestCase, setUpTestData, and assertions

🎯 MVP Goals

Core Features

  • User authentication (Sign Up / Sign In)
  • Dashboard with editable profile, user-created lists, and recipes
  • Ingredient and vessel management with reusable forms
  • Recipe creation with dynamic ingredient and vessel selection
  • Recipe catalog with filtering by vibe, flavor tags, and color
  • Error handling views for bad paths, restricted access, and failed requests

Technical Stack

  • Backend: Django + Postgres
  • Frontend: Django templates with vanilla CSS
  • Tagging: django-taggit for flavor profiles
  • Testing: Django’s built-in test framework
  • Version Control: Git + GitHub

✨ Stretch Goals

UX & Features

  • Social login (Google, GitHub)
  • Recipe remixing and forking
  • Ingredient detail pages with usage stats
  • Color picker or auto-detection for cocktail color
  • Vibe-based sorting (e.g., β€œCozy,” β€œTropical,” β€œParty”)
  • User badges or achievements (e.g., β€œCitrus Connoisseur”)

Technical Enhancements

  • API endpoints for recipes, ingredients, and lists
  • Responsive design with mobile-first layout
  • Inline form validation and error messaging
  • Admin dashboard for moderation or featured recipes
  • CI/CD pipeline with test coverage tracking

🍸 Cocktail Forms System (NEW!)

Overview

StirCraft now includes a comprehensive cocktail creation and management system using Django's inline formsets. This allows users to create complex cocktail recipes with multiple ingredients, measurements, and preparation notes in a single, intuitive form.

Key Components

Forms (cocktail_forms.py)

  • CocktailForm: Main cocktail information (name, description, instructions, vessel, tags)
  • RecipeComponentForm: Individual ingredient with amount, unit, and preparation notes
  • RecipeComponentFormSet: Manages multiple ingredients using Django's inlineformset_factory
  • QuickIngredientForm: For adding new ingredients on-the-fly (future modal integration)
  • CocktailSearchForm: Advanced search and filtering for cocktail browsing

Views

  • cocktail_create: Handles formset creation with proper validation and error handling
  • cocktail_index: Browse cocktails with search, filter, and pagination
  • cocktail_detail: Full recipe display with stats, ingredient details, and user actions

Templates

  • cocktail_create.html: Rich form interface with dynamic ingredient management
  • cocktail_index.html: Responsive cocktail browsing with search filters
  • cocktail_detail.html: Complete recipe display with nutritional info and actions

Features

Dynamic Form Management

  • Django formset handles multiple ingredients seamlessly
  • Automatic form validation for required fields
  • Smart alcohol content calculation based on ingredients
  • Order management for ingredient addition sequence

Advanced Validation

  • Minimum 1 ingredient required per cocktail
  • Maximum 15 ingredients to prevent abuse
  • Proper unit validation with predefined choices
  • Age verification integration for alcoholic beverages

User Experience

  • Bootstrap-styled responsive forms
  • Clear error messaging and field validation
  • Helpful tips and user guidance
  • Mobile-optimized form layouts

Search & Filter Capabilities

  • Text search across cocktail names and descriptions
  • Filter by specific ingredients or vessel types
  • Alcoholic/non-alcoholic filtering
  • Color-based filtering
  • Sort by creation date, name, or creator

Usage Examples

Creating a Cocktail

# In views.py - the formset handles both cocktail and ingredients
cocktail_form = CocktailForm(user=request.user)
formset = RecipeComponentFormSet()

# Form validates both main cocktail and all ingredients
if cocktail_form.is_valid() and formset.is_valid():
    cocktail = cocktail_form.save(commit=False)
    cocktail.creator = request.user
    cocktail.save()
    
    formset.instance = cocktail
    components = formset.save()

Template Integration

<!-- cocktail_create.html -->
{{ formset.management_form }}
{% for form in formset %}
    <div class="ingredient-row">
        {{ form.ingredient }}
        {{ form.amount }} {{ form.unit }}
        {{ form.preparation_note }}
    </div>
{% endfor %}

URLs Added

  • /cocktails/ - Browse all cocktails
  • /cocktails/create/ - Create new cocktail
  • /cocktails/<id>/ - View cocktail details

Technical Implementation Notes

Why Inline Formsets?

  1. Perfect Model Match: Your RecipeComponent join table is designed exactly for this pattern
  2. Clean Data Structure: Each ingredient has precise amount, unit, and preparation notes
  3. Django-Native: Uses built-in inlineformset_factory - no custom JavaScript required initially
  4. Scalable: Easy to enhance with AJAX and dynamic features later

Performance Optimizations

  • Uses select_related() and prefetch_related() for efficient queries
  • Pagination for large cocktail lists
  • Indexed database fields for fast searching
  • Minimal template queries with optimized context

Future Enhancements

  1. AJAX Integration: Add ingredients without page refresh
  2. Auto-suggestions: Typeahead for ingredient selection
  3. Recipe Import: Bulk import from cocktail APIs
  4. Image Uploads: Add cocktail photos
  5. Advanced Validation: Ingredient compatibility checking

  • StirCraft evokes creativity, modularity, and flavor exploration
  • Wireframes and UI lean into playful but clean design
  • Flavor tags and vibe filters support expressive, user-driven discovery

πŸ› οΈ Setup Instructions

Prerequisites

  • Python 3.12+
  • PostgreSQL
  • Git

πŸ” Environment Variables Setup (NEW!)

IMPORTANT: This project now uses secure environment variables for all secrets. Follow these steps carefully:

  1. Copy the environment template:

    cp .env.example .env
  2. Generate a new secret key:

    pipenv run python -c "from django.core.management.utils import get_random_secret_key; print('SECRET_KEY=' + get_random_secret_key())"
  3. Edit your .env file:

    # Edit .env and replace the SECRET_KEY with the generated one
    # Update your database password if different from the default
  4. NEVER commit .env files:

    • Your .env file contains secrets and is automatically ignored by git
    • Always use .env.example as a template for new environments
    • For production, use your platform's secret management (GitHub Actions secrets, AWS Parameter Store, etc.)

Database Setup

  1. Install and start PostgreSQL:

    # Ubuntu/Debian
    sudo apt-get install postgresql postgresql-contrib
    sudo systemctl start postgresql
    
    # macOS with Homebrew
    brew install postgresql
    brew services start postgresql
  2. Create database and user:

    sudo -u postgres createuser --interactive --pwprompt macfarley
    # Enter a secure password when prompted (update your .env file with this password)
    
    sudo -u postgres createdb --owner=macfarley stircraft
  3. Update your .env file:

    # Edit .env and set your actual database password
    DATABASE_URL=postgres://macfarley:your-actual-password@localhost:5432/stircraft

Application Setup

  1. Clone the repository:

    git clone https://github.com/General-Assembly-Team-1/stir-craft.git
  2. Navigate to the project directory:

    cd stir-craft
  3. Copy environment template:

    cp .env.example .env
    # Then edit .env with your actual values (see above)
  4. Install dependencies:

    pipenv install
  5. Activate the virtual environment:

    pipenv shell
  6. Navigate to the Django project:

    cd stircraft
  7. Apply database migrations:

    # No need to export DB_PASSWORD - it's now read from .env automatically
    python manage.py migrate
  8. Seed the database with cocktail data:

    # Import a small test batch (10 cocktails)  
    python manage.py seed_from_thecocktaildb --limit 10
    
    # Import 100 cocktails from all letters
    python manage.py seed_from_thecocktaildb --limit 100
    
    # Import ALL available cocktails (could be 500+)
    python manage.py seed_from_thecocktaildb
  9. Create a superuser:

    python manage.py createsuperuser
  10. Run the development server:

    python manage.py runserver
  11. Access the application:

πŸ”’ Security Notes

For Development

  • Always use .env.example as your template
  • Generate a unique SECRET_KEY for your local environment
  • Never commit your .env file to version control
  • Use secure database passwords (not the ones shown in documentation)

For Production

  • Use your platform's secret management system:
    • GitHub Actions: Repository secrets (Settings β†’ Secrets and variables β†’ Actions)
    • Heroku: Config vars (Settings β†’ Config Vars)
    • AWS: Parameter Store or Secrets Manager
    • Docker: Environment variables or secret mounts
  • Set DEBUG=False in production
  • Use strong, unique passwords for all services
  • Configure proper ALLOWED_HOSTS for your domain

For Team Collaboration

  • Each team member should create their own .env file
  • Share configuration requirements via .env.example
  • Document any new environment variables in .env.example
  • Use different database passwords for each developer

πŸ“Š Data Management

Cocktail Data Seeding

The project includes a comprehensive management command to populate the database with real cocktail data from TheCocktailDB API:

# Basic usage - import 10 cocktails for testing
python manage.py seed_from_thecocktaildb --limit 10

# Import specific number of cocktails
python manage.py seed_from_thecocktaildb --limit 50

# Import from specific letters only
python manage.py seed_from_thecocktaildb --letters abc --limit 20

# Import ALL available cocktails (500+)
python manage.py seed_from_thecocktaildb

# Clear existing data and start fresh
python manage.py seed_from_thecocktaildb --clear --limit 25

What Gets Imported

  • Cocktails: Name, instructions, image URLs, categories
  • Ingredients: Automatically categorized (spirits, liqueurs, mixers, etc.) with alcohol content estimation
  • Vessels: Glassware types matched to StirCraft's vessel system
  • Recipe Components: Measurements parsed from text to structured data
  • Flavor Tags: Intelligent tagging for advanced filtering

Data Processing Features

  • Smart Categorization: Ingredients are automatically categorized as spirits, liqueurs, mixers, etc.
  • Measurement Parsing: Text measurements like "1 oz" or "2 dashes" are converted to structured data
  • Alcohol Content: Estimated alcohol percentages for ingredients
  • Duplicate Prevention: Uses get_or_create() to avoid duplicate entries
  • Error Handling: Robust error recovery and detailed logging

🌟 Join the StirCraft Community

πŸš€ Start Your Mixology Journey Today

🌐 Visit StirCraft Live

Whether you're a professional bartender, cocktail enthusiast, or just starting your mixology journey, StirCraft provides everything you need to discover, create, and organize amazing cocktail recipes.

πŸ“ž Connect & Contribute

  • πŸ› Report Issues: Found a bug? We want to fix it!
  • πŸ’‘ Feature Ideas: Have a suggestion? We'd love to hear it!
  • 🀝 Contribute: This is an open-source project welcoming contributions
  • πŸ“§ Contact: Reach out for collaboration opportunities

πŸ† Built with Excellence

StirCraft represents modern web development best practices:

  • βœ… Test-Driven Development (245 Python + 23 JavaScript tests passing)
  • βœ… Responsive Design (Mobile-first approach)
  • βœ… Security-First (Production-ready security headers)
  • βœ… Performance Optimized (Static file compression, efficient queries)
  • βœ… Accessible (WCAG compliant design)

🍸 Crafted with passion for the art of mixology
Made with Django 5.2.5 β€’ Bootstrap 5 β€’ PostgreSQL β€’ Love

Start Mixing Now β†’


🧠 Contribution Guidelines

  1. Create a personal branch:

    git checkout -b <your-branch-name>
  2. Commit changes to your branch:

    git add .
    git commit -m "Your commit message"
  3. Push your branch:

    git push origin <your-branch-name>
  4. Open a pull request for review.


πŸ“š Documentation

For detailed technical documentation, development guides, and project history, see the docs/ folder:


For questions or support, please refer to the documentation or contact the development team.

About

a Cocktail and Mocktail app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 41.6%
  • JavaScript 24.5%
  • CSS 16.0%
  • HTML 15.1%
  • Shell 2.4%
  • Dockerfile 0.3%
  • Procfile 0.1%