The Offline-First Sensory Food Interface
MoodBite is a sophisticated emotional regulation system that uses culinary intervention to balance human mood states. Unlike generic AI wrappers, it runs on a custom Deterministic Emotional Vector Machine (EVM), allowing for high-precision, offline emotion detection and reasoning.
🌐 Live Demo: https://moodbiteai.vercel.app/
The core of MoodBite v3.0 relies on an "Expert Panel" architecture where multiple specialized logic modules vote on the user's state before a final "Judge" determines the emotional vector.
graph TD
User([User]) -->|Text/Voice| Input
User -->|Fridge Photo| Vision[Gemini Vision API]
subgraph "Sensory Layer"
Input --> Context[Context Expert]
Input --> Lexicon[Lexicon Expert]
Input --> Conflict[Conflict Expert]
end
Vision -->|Ingredients| FoodEngine
subgraph "Decision Layer (The Judge)"
Context & Lexicon & Conflict --> EVM{EVM Vector Engine}
EVM -->|Valence, Arousal, Control| State[Emotional State]
end
subgraph "Action Layer"
State --> Strategy[Strategy Selector]
Strategy --> FoodEngine[Food Recommendation Engine]
FoodEngine -->|Database + Fridge Match| Response
end
Response --> UI[Final UI]
MoodBite follows a 3-Layer Sensory Design Philosophy:
-
The Sensory Surface (UI):
- Glassmorphism: Built with
backdrop-filter,bg-white/6, and deep gradients to mimic a futuristic dashboard. - Dynamic Backgrounds: The environment shifts colors (Red for Anger, Blue for Grief) based on real-time vector analysis.
- Interactive Input: Supports Voice Command (Web Speech API) and Vision (Upload Fridge Photos).
- Glassmorphism: Built with
-
The Expert Core (Logic):
- Offline-First: 90% of the logic (Emotion detection, Reasoning, Food matching) runs locally without external API calls.
- Deterministic: Same input = Same output. No hallucinations.
- Explainable AI: The system generates a "Chef's Note" explaining why a specific food regulates a specific mood.
-
The Vision Layer (Integration):
- Integrates Google Gemini 1.5 Flash to analyze refrigerator contents and cross-reference them with the emotional strategy.
- Framework: Next.js 15 (React 19)
- Styling: Tailwind CSS v4 + Framer Motion
- AI (Vision): Google Gemini 1.5 Flash
- AI (Core): Custom JS-based Expert System (No LLM dependency for logic)
- Image Gen: Pollinations.ai (Real-time food visualization)
├── components/ # UI Building Blocks (ModernInputBar, HeroFoodCard)
├── evm/ # The Brain (Expert Vector Machine)
│ ├── dictionaries.js # 28-Emotion Lexicon
│ ├── experts.js # Signal Processors
│ ├── judge.js # Vector Math & Decision Logic
│ └── foodEngine.js # Strategy & Recipe Database
├── pages/ # Routes (Home, About, API)
└── public/ # Static AssetsThe project is configured for seamless deployment on Vercel.
While Vercel handles deployments automatically, here is the logic flow for a standard CI pipeline:
name: MoodBite Build Pipeline
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: npm ci
- name: Lint Analysis
run: npm run lint
- name: Production Build
run: npm run build
- name: Test Offline Engine
run: node evm/test_suite.js-
Clone the Repo
git clone https://github.com/singhcod3r/MoodBite-Version-2.0.git cd MoodBite-Version-2.0 -
Install Dependencies
npm install # or yarn install -
Set Environment Variables Create a
.env.localfile:GEMINI_API_KEY=your_gemini_key_here
-
Run Development Server
npm run dev
-
Open Browser Visit
http://localhost:3000.
Designed & Engineered by Ayush Singh.