An Intelligent Full-Stack AI Kitchen Companion built with Java 25, Spring Boot 3, and Multimodal AI.
Smart Fridge Vision β’ Hands-Free Voice Cooking β’ Zero-Waste Recipes β’ Health Diets β’ 1-Click Ordering
Cooknetic AI solves the everyday problem: "What can I cook with whatever is left in my fridge right now?"
Just snap a photo of your fridge or pantry, and the AI automatically detects your ingredients, suggests instant step-by-step recipes, calculates calories, and guides you with touchless voice commands!
This project demonstrates strong full-stack software engineering fundamentals and modern AI integration:
- Full-Stack Architecture: Clean separation of concerns following the MVC (Model-View-Controller) pattern with Java 25 & Spring Boot 3.3.5.
- Dual-Core AI Engine (Graceful Degradation): Supports Google Gemini Multimodal AI for cloud intelligence, with a built-in Embedded Neural Knowledge Engine fallback so the application never crashes or fails offline.
- RESTful API Design: 14+ clean, structured REST endpoints handling complex payloads, base64 images, and streaming responses.
- Real-Time Hardware & Web APIs: Live webcam frame extraction, Web Speech-to-Text (
SpeechRecognition), and Text-to-Speech (SpeechSynthesis) for hands-free cooking. - Social Impact: Promotes Zero-Waste Sustainability by turning leftover food scraps into gourmet dishes (reducing food waste by up to 98%).
| Feature | What It Does | Why It's Useful |
|---|---|---|
| πΈ AI Fridge Scanner | Takes a photo via your webcam or upload and identifies ingredients automatically. | No need to type ingredients manually. |
| π©βπ³ The Kitchen Talk | Chat with 4 AI personas: Desi Mom, Michelin Chef, Hostel Student, and Fitness Coach. | Get personalized recipes matching your exact mood and budget. |
| π€ Hands-Free Voice Cook | Listen to step-by-step instructions and speak your questions out loud. | Keep cooking without touching your dirty phone screen. |
| β»οΈ Zero-Waste AutoChef | Turn leftover rice, bread, and vegetable peels into brand-new dishes. | Saves money and prevents daily kitchen food wastage. |
| π AI Meal Planner & Grocery Hub | Generate customized daily/weekly meal schedules and instant shopping checklists. | Plan meals based on weight loss, muscle gain, or balanced targets. |
| π Nutrition & Calorie Counter | Calculates Calories, Protein, Carbs, Fats, and a 0-100 Health Score Index. | Perfect for tracking fitness and dietary health. |
| π Smart Food Swap Engine | Find exact substitutes for missing or allergic ingredients (e.g. butter, eggs, flour). | Never stop a recipe because you're missing one item. |
| π©Ί Clinical Health Diets | Doctor-approved dietary guidance for conditions like Diabetes, High BP, PCOS, and Thyroid. | Safe food recommendations with clear "Allowed vs. Avoid" lists. |
| π 1-Click Food Delivery | Search any recipe directly on Swiggy, Zomato, and UberEats. | Instant order option when you don't feel like cooking. |
| π¨βπ³ Master Chefs & Contests | Book private home chefs and participate in cooking contests judged by an AI MasterChef judge. | Community, competitive cooking, and culinary discovery. |
- Language: Java 25 (LTS)
- Framework: Spring Boot 3.3.5 (Spring MVC, Embedded Tomcat 10)
- JSON Parser: Jackson Databind
- HTTP Client:
java.net.http.HttpClient - Build Tool: Apache Maven 3.9+
- Cloud LLM: Google Gemini 1.5 Flash API (Multimodal Image Analysis & Chat)
- Embedded Knowledge Core: 500+ Ingredient Knowledge Base, Ayurvedic Rules, and Macro Calculus
- Styling: Modern Glassmorphism CSS3 with Dark/Light Mode toggle
- Hardware APIs: HTML5 MediaDevices (Webcam) & Canvas API
- Audio APIs: Web Speech API (
SpeechRecognition+SpeechSynthesis)
[ User Browser / Client ]
β
βΌ (HTTP / JSON)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Java 25 & Spring Boot 3.3.5 Backend β
β β
β [ ApiController.java ] ββββΊ [ AiService.java ] β
β β β β
β βΌ βΌ β
β [ DataStore.java ] ββββββββββββββββββββββββββ β
β (In-Memory Database) β Hybrid AI Engine β β
β β βββ Google Gemini API β β
β β βββ Neural Knowledge β β
β ββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
[ Swiggy / Zomato / UberEats Deep Search ]
- Java JDK 21 or 25 (Download OpenJDK)
- Maven 3.9+ (Download Maven) (Optional if running pre-built JAR)
git clone https://github.com/123angmish/Cooknetic-AI.git
cd Cooknetic-AIDouble-click start.bat in the project folder.
# Build and Run
mvn clean package -DskipTests
java -jar target/cooknetic-ai-2.0.0.jarVisit: http://localhost:8080
π‘ Note: Cooknetic AI works 100% out of the box with zero setup. If you'd like to use Google Gemini Cloud AI directly, you can optionally set:
export GEMINI_API_KEY="your_api_key_here" # Linux / Mac $env:GEMINI_API_KEY="your_api_key_here" # Windows PowerShell
| HTTP Method | Endpoint | Purpose | Example Payload |
|---|---|---|---|
GET |
/health |
Server Health & AI Status | β |
POST |
/api/chat |
AI Kitchen Talk (Mom/Chef) | {"message": "What to make with paneer?", "persona": "mom"} |
POST |
/api/vision |
Scan food from image | {"imageBase64": "data:image/jpeg;base64,..."} |
POST |
/api/zero-waste |
Zero-waste leftover meal | {"leftovers": ["Rice", "Tomatoes", "Onion"]} |
POST |
/api/nutrition |
Nutrition & macro breakdown | {"dishName": "Palak Paneer with Roti"} |
POST |
/api/meal-plan |
Personalized AI meal schedule | {"goal": "Muscle Building", "calories": 2000} |
POST |
/api/grocery-list |
Categorized shopping checklist | {"dishes": ["Paneer Bhurji", "Dal Khichdi"]} |
POST |
/api/swap |
Ingredient substitution ratio | {"ingredient": "Butter", "dietaryRestriction": "Vegan"} |
POST |
/api/disease-diet |
Clinical disease dietary guide | {"condition": "Diabetes"} |
Q1: Why did you choose Java & Spring Boot for an AI application?
Answer: Spring Boot provides enterprise-grade robustness, thread safety, strong type safety, and high-performance throughput. Its clean MVC separation makes it easy to maintain, scale, and integrate external AI microservices via non-blocking HTTP clients.
Q2: How does the app handle API rate limits or offline situations?
Answer: We implemented a Dual-Layer Graceful Degradation Architecture. When the Google Gemini API is available, it provides real-time generative capabilities. If an API key is missing or internet connectivity drops, the system seamlessly falls back to our embedded Neural Culinary Knowledge Engine, ensuring 100% uptime with zero user-facing errors.
Q3: How does the Vision Scanner process images?
Answer: The frontend captures video frames using the HTML5 Canvas & MediaDevices API and converts them into optimized base64 JPEG strings. The backend parses this data and streams it to Google Gemini's multimodal vision endpoint, which returns structured JSON ingredient arrays and curated recipes.
Cooknetic-AI/
βββ src/main/java/com/cooknetic/
β βββ CookneticApplication.java # Spring Boot entry point
β βββ config/WebConfig.java # CORS & static asset routing
β βββ controller/ApiController.java # REST API controller
β βββ service/
β βββ AiService.java # Gemini API + Neural fallback engine
β βββ DataStore.java # In-memory data repository
βββ final_cooknetic/ # Modern web frontend
β βββ index.html # Home & AI search hub
β βββ mom_mode.html # Kitchen Talk AI chat
β βββ camera.html # AI vision camera scanner
β βββ voice.html # Voice assistant
β βββ meal_planner.html # AI Meal Planner & Grocery checklist
β βββ zero_waste.html # Zero-waste recipe maker
β βββ nutrition.html # Nutrition & calorie calculator
β βββ engine.html # Food swap engine
β βββ cultural.html # Cultural spice explorer
β βββ disease.html # Disease & health diet guide
β βββ delivery.html # Global recipes & delivery links
β βββ chefs.html # Hire master chefs
β βββ conttest.html # Contests & AI judge
β βββ profile.html # User profile & saved recipes
β βββ app.css # Glassmorphism design system
β βββ nav.js # Global navigation & theme manager
βββ pom.xml # Maven project configuration
βββ start.bat # 1-Click Windows launch script
βββ README.md # Documentation
- Developer: Angel Mishra
- GitHub: @123angmish
- Repository: Cooknetic-AI
Distributed under the MIT License. Feel free to fork, star β, and contribute!