An AI-powered web application that transforms ingredient photos into personalized recipe recommendations.
Live Demo β’ Report Bug β’ Request Feature
- Overview
- Key Features
- Live Demo
- Tech Stack
- Architecture
- Project Structure
- Getting Started
- Security Features
- Performance
- Connect With Me
Recipe Hub is a production-grade web application that empowers home chefs to discover recipes based on ingredients they already have. Simply upload photos of your ingredients, and let Azure Computer Vision AI identify them automatically. The app then suggests personalized recipes using the Spoonacular API, eliminating food waste and inspiring culinary creativity.
Built with scalability, security, and user experience in mind, Recipe Hub features a load-balanced multi-instance architecture, OAuth integration, and comprehensive security hardening.
- Upload ingredient photos using Azure Computer Vision API
- Automatic ingredient identification and tagging
- Smart ingredient management with virtual pantry
- Spoonacular API integration for 1M+ recipes
- Personalized recommendations based on available ingredients
- Favorite and save recipes to your account
- Global cuisine exploration with dietary filters
- Traditional email/password signup with email verification
- Google OAuth 2.0 integration for quick sign-in
- Secure password reset flow with time-limited tokens
- Session management with Flask-Login
- Password hashing with Bcrypt
- CSRF protection on all forms
- Network segregation with Docker (frontend/backend networks)
- Environment-based secrets management
- GDPR-compliant cookie consent
- Load-balanced deployment (3 Gunicorn instances)
- PostgreSQL database with automated migrations
- Docker Compose orchestration
- Fault-tolerant multi-instance setup
- Health monitoring and auto-restart
- Responsive design with Bootstrap 5
- Smooth animations using AOS library
- Google Analytics integration
- SEO-optimized with meta tags, sitemap, and structured data
- Progressive enhancement for all devices
Experience Recipe Hub: recipe.vladbortnik.dev
The application is deployed on a production server with:
- β Load balancing across 3 instances
- β SSL/TLS encryption
- β Automated database migrations
- β Zero-downtime deployments
- β Health monitoring
- Flask 3.0+: Lightweight WSGI web framework
- Gunicorn: Production WSGI server for concurrent request handling
- PostgreSQL: Robust relational database
- SQLAlchemy: Pythonic ORM with relationship management
- Flask-Migrate: Alembic-based database migrations
- Flask-Login: User session management
- Flask-Bcrypt: Secure password hashing
- Authlib: Google OAuth 2.0 integration
- Flask-WTF: Form validation & CSRF protection
- python-dotenv: Environment variable management
- Jinja2: Server-side templating engine
- Bootstrap 5: Responsive UI framework
- Font Awesome: Icon library
- AOS: Scroll animation library
- Google Fonts: Typography (Nunito)
- Azure Computer Vision: AI-powered ingredient recognition from images
- Spoonacular API: Recipe database and nutrition information
- Docker: Containerization
- Docker Compose: Multi-container orchestration
- Nginx: Reverse proxy and load balancer (upstream deployment)
- Git: Version control
βββββββββββββββββββββββββββββββββββββββββββββββ
β Nginx Load Balancer β
β (Upstream Infrastructure) β
ββββββββββββββ¬βββββββββββββ¬ββββββββββββββββββββ
β β
βββββββββββ΄βββββ¬ββββββββ΄βββββ¬ββββββββββββββ
β β β β
ββββΌββββ βββββΌβββ βββββΌβββ β
β web1 β β web2 β β web3 β β
β:5002 β β:5003 β β:5004 β β
ββββ¬ββββ βββββ¬βββ βββββ¬βββ β
β β β β
βββββββββββββββ΄ββββββββββββββ΄βββββββββββββββ
β
ββββββββΌβββββββ
β PostgreSQL β
β Database β
β (db:5432) β
βββββββββββββββ
- Frontend Network: Public-facing web services
- Backend Network: Database access (internal only)
- No exposed database ports to host machine
- Internal DNS resolution between containers
recipe-web-app/
βββ app/
β βββ __init__.py # Flask app factory
β βββ config.py # Configuration management
β βββ models.py # SQLAlchemy database models
β βββ routes.py # Application routes & views
β βββ forms.py # WTForms definitions
β βββ utils.py # Helper functions (API calls, email)
β βββ templates/ # Jinja2 HTML templates
β β βββ layout.html # Base template (SEO-optimized)
β β βββ index.html # Landing page
β β βββ dashboard.html # User dashboard
β β βββ upload.html # Image upload interface
β β βββ login.html # Login page
β β βββ signup.html # Registration page
β β βββ ...
β βββ static/ # CSS, images, favicon
β βββ main.css
β βββ robots.txt
β βββ favicon.ico
βββ migrations/ # Database migration files
βββ docker-compose.yml # Multi-container setup
βββ Dockerfile # Container definition
βββ entrypoint.sh # Startup script (migrations)
βββ requirements.txt # Python dependencies
βββ .env-example # Environment variables template
βββ GITHUB-ABOUT-SECTION.md # GitHub repository metadata
βββ README.md # This file
- Docker 20.10+
- Docker Compose 2.0+
- Python 3.9+ (optional, for local development)
-
Clone the repository
git clone https://github.com/vladbortnik/recipe-web-app.git cd recipe-web-app -
Set up environment variables
cp .env-example .env
Edit
.envand add your API keys:SECRET_KEY=your-secret-key DATABASE_URL=postgresql://user:password@db:5432/recipe_db # Azure Computer Vision AZURE_VISION_KEY=your-azure-key AZURE_VISION_ENDPOINT=your-azure-endpoint # Spoonacular API SPOONACULAR_API_KEY=your-spoonacular-key # Google OAuth (optional) GOOGLE_CLIENT_ID=your-google-client-id GOOGLE_CLIENT_SECRET=your-google-client-secret # Email (for password reset) MAIL_SERVER=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME=your-email@gmail.com MAIL_PASSWORD=your-app-password
-
Build and run with Docker Compose
docker-compose up --build -d
-
Access the application
- Web Instance 1: http://localhost:5002
- Web Instance 2: http://localhost:5003
- Web Instance 3: http://localhost:5004
-
View logs (optional)
docker-compose logs -f web1 web2 web3
-
Stop the application
docker-compose down
Migrations are handled automatically by entrypoint.sh. No manual intervention required.
For manual migration management:
# Access container
docker exec -it <container_name> /bin/bash
# Create migration
flask db migrate -m "Description"
# Apply migration
flask db upgrade| Feature | Implementation | Purpose |
|---|---|---|
| Password Hashing | Bcrypt with salt | Secure credential storage |
| CSRF Protection | Flask-WTF tokens | Prevent cross-site attacks |
| Network Isolation | Docker networks | Database not exposed to host |
| OAuth 2.0 | Google Sign-In | Secure third-party authentication |
| Environment Variables | python-dotenv | No hardcoded secrets |
| Route Protection | @login_required | Authenticated-only endpoints |
| Session Management | Flask-Login | Secure user sessions |
| Email Verification | Time-limited tokens | Prevent fake accounts |
- Load Balancing: 3 Gunicorn worker instances
- Concurrent Requests: 6+ workers per instance (18+ total)
- Database Connection Pooling: SQLAlchemy pool management
- Static Asset Caching: Browser caching headers
- Lazy Loading: AOS animations on scroll
- Fault Tolerance: Auto-restart on failure
Built with real production experience by Vlad Bortnik
Software Engineer | Frontend (React 19) β Backend (Flask, PostgreSQL) β Infrastructure (Docker, Nginx, Cloud)
vladbortnik.dev β’ Contact β’ CS degree β’ NYC π½
Last updated: December 2025