# harsh9934-debug/ai_virtual_assistant architecture

> Architecture diagram of the GitHub repository harsh9934-debug/ai_virtual_assistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harsh9934-debug/ai_virtual_assistant
- Repository: https://github.com/harsh9934-debug/ai_virtual_assistant

## Overview

J.A.R.V.I.S is a browser-based voice assistant with a Node/Express backend. The main workflow is a user speaking or entering a prompt in the UI, the server routing it to the assistant controller, and the controller either dispatching a matching command or returning a GROQ-generated response. Command modules cover system control, productivity, information, and wellness features. The README documents browser speech capabilities and JSON persistence; the sampled source confirms the server, dispatch, LLM, and selected command behavior. Some command-to-service and command-to-storage wiring is not shown, so those links are omitted.

Main entry points: [`commands`](https://github.com/harsh9934-debug/ai_virtual_assistant/tree/main/commands) (Productivity commands), [`commands/CommandRegistry.js`](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/CommandRegistry.js) (Command registry), [`controllers/assistantController.js`](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/controllers/assistantController.js) (Assistant controller), [`views/main.ejs`](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/views/main.ejs) (Assistant UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_ui["Assistant UI<br/>[main.ejs]"]
end

subgraph group_assistant["Assistant core"]
  node_server["Express server<br/>[index.js]"]
  node_routes["Assistant routes<br/>[virtualRoute.js]"]
  node_controller["Assistant controller"]
  node_registry["Command registry<br/>[CommandRegistry.js]"]
  node_llm["GROQ response service<br/>[llmService.js]"]
end

subgraph group_system["System control"]
  node_systemcmd["System commands"]
  node_brightness["Brightness control"]
  node_volume["Volume control<br/>[VolumeCommand.js]"]
  node_screenshot["Screenshot capture"]
  node_monitor["System monitoring"]
  node_files["File operations"]
  node_filefind["File search"]
end

subgraph group_productivity["Productivity and wellness"]
  node_productivitycmd["Productivity commands"]
  node_notes["Notes management<br/>[NotesCommand.js]"]
  node_todos["Todo management<br/>[TodoCommand.js]"]
  node_notesdata[("Notes store<br/>[notes.json]")]
  node_todosdata[("Todo store<br/>[todos.json]")]
  node_timer["Timers and stopwatch<br/>[TimerCommand.js]"]
  node_health["Health reminders"]
  node_routines["Smart routines"]
  node_calculator["Calculator"]
  node_datetime["Date and time<br/>[DateTimeCommand.js]"]
end

subgraph group_information["Information services"]
  node_informationcmd["Information commands"]
  node_newscommand["News command<br/>[NewsCommand.js]"]
  node_newsservice["News service<br/>[newsService.js]"]
  node_webcommand["Web search<br/>[WebCommand.js]"]
  node_wikipedia["Wikipedia service"]
end

node_user(("User"))
node_groq{{"GROQ API"}}
node_newsapi{{"NewsAPI"}}
node_wikiapi{{"Wikipedia"}}

node_user -->|"speaks or types"| node_ui
node_ui -->|"loads interface"| node_server
node_server -->|"mounts routes"| node_routes
node_routes -->|"dispatches requests"| node_controller
node_controller -->|"checks commands"| node_registry
node_registry -->|"dispatches matching command"| node_systemcmd
node_registry -->|"dispatches matching command"| node_productivitycmd
node_registry -->|"dispatches matching command"| node_informationcmd
node_controller -->|"uses when unmatched"| node_llm
node_llm -->|"requests completion"| node_groq
node_systemcmd -->|"dispatches"| node_brightness
node_systemcmd -->|"dispatches"| node_volume
node_systemcmd -->|"dispatches"| node_screenshot
node_systemcmd -->|"dispatches"| node_monitor
node_systemcmd -->|"dispatches"| node_files
node_systemcmd -->|"dispatches"| node_filefind
node_productivitycmd -->|"dispatches"| node_notes
node_productivitycmd -->|"dispatches"| node_todos
node_productivitycmd -->|"dispatches"| node_timer
node_productivitycmd -->|"dispatches"| node_health
node_productivitycmd -->|"dispatches"| node_routines
node_productivitycmd -->|"dispatches"| node_calculator
node_productivitycmd -->|"dispatches"| node_datetime
node_informationcmd -->|"dispatches"| node_newscommand
node_informationcmd -->|"dispatches"| node_webcommand
node_newsservice -->|"fetches headlines"| node_newsapi
node_wikipedia -->|"searches and fetches"| node_wikiapi

click node_ui "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/views/main.ejs"
click node_server "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/index.js"
click node_routes "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/routes/virtualRoute.js"
click node_controller "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/controllers/assistantController.js"
click node_registry "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/CommandRegistry.js"
click node_llm "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/services/llmService.js"
click node_systemcmd "https://github.com/harsh9934-debug/ai_virtual_assistant/tree/main/commands"
click node_brightness "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/BrightnessCommand.js"
click node_volume "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/VolumeCommand.js"
click node_screenshot "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/ScreenshotCommand.js"
click node_monitor "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/SystemMonitorCommand.js"
click node_files "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/FileOperationsCommand.js"
click node_filefind "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/FileSearchCommand.js"
click node_productivitycmd "https://github.com/harsh9934-debug/ai_virtual_assistant/tree/main/commands"
click node_notes "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/NotesCommand.js"
click node_todos "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/TodoCommand.js"
click node_notesdata "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/data/notes.json"
click node_todosdata "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/data/todos.json"
click node_timer "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/TimerCommand.js"
click node_health "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/HealthReminderCommand.js"
click node_routines "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/SmartRoutineCommand.js"
click node_calculator "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/CalculatorCommand.js"
click node_datetime "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/DateTimeCommand.js"
click node_informationcmd "https://github.com/harsh9934-debug/ai_virtual_assistant/tree/main/commands"
click node_newscommand "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/NewsCommand.js"
click node_newsservice "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/services/newsService.js"
click node_webcommand "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/WebCommand.js"
click node_wikipedia "https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/services/wikipediaService.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ui,node_user toneBlue
class node_server,node_routes,node_controller,node_registry,node_llm toneAmber
class node_systemcmd,node_brightness,node_volume,node_screenshot,node_monitor,node_files,node_filefind,node_groq,node_newsapi toneMint
class node_productivitycmd,node_notes,node_todos,node_notesdata,node_todosdata,node_timer,node_health,node_routines,node_calculator,node_datetime toneRose
class node_informationcmd,node_newscommand,node_newsservice,node_webcommand,node_wikipedia,node_wikiapi toneIndigo
```

## Components

### User interaction

- [Assistant UI](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/views/main.ejs): `views/main.ejs`

### Assistant core

- [Express server](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/index.js): `index.js`
- [Assistant routes](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/routes/virtualRoute.js): `routes/virtualRoute.js`
- [Assistant controller](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/controllers/assistantController.js): `controllers/assistantController.js`
- [Command registry](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/CommandRegistry.js): `commands/CommandRegistry.js`
- [GROQ response service](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/services/llmService.js): `services/llmService.js`

### System control

- [System commands](https://github.com/harsh9934-debug/ai_virtual_assistant/tree/main/commands): `commands`
- [Brightness control](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/BrightnessCommand.js): `commands/BrightnessCommand.js`
- [Volume control](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/VolumeCommand.js): `commands/VolumeCommand.js`
- [Screenshot capture](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/ScreenshotCommand.js): `commands/ScreenshotCommand.js`
- [System monitoring](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/SystemMonitorCommand.js): `commands/SystemMonitorCommand.js`
- [File operations](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/FileOperationsCommand.js): `commands/FileOperationsCommand.js`
- [File search](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/FileSearchCommand.js): `commands/FileSearchCommand.js`

### Productivity and wellness

- [Productivity commands](https://github.com/harsh9934-debug/ai_virtual_assistant/tree/main/commands): `commands`
- [Notes management](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/NotesCommand.js): `commands/NotesCommand.js`
- [Todo management](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/TodoCommand.js): `commands/TodoCommand.js`
- [Notes store](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/data/notes.json): `data/notes.json`
- [Todo store](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/data/todos.json): `data/todos.json`
- [Timers and stopwatch](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/TimerCommand.js): `commands/TimerCommand.js`
- [Health reminders](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/HealthReminderCommand.js): `commands/HealthReminderCommand.js`
- [Smart routines](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/SmartRoutineCommand.js): `commands/SmartRoutineCommand.js`
- [Calculator](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/CalculatorCommand.js): `commands/CalculatorCommand.js`
- [Date and time](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/DateTimeCommand.js): `commands/DateTimeCommand.js`

### Information services

- [Information commands](https://github.com/harsh9934-debug/ai_virtual_assistant/tree/main/commands): `commands`
- [News command](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/NewsCommand.js): `commands/NewsCommand.js`
- [News service](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/services/newsService.js): `services/newsService.js`
- [Web search](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/commands/WebCommand.js): `commands/WebCommand.js`
- [Wikipedia service](https://github.com/harsh9934-debug/ai_virtual_assistant/blob/main/services/wikipediaService.js): `services/wikipediaService.js`

### Other components

- **User**
- **GROQ API**
- **NewsAPI**
- **Wikipedia**

## Connections

- User → Assistant UI: speaks or types
- Assistant UI → Express server: loads interface
- Express server → Assistant routes: mounts routes
- Assistant routes → Assistant controller: dispatches requests
- Assistant controller → Command registry: checks commands
- Command registry → System commands: dispatches matching command
- Command registry → Productivity commands: dispatches matching command
- Command registry → Information commands: dispatches matching command
- Assistant controller → GROQ response service: uses when unmatched
- GROQ response service → GROQ API: requests completion
- System commands → Brightness control: dispatches
- System commands → Volume control: dispatches
- System commands → Screenshot capture: dispatches
- System commands → System monitoring: dispatches
- System commands → File operations: dispatches
- System commands → File search: dispatches
- Productivity commands → Notes management: dispatches
- Productivity commands → Todo management: dispatches
- Productivity commands → Timers and stopwatch: dispatches
- Productivity commands → Health reminders: dispatches
- Productivity commands → Smart routines: dispatches
- Productivity commands → Calculator: dispatches
- Productivity commands → Date and time: dispatches
- Information commands → News command: dispatches
- Information commands → Web search: dispatches
- News service → NewsAPI: fetches headlines
- Wikipedia service → Wikipedia: searches and fetches
