How vir1dian/assistantchef works
Project Type and Purpose
• This is a lightweight, client-side “virtual cooking assistant” web app called AssistantChef. It combines a static UI (HTML/CSS/JS) with an embedded AI-assistant module (the ALAN folder) and domain-specific logic (recipe filtering, timers, etc.).
File Structure Analysis
• Top level:
• chefHome.html – entry point UI
• chefsHat.css – styling for the UI
• chefRecipes.js – recipe data structures and retrieval logic
• chefFilters.js – logic for filtering recipes by criteria
• chef.js – orchestration of UI events, data calls, and assistant interactions
• ALAN folder: contains the AI-assistant code modules:
• Main.js – core assistant engine initialization and event loop
• Filter.js – assistant logic for interpreting filter requests
• Basic_example_for_AI_assistant.js – sample intents/handlers scaffolding
• Timer.js – assistant logic for cooking timers
• temp – placeholder or temporary resources for voice or config
Key Insights from README
• A “virtual assistant who helps with cooking”
• No mention of a server or database—implies entirely client-side operation
Main Components
a. Browser / Client Container
b. UI Layer
• chefHome.html (View)
• chefsHat.css
• chefRecipes.js & chefFilters.js (Data/logic modules exposed to UI)
c. Assistant Engine (ALAN module)
• Main.js (initializes speech / intent handling)
• Filter.js (handles filter intents)
• Timer.js (handles timer intents)
• Basic_example_for_AI_assistant.js (intent scaffold)
d. Data Repositories (in-memory JS objects for recipes)
e. External Services (if any—e.g., voice-to-text API or audio playback library, though not evident here)
Relationships and Interactions
• User speaks or clicks → UI captures event (chefHome.html)
→ chef.js routes to either:
• Direct UI logic (render recipes via chefRecipes.js/chefFilters.js)
• Assistant Engine (Main.js) for voice-driven interactions
• Assistant Engine delegates to Filter.js or Timer.js
→ returns structured data or commands back to chef.js
→ chef.js updates the UI or starts a timer
• All modules run in the browser; no server calls
Architectural Patterns and Principles
• Modular separation: UI vs. domain logic vs. assistant logic
• Event-driven flow: user actions trigger orchestration in chef.js
• In-browser microservices style: each module handles a specific concern
Technologies and Frameworks
• Plain HTML/CSS/JavaScript (ES6 modules)
• ALAN AI SDK or custom intent-handling JS modules
• Browser timer APIs