# mehdiraized/infinite-monitor-desktop architecture

> Architecture diagram of the GitHub repository mehdiraized/infinite-monitor-desktop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mehdiraized/infinite-monitor-desktop
- Repository: https://github.com/mehdiraized/infinite-monitor-desktop

## Overview

Infinite Monitor is a local-first AI dashboard desktop app. Users enter through the Electron shell into the dashboard, where they can arrange dashboards and widgets, use AI to create or edit widgets, and browse the widget marketplace. Widget code is built and served through the overlay’s widget runtime; the app also provides offline caching, settings, onboarding, diagnostics, and updates. The README documents several capabilities whose implementation files are absent from the tree; those are represented only where paths or relationships are supported. Some subsystem links are omitted because their wiring was not shown.

Main entry points: [`overlay/src/app/page.tsx`](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/app/page.tsx) (Dashboard home), [`overlay/src/app/api/chat/route.ts`](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/app/api/chat/route.ts) (AI chat API), [`electron/main.js`](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/electron/main.js) (Electron shell), [`electron/menu.js`](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/electron/menu.js) (App menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop shell"]
  node_electron["Electron shell<br/>[main.js]"]
  node_appmenu["App menu<br/>[menu.js]"]
  node_settings["Settings window<br/>[settings-window.js]"]
  node_settingsui["Settings UI<br/>[settings-app.jsx]"]
  node_updater["Update checker<br/>[updater.js]"]
end

subgraph group_dashboard["Dashboard experience"]
  node_home["Dashboard home<br/>[page.tsx]"]
  node_grid["Dashboard canvas<br/>[dashboard-grid.tsx]"]
  node_addmenu["Add menu<br/>[add-menu.tsx]"]
  node_onboarding["Onboarding<br/>[onboarding.tsx]"]
end

subgraph group_widgets["Widget platform"]
  node_marketplace["Widget marketplace"]
  node_runner["Widget runner<br/>[widget-runner.ts]"]
  node_widgetroute["Widget serving route<br/>[route.ts]"]
  node_widgetdata[("Widget data")]
  node_registry["Registry API<br/>[route.ts]"]
  node_submit["Widget submission<br/>[route.ts]"]
  node_widgetdetail["Widget detail API<br/>[route.ts]"]
end

subgraph group_services["AI and services"]
  node_chat["AI chat API<br/>[route.ts]"]
  node_offline[("Offline cache<br/>[sw.js]")]
end

node_user(("User"))
node_github["GitHub registries"]
node_supabase["Supabase"]
node_ai["AI providers"]
node_mcp["MCP tools"]

node_user -->|"opens app"| node_electron
node_electron -->|"starts web app"| node_home
node_electron -->|"builds menu"| node_appmenu
node_appmenu -->|"opens settings"| node_settings
node_appmenu -->|"checks updates"| node_updater
node_settings -->|"shows window"| node_settingsui
node_settings -->|"updates preferences"| node_home
node_user -->|"uses dashboard"| node_home
node_home -->|"renders dashboard"| node_grid
node_home -->|"renders menu"| node_addmenu
node_home -->|"renders onboarding"| node_onboarding
node_home -->|"shows marketplace"| node_marketplace
node_user -.->|"requests AI"| node_chat
node_chat -->|"edits widget files"| node_runner
node_chat -->|"reads dashboards"| node_widgetdata
node_chat -.->|"streams responses"| node_ai
node_chat -.->|"uses tools"| node_mcp
node_widgetroute -->|"reads widget code"| node_widgetdata
node_widgetroute -->|"builds and serves"| node_runner
node_registry -->|"fetches registry"| node_github
node_widgetdetail -->|"fetches widget"| node_github
node_submit -.->|"forwards submission"| node_supabase
node_offline -->|"serves cached data"| node_user

click node_electron "https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/electron/main.js"
click node_appmenu "https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/electron/menu.js"
click node_settings "https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/electron/settings-window.js"
click node_settingsui "https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/electron/settings-app.jsx"
click node_updater "https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/electron/updater.js"
click node_home "https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/app/page.tsx"
click node_grid "https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/components/dashboard-grid.tsx"
click node_addmenu "https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/components/add-menu.tsx"
click node_onboarding "https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/components/onboarding.tsx"
click node_marketplace "https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/components/widget-marketplace.tsx"
click node_chat "https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/app/api/chat/route.ts"
click node_runner "https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/lib/widget-runner.ts"
click node_widgetroute "https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/app/api/widget/%5Bid%5D/%5B%5B...path%5D%5D/route.ts"
click node_widgetdata "https://github.com/mehdiraized/infinite-monitor-desktop/tree/main/overlay/src/db"
click node_registry "https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/app/api/registry/route.ts"
click node_submit "https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/app/api/registry/submit/route.ts"
click node_widgetdetail "https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/app/api/registry/widget/route.ts"
click node_offline "https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/public/sw.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_electron,node_appmenu,node_settings,node_settingsui,node_updater,node_user toneBlue
class node_home,node_grid,node_addmenu,node_onboarding toneAmber
class node_marketplace,node_runner,node_widgetroute,node_widgetdata,node_registry,node_submit,node_widgetdetail toneMint
class node_chat,node_offline toneRose
class node_github,node_supabase,node_ai,node_mcp toneIndigo
```

## Components

### Desktop shell

- [Electron shell](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/electron/main.js): `electron/main.js`
- [App menu](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/electron/menu.js): `electron/menu.js`
- [Settings window](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/electron/settings-window.js): `electron/settings-window.js`
- [Settings UI](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/electron/settings-app.jsx): `electron/settings-app.jsx`
- [Update checker](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/electron/updater.js): `electron/updater.js`

### Dashboard experience

- [Dashboard home](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/app/page.tsx): `overlay/src/app/page.tsx`
- [Dashboard canvas](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/components/dashboard-grid.tsx): `overlay/src/components/dashboard-grid.tsx`
- [Add menu](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/components/add-menu.tsx): `overlay/src/components/add-menu.tsx`
- [Onboarding](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/components/onboarding.tsx): `overlay/src/components/onboarding.tsx`

### Widget platform

- [Widget marketplace](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/components/widget-marketplace.tsx): `overlay/src/components/widget-marketplace.tsx`
- [Widget runner](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/lib/widget-runner.ts): `overlay/src/lib/widget-runner.ts`
- [Widget serving route](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/app/api/widget/%5Bid%5D/%5B%5B...path%5D%5D/route.ts): `overlay/src/app/api/widget/[id]/[[...path]]/route.ts`
- [Widget data](https://github.com/mehdiraized/infinite-monitor-desktop/tree/main/overlay/src/db): `overlay/src/db`
- [Registry API](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/app/api/registry/route.ts): `overlay/src/app/api/registry/route.ts`
- [Widget submission](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/app/api/registry/submit/route.ts): `overlay/src/app/api/registry/submit/route.ts`
- [Widget detail API](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/app/api/registry/widget/route.ts): `overlay/src/app/api/registry/widget/route.ts`

### AI and services

- [AI chat API](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/src/app/api/chat/route.ts): `overlay/src/app/api/chat/route.ts`
- [Offline cache](https://github.com/mehdiraized/infinite-monitor-desktop/blob/main/overlay/public/sw.js): `overlay/public/sw.js`

### Other components

- **User**
- **GitHub registries**
- **Supabase**
- **AI providers**
- **MCP tools**

## Connections

- User → Electron shell: opens app
- Electron shell → Dashboard home: starts web app (evidence: `electron/main.js`)
- Electron shell → App menu: builds menu (evidence: `electron/main.js`)
- App menu → Settings window: opens settings (evidence: `electron/menu.js`)
- App menu → Update checker: checks updates (evidence: `electron/menu.js`)
- Settings window → Settings UI: shows window (evidence: `electron/settings-window.js`)
- Settings window → Dashboard home: updates preferences (evidence: `electron/settings-window.js`)
- User → Dashboard home: uses dashboard (evidence: `overlay/src/app/page.tsx`)
- Dashboard home → Dashboard canvas: renders dashboard (evidence: `overlay/src/app/page.tsx`)
- Dashboard home → Add menu: renders menu (evidence: `overlay/src/app/page.tsx`)
- Dashboard home → Onboarding: renders onboarding (evidence: `overlay/src/app/page.tsx`)
- Dashboard home → Widget marketplace: shows marketplace (evidence: `overlay/src/app/page.tsx`)
- User → AI chat API: requests AI
- AI chat API → Widget runner: edits widget files (evidence: `overlay/src/app/api/chat/route.ts`)
- AI chat API → Widget data: reads dashboards (evidence: `overlay/src/app/api/chat/route.ts`)
- AI chat API → AI providers: streams responses
- AI chat API → MCP tools: uses tools
- Widget serving route → Widget data: reads widget code (evidence: `overlay/src/app/api/widget/[id]/[[...path]]/route.ts`)
- Widget serving route → Widget runner: builds and serves (evidence: `overlay/src/app/api/widget/[id]/[[...path]]/route.ts`)
- Registry API → GitHub registries: fetches registry (evidence: `overlay/src/app/api/registry/route.ts`)
- Widget detail API → GitHub registries: fetches widget (evidence: `overlay/src/app/api/registry/widget/route.ts`)
- Widget submission → Supabase: forwards submission
- Offline cache → User: serves cached data (evidence: `overlay/public/sw.js`)
