# vir1dian/assistantchef architecture

> Architecture diagram of the GitHub repository vir1dian/assistantchef, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vir1dian/assistantchef
- Repository: https://github.com/vir1dian/assistantchef

## Overview

##### 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

## Diagram (Mermaid)

```mermaid
graph TB
    %% External User
    User((User))

    %% Browser Boundary
    subgraph "Browser (Client-Side)"
        direction TB

        %% UI Layer
        subgraph "UI Layer"
            direction TB
            HTML["chefHome.html"]:::ui
            CSS["chefsHat.css"]:::ui
        end

        %% Core Orchestrator
        chefJS["chef.js"]:::orch

        %% Domain Logic Modules
        subgraph "Domain Logic"
            direction TB
            Recipes["chefRecipes.js"]:::domain
            Filters["chefFilters.js"]:::domain
        end

        %% Assistant Engine (ALAN Module)
        subgraph "Assistant Engine"
            direction TB
            Main["Main.js"]:::ai
            Filter["Filter.js"]:::ai
            Timer["Timer.js"]:::ai
            Sample["Basic_example_for_AI_assistant.js"]:::ai
            Temp["temp"]:::ai
        end
    end

    %% Relationships
    User -->|event| HTML
    HTML -->|UI event| chefJS
    chefJS -->|data request| Recipes
    chefJS -->|logic call| Filters
    chefJS -->|intent| Main
    Recipes -->|data| chefJS
    Filters -->|filtered data| chefJS
    Main -->|delegates filter intent| Filter
    Main -->|delegates timer intent| Timer
    Filter -->|response| chefJS
    Timer -->|response| chefJS

    %% Click Events
    click HTML "https://github.com/vir1dian/assistantchef/blob/main/chefHome.html"
    click CSS "https://github.com/vir1dian/assistantchef/blob/main/chefsHat.css"
    click chefJS "https://github.com/vir1dian/assistantchef/blob/main/chef.js"
    click Recipes "https://github.com/vir1dian/assistantchef/blob/main/chefRecipes.js"
    click Filters "https://github.com/vir1dian/assistantchef/blob/main/chefFilters.js"
    click Main "https://github.com/vir1dian/assistantchef/blob/main/ALAN/Main.js"
    click Filter "https://github.com/vir1dian/assistantchef/blob/main/ALAN/Filter.js"
    click Timer "https://github.com/vir1dian/assistantchef/blob/main/ALAN/Timer.js"
    click Sample "https://github.com/vir1dian/assistantchef/blob/main/ALAN/Basic_example_for_AI_assistant.js"
    click Temp "https://github.com/vir1dian/assistantchef/tree/main/ALAN/temp"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef orch fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef domain fill:#98FB98,stroke:#000,stroke-width:1px;
    classDef ai fill:#FFA500,stroke:#000,stroke-width:1px;
```
