help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • Blog
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
recipe-assistant-bot
/
static
/
js
RSK World
recipe-assistant-bot
Recipe Assistant Bot - Python + Flask + AI Chatbot + Recipe Suggestions + Cooking Tips + Meal Planning
js
  • chat.js10 KB
RELEASE_NOTES.mdsmart_recovery.cpython-313.pycchat.js
RELEASE_NOTES.md
Raw Download

RELEASE_NOTES.md

# Release Notes - Recipe Assistant Bot

## Version 1.0.0 - Initial Release
**Release Date:** January 9, 2026
**GitHub Repository:** [rskworld/recipe-assistant-bot](https://github.com/rskworld/recipe-assistant-bot)

---

## 🎉 Welcome to Recipe Assistant Bot!

A comprehensive AI-powered cooking assistant chatbot with advanced features for recipe management, meal planning, ingredient tracking, and smart kitchen integration.

---

## ✨ Core Features

### 🍳 Recipe Management
- **Recipe Search & Discovery**: Find recipes by ingredients, cuisine, dietary restrictions
- **Recipe Details**: Comprehensive recipe information with ingredients, instructions, and nutrition
- **Recipe Scaling**: Automatically scale recipes to different serving sizes
- **Recipe Variations**: Generate cuisine variations (Italian, Mexican, Asian, etc.), dietary alternatives (vegan, gluten-free, keto), and spice level adjustments
- **Recipe Collections**: Create custom cookbooks and organize recipes into collections

### 🤖 AI-Powered Features
- **Smart Chatbot**: Natural language processing for recipe queries
- **Cooking Assistant**: Step-by-step AI-guided cooking sessions
- **Recipe Recommendations**: Personalized recipe suggestions based on preferences
- **Leftover Suggestions**: Find recipes based on available ingredients

### 📦 Ingredient Management
- **Inventory Tracking**: Track ingredients with expiry dates, quantities, and storage locations
- **Shopping Lists**: Generate shopping lists from recipes with price estimation
- **Expiry Alerts**: Get notified about expiring ingredients
- **Recipe Matching**: Find recipes based on your current inventory

### 📅 Meal Planning
- **Meal Prep Planning**: Create weekly meal prep plans with batch cooking schedules
- **Personalized Meal Plans**: AI-generated meal plans based on dietary preferences
- **Prep Timeline**: Step-by-step meal prep timeline with storage instructions
- **Nutrition Tracking**: Track daily nutrition goals and progress

### 🏆 Gamification
- **Cooking Challenges**: Create and participate in cooking challenges
- **Achievement Badges**: Earn badges for completing recipes and challenges
- **Cooking Statistics**: Track your cooking journey with detailed stats
- **Progress Tracking**: Monitor your cooking streak and milestones

### 🏠 Smart Kitchen Integration
- **Device Control**: Integrate with smart kitchen devices (ovens, scales, thermometers)
- **Cooking Sessions**: Real-time monitoring and control of cooking devices
- **Automation Rules**: Create automation rules for smart devices
- **Device Analytics**: Track device usage and efficiency

### 🎤 Voice Assistant
- **Voice Commands**: Control the bot with voice commands
- **Text-to-Speech**: Get recipe instructions read aloud
- **Voice Search**: Search recipes using voice
- **Hands-free Cooking**: Cook without touching your device

### 📸 Image Recognition
- **Recipe from Image**: Generate recipes from food images
- **Ingredient Detection**: Identify ingredients from photos
- **Recipe Recognition**: Recognize recipes from ingredient images

### ⭐ Reviews & Ratings
- **Recipe Reviews**: Rate and review recipes
- **Detailed Feedback**: Provide pros, cons, and detailed comments
- **Recipe Statistics**: View recipe ratings and statistics
- **Helpful Votes**: Mark reviews as helpful

---

## 🚀 Advanced Features (New in v1.0.0)

### Recipe Operations
- Recipe scaling for any serving size
- Recipe variations generator
- Leftover ingredient recipe suggestions

### Inventory Management
- Complete inventory tracking system
- Expiry date management
- Location-based organization (pantry, fridge, freezer)
- Recipe suggestions from inventory

### Collections & Cookbooks
- Custom recipe collections
- Public/private collections
- Tag-based organization
- Collection sharing

### Cooking Challenges
- Weekly recipe challenges
- Technique mastery challenges
- Cuisine exploration challenges
- Progress tracking and rewards

### Meal Prep Planning
- Weekly meal prep schedules
- Batch cooking recommendations
- Storage instructions
- Prep timeline management

### Statistics & Tracking
- Cooking statistics dashboard
- Recipe history tracking
- Cooking streaks
- Favorite cuisine tracking

---

## 📋 API Endpoints

### Recipe Endpoints
- `GET /api/recipes` - Get recipe suggestions
- `POST /api/recipe/scale` - Scale recipe servings
- `POST /api/recipe/variations` - Get recipe variations
- `POST /api/recipe/leftover-suggestions` - Get leftover recipes

### Chat & Search
- `POST /api/chat` - Chat with AI assistant
- `POST /api/search` - Search recipes

### Inventory
- `GET /api/inventory` - Get inventory
- `POST /api/inventory/add` - Add to inventory
- `PUT /api/inventory/update` - Update inventory
- `DELETE /api/inventory/remove` - Remove from inventory
- `GET /api/inventory/recipes` - Get recipes from inventory

### Collections
- `GET /api/collections` - Get collections
- `POST /api/collections` - Create collection
- `POST /api/collections/<id>/recipes` - Add recipe to collection

### Challenges
- `GET /api/challenges` - Get challenges
- `POST /api/challenges` - Create challenge
- `POST /api/challenges/<id>/complete` - Complete challenge recipe

### Meal Prep
- `POST /api/meal-prep/create` - Create meal prep plan

### Statistics
- `GET /api/stats/cooking` - Get cooking statistics
- `POST /api/stats/track-recipe` - Track cooked recipe

### And many more... (70+ endpoints total)

---

## 🛠️ Technology Stack

- **Backend**: Python 3.8+, Flask 2.3.3
- **Frontend**: HTML5, CSS3, JavaScript, Bootstrap 5
- **APIs**: Recipe APIs, OpenAI API (optional)
- **Database**: SQLite (default), configurable
- **Additional**: Flask-CORS, Requests, Python-dotenv

---

## 📦 Installation

```bash
# Clone the repository
git clone https://github.com/rskworld/recipe-assistant-bot.git
cd recipe-assistant-bot

# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run the application
python run.py
```

---

## 📚 Documentation

- **README.md** - Complete project documentation
- **ADVANCED_FEATURES.md** - Advanced features documentation
- **ERROR_CHECK_REPORT.md** - Code quality report
- **API Documentation** - Available in routes.py

---

## 👥 Credits

**Author:** RSK World
**Website:** [rskworld.in](https://rskworld.in)
**Founder:** Molla Samser
**Designer & Tester:** Rima Khatun
**Contact:** help@rskworld.in, +91 93305 39277
**Location:** Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India - 713147

---

## 📄 License

This project is created for educational purposes by RSK World. Content used for educational purposes only.

---

## 🌟 Features Overview

- ✅ 70+ API Endpoints
- ✅ Advanced Recipe Management
- ✅ AI-Powered Cooking Assistant
- ✅ Ingredient Inventory System
- ✅ Meal Prep Planning
- ✅ Smart Kitchen Integration
- ✅ Cooking Challenges & Gamification
- ✅ Recipe Collections & Cookbooks
- ✅ Voice Assistant Integration
- ✅ Image Recognition
- ✅ Reviews & Ratings System
- ✅ Nutrition Tracking
- ✅ Shopping List Generation
- ✅ Recipe Scaling & Variations
- ✅ Leftover Recipe Suggestions

---

## 🔮 Future Enhancements

- Database migration for persistent storage
- Real-time notifications
- Social sharing features
- Recipe video integration
- Enhanced AI recommendations
- Mobile app development
- Recipe cost calculator
- Seasonal recipe suggestions

---

## 📞 Support

- **Website:** https://rskworld.in
- **Email:** help@rskworld.in
- **Phone:** +91 93305 39277

---

**© 2026 RSK World. All rights reserved.**
*Educational Purpose Project*
static/js/chat.js
Raw Download
Find: Go to:
/**
 * Recipe Assistant Bot - Chat JavaScript
 * Author: RSK World (https://rskworld.in)
 * Founder: Molla Samser
 * Designer & Tester: Rima Khatun
 * Contact: help@rskworld.in, +91 93305 39277
 * Year: 2026
 */

class RecipeChatBot {
    constructor() {
        this.chatContainer = document.getElementById('chatMessages');
        this.messageInput = document.getElementById('messageInput');
        this.sendButton = document.getElementById('sendButton');
        this.quickSuggestions = document.querySelectorAll('.quick-suggestion');
        this.isListening = false;
        this.recognition = null;
        
        this.init();
    }
    
    init() {
        // Event listeners
        this.sendButton.addEventListener('click', () => this.sendMessage());
        this.messageInput.addEventListener('keypress', (e) => {
            if (e.key === 'Enter') {
                this.sendMessage();
            }
        });
        
        // Quick suggestion buttons
        this.quickSuggestions.forEach(button => {
            button.addEventListener('click', () => {
                const message = button.getAttribute('data-message');
                this.messageInput.value = message;
                this.sendMessage();
            });
        });
        
        // Initialize voice input if supported
        this.initVoiceInput();
        
        // Focus on input
        this.messageInput.focus();
    }
    
    initVoiceInput() {
        if ('webkitSpeechRecognition' in window || 'SpeechRecognition' in window) {
            const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
            this.recognition = new SpeechRecognition();
            this.recognition.continuous = false;
            this.recognition.interimResults = false;
            this.recognition.lang = 'en-US';
            
            this.recognition.onstart = () => {
                this.isListening = true;
                this.updateVoiceButton();
            };
            
            this.recognition.onresult = (event) => {
                const transcript = event.results[0][0].transcript;
                this.messageInput.value = transcript;
                this.isListening = false;
                this.updateVoiceButton();
            };
            
            this.recognition.onerror = (event) => {
                console.error('Speech recognition error:', event.error);
                this.isListening = false;
                this.updateVoiceButton();
                this.showError('Voice recognition failed. Please try again.');
            };
            
            this.recognition.onend = () => {
                this.isListening = false;
                this.updateVoiceButton();
            };
            
            // Add voice button to input group
            this.addVoiceButton();
        }
    }
    
    addVoiceButton() {
        const voiceButton = document.createElement('button');
        voiceButton.className = 'btn btn-outline-secondary';
        voiceButton.type = 'button';
        voiceButton.id = 'voiceButton';
        voiceButton.innerHTML = '<i class="fas fa-microphone"></i>';
        voiceButton.title = 'Voice Input (Click to speak)';
        
        voiceButton.addEventListener('click', () => this.toggleVoiceInput());
        
        const inputGroup = this.messageInput.parentElement;
        inputGroup.insertBefore(voiceButton, this.sendButton);
    }
    
    toggleVoiceInput() {
        if (!this.recognition) {
            this.showError('Voice input is not supported in your browser.');
            return;
        }
        
        if (this.isListening) {
            this.recognition.stop();
        } else {
            this.recognition.start();
        }
    }
    
    updateVoiceButton() {
        const voiceButton = document.getElementById('voiceButton');
        if (voiceButton) {
            if (this.isListening) {
                voiceButton.innerHTML = '<i class="fas fa-microphone-slash"></i>';
                voiceButton.className = 'btn btn-danger';
                voiceButton.title = 'Stop Recording';
            } else {
                voiceButton.innerHTML = '<i class="fas fa-microphone"></i>';
                voiceButton.className = 'btn btn-outline-secondary';
                voiceButton.title = 'Voice Input (Click to speak)';
            }
        }
    }
    
    async sendMessage() {
        const message = this.messageInput.value.trim();
        
        if (!message) {
            this.showError('Please enter a message');
            return;
        }
        
        // Add user message to chat
        this.addMessage(message, 'user');
        
        // Clear input
        this.messageInput.value = '';
        
        // Show loading indicator
        this.showLoading();
        
        try {
            // Send message to backend
            const response = await fetch('/api/chat', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json',
                },
                body: JSON.stringify({ message: message })
            });
            
            const data = await response.json();
            
            // Remove loading indicator
            this.removeLoading();
            
            if (data.status === 'success') {
                this.addMessage(data.response, 'bot');
            } else {
                this.showError(data.error || 'An error occurred');
            }
            
        } catch (error) {
            this.removeLoading();
            this.showError('Network error. Please try again.');
            console.error('Chat error:', error);
        }
    }
    
    addMessage(content, sender) {
        const messageDiv = document.createElement('div');
        messageDiv.className = `message ${sender}-message`;
        
        const messageContent = document.createElement('div');
        messageContent.className = 'message-content';
        
        const senderLabel = sender === 'bot' ? 'Recipe Bot:' : 'You:';
        messageContent.innerHTML = `<strong>${senderLabel}</strong> ${this.formatMessage(content)}`;
        
        messageDiv.appendChild(messageContent);
        this.chatContainer.appendChild(messageDiv);
        
        // Scroll to bottom
        this.scrollToBottom();
    }
    
    formatMessage(content) {
        // Convert newlines to <br>
        let formatted = content.replace(/\n/g, '<br>');
        
        // Convert bullet points to proper HTML lists
        formatted = formatted.replace(/•\s([^•\n]+)/g, '<li>$1</li>');
        formatted = formatted.replace(/(<li>.*<\/li>)/s, '<ul>$1</ul>');
        
        // Convert numbered lists
        formatted = formatted.replace(/(\d+\.\s)/g, '<br>$1');
        
        return formatted;
    }
    
    showLoading() {
        const loadingDiv = document.createElement('div');
        loadingDiv.className = 'message bot-message loading-message';
        loadingDiv.innerHTML = `
            <div class="message-content">
                <strong>Recipe Bot:</strong> 
                <span class="loading-spinner"></span> Thinking...
            </div>
        `;
        this.chatContainer.appendChild(loadingDiv);
        this.scrollToBottom();
    }
    
    removeLoading() {
        const loadingMessage = this.chatContainer.querySelector('.loading-message');
        if (loadingMessage) {
            loadingMessage.remove();
        }
    }
    
    showError(message) {
        const errorDiv = document.createElement('div');
        errorDiv.className = 'message bot-message error-message';
        errorDiv.style.backgroundColor = '#f8d7da';
        errorDiv.style.borderLeftColor = '#dc3545';
        errorDiv.innerHTML = `
            <div class="message-content">
                <strong>Recipe Bot:</strong> 
                <span style="color: #721c24;">${message}</span>
            </div>
        `;
        this.chatContainer.appendChild(errorDiv);
        this.scrollToBottom();
    }
    
    scrollToBottom() {
        this.chatContainer.scrollTop = this.chatContainer.scrollHeight;
    }
}

// Additional utility functions
function showNotification(message, type = 'info') {
    // Create notification element
    const notification = document.createElement('div');
    notification.className = `alert alert-${type} alert-dismissible fade show position-fixed`;
    notification.style.cssText = 'top: 20px; right: 20px; z-index: 1050; max-width: 300px;';
    notification.innerHTML = `
        ${message}
        <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
    `;
    
    document.body.appendChild(notification);
    
    // Auto remove after 5 seconds
    setTimeout(() => {
        if (notification.parentNode) {
            notification.remove();
        }
    }, 5000);
}

// Initialize chatbot when DOM is loaded
document.addEventListener('DOMContentLoaded', () => {
    window.recipeChatBot = new RecipeChatBot();
    
    // Add some helpful keyboard shortcuts
    document.addEventListener('keydown', (e) => {
        // Ctrl/Cmd + K to focus input
        if ((e.ctrlKey || e.metaKey) && e.key === 'k') {
            e.preventDefault();
            document.getElementById('messageInput').focus();
        }
        
        // Escape to clear input
        if (e.key === 'Escape') {
            document.getElementById('messageInput').value = '';
        }
    });
    
    // Show welcome notification
    setTimeout(() => {
        showNotification('Welcome to Recipe Assistant Bot! Ask me about recipes, ingredients, or cooking tips.', 'success');
    }, 1000);
});

// Error handling for network issues
window.addEventListener('online', () => {
    showNotification('Connection restored!', 'success');
});

window.addEventListener('offline', () => {
    showNotification('Connection lost. Some features may not work.', 'warning');
});
295 lines•10 KB
javascript

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer