# dhruvilp757/bstudio architecture

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

- Interactive diagram: https://gitdiagram.com/dhruvilp757/bstudio
- Repository: https://github.com/dhruvilp757/bstudio

## Overview

Bstudio is an Electron desktop browser and IDE for full-stack developers. Developers edit and inspect a workspace, run it in an embedded Chromium view, collect CDP diagnostics, and use AI assistance to investigate issues and propose safe patches. The renderer reaches privileged main-process capabilities through a preload IPC bridge. Other major capabilities include terminal sessions, Git and file operations, extensions, API requests, and concurrent load testing. Main-process wiring is visible in the sampled entry point; several feature-specific IPC implementations were not sampled, so their detailed internal calls are omitted.

Main entry points: [`src/preload/index.ts`](https://github.com/dhruvilp757/bstudio/blob/main/src/preload/index.ts) (Preload Bridge), [`src/main/index.ts`](https://github.com/dhruvilp757/bstudio/blob/main/src/main/index.ts) (Main Process), [`src/renderer/src/components/chat/DevChatSidebar.vue`](https://github.com/dhruvilp757/bstudio/blob/main/src/renderer/src/components/chat/DevChatSidebar.vue) (Copilot Sidebar), [`src/renderer/src/App.vue`](https://github.com/dhruvilp757/bstudio/blob/main/src/renderer/src/App.vue) (Workspace Shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace UI"]
  node_workspace_ui["Workspace Shell<br/>[App.vue]"]
  node_editor["Monaco Editor<br/>[MonacoEditor.vue]"]
  node_copilot_ui["Copilot Sidebar<br/>[DevChatSidebar.vue]"]
  node_browser_state["Browser Store<br/>[browser-store.ts]"]
  node_chat_state["Chat Store<br/>[chat-store.ts]"]
end

subgraph group_bridge["IPC Boundary"]
  node_preload["Preload Bridge<br/>[index.ts]"]
  node_ipc_contract["IPC Channels<br/>[ipc-channels.ts]"]
end

subgraph group_runtime["Browser Diagnostics"]
  node_main_app["Main Process<br/>[index.ts]"]
  node_embedded_browser["Embedded Browser<br/>[view-manager.ts]"]
  node_cdp_core["CDP Core<br/>[cdp-core.ts]"]
  node_cdp_engines["CDP Diagnostics"]
  node_telemetry_types["Telemetry Types<br/>[telemetry-types.ts]"]
end

subgraph group_assist["AI Remediation"]
  node_ai_client["AI Reasoning<br/>[nebius-client.ts]"]
  node_patch_engine["Atomic Patching<br/>[patch-engine.ts]"]
  node_patch_types["Patch Types<br/>[patch-types.ts]"]
  node_secure_storage[("Encrypted Key Store<br/>[secure-storage.ts]")]
end

subgraph group_tools["Developer Tools"]
  node_file_git_extensions["Workspace Services"]
  node_terminal["Terminal Sessions<br/>[pty-manager.ts]"]
  node_api_load["API and Load Testing"]
end

node_developer(("Developer"))

node_developer -->|"uses"| node_workspace_ui
node_workspace_ui -->|"presents"| node_editor
node_workspace_ui -->|"presents"| node_copilot_ui
node_copilot_ui -->|"uses"| node_chat_state
node_copilot_ui -->|"reads context"| node_browser_state
node_editor -.->|"file operations"| node_preload
node_copilot_ui -.->|"AI and patch requests"| node_preload
node_browser_state -.->|"browser controls"| node_preload
node_preload -->|"invokes channels"| node_ipc_contract
node_main_app -->|"configures window bridge"| node_preload
node_main_app -->|"creates"| node_embedded_browser
node_embedded_browser -->|"uses"| node_cdp_core
node_main_app -->|"initializes diagnostics"| node_cdp_engines
node_cdp_engines -.->|"uses CDP"| node_cdp_core
node_main_app -->|"initializes"| node_ai_client
node_main_app -.->|"initializes"| node_patch_engine
node_patch_engine -->|"uses types"| node_patch_types
node_main_app -->|"initializes"| node_secure_storage
node_ai_client -.->|"uses stored keys"| node_secure_storage
node_main_app -->|"initializes"| node_terminal
node_main_app -->|"initializes load testing"| node_api_load
node_api_load -->|"uses types"| node_telemetry_types
node_preload -->|"starts load tests"| node_api_load
node_preload -->|"requests patch or rollback"| node_patch_engine
node_preload -->|"requests key storage"| node_secure_storage
node_preload -.->|"requests workspace services"| node_file_git_extensions

click node_workspace_ui "https://github.com/dhruvilp757/bstudio/blob/main/src/renderer/src/App.vue"
click node_editor "https://github.com/dhruvilp757/bstudio/blob/main/src/renderer/src/components/editor/MonacoEditor.vue"
click node_copilot_ui "https://github.com/dhruvilp757/bstudio/blob/main/src/renderer/src/components/chat/DevChatSidebar.vue"
click node_browser_state "https://github.com/dhruvilp757/bstudio/blob/main/src/renderer/src/stores/browser-store.ts"
click node_chat_state "https://github.com/dhruvilp757/bstudio/blob/main/src/renderer/src/stores/chat-store.ts"
click node_preload "https://github.com/dhruvilp757/bstudio/blob/main/src/preload/index.ts"
click node_ipc_contract "https://github.com/dhruvilp757/bstudio/blob/main/src/shared/ipc-channels.ts"
click node_main_app "https://github.com/dhruvilp757/bstudio/blob/main/src/main/index.ts"
click node_embedded_browser "https://github.com/dhruvilp757/bstudio/blob/main/src/main/view-manager.ts"
click node_cdp_core "https://github.com/dhruvilp757/bstudio/blob/main/src/main/cdp/cdp-core.ts"
click node_cdp_engines "https://github.com/dhruvilp757/bstudio/tree/main/src/main/cdp"
click node_telemetry_types "https://github.com/dhruvilp757/bstudio/blob/main/src/shared/telemetry-types.ts"
click node_ai_client "https://github.com/dhruvilp757/bstudio/blob/main/src/main/nemotron/nebius-client.ts"
click node_patch_engine "https://github.com/dhruvilp757/bstudio/blob/main/src/main/patch-engine.ts"
click node_patch_types "https://github.com/dhruvilp757/bstudio/blob/main/src/shared/patch-types.ts"
click node_secure_storage "https://github.com/dhruvilp757/bstudio/blob/main/src/main/secure-storage.ts"
click node_file_git_extensions "https://github.com/dhruvilp757/bstudio/tree/main/src/main/ipc"
click node_terminal "https://github.com/dhruvilp757/bstudio/blob/main/src/main/terminal/pty-manager.ts"
click node_api_load "https://github.com/dhruvilp757/bstudio/blob/main/src/main/load-tester/load-orchestrator.ts"

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_workspace_ui,node_editor,node_copilot_ui,node_browser_state,node_chat_state toneBlue
class node_preload,node_ipc_contract toneAmber
class node_main_app,node_embedded_browser,node_cdp_core,node_cdp_engines,node_telemetry_types toneMint
class node_ai_client,node_patch_engine,node_patch_types,node_secure_storage toneRose
class node_file_git_extensions,node_terminal,node_api_load,node_developer toneIndigo
```

## Components

### Workspace UI

- [Workspace Shell](https://github.com/dhruvilp757/bstudio/blob/main/src/renderer/src/App.vue): `src/renderer/src/App.vue`
- [Monaco Editor](https://github.com/dhruvilp757/bstudio/blob/main/src/renderer/src/components/editor/MonacoEditor.vue): `src/renderer/src/components/editor/MonacoEditor.vue`
- [Copilot Sidebar](https://github.com/dhruvilp757/bstudio/blob/main/src/renderer/src/components/chat/DevChatSidebar.vue): `src/renderer/src/components/chat/DevChatSidebar.vue`
- [Browser Store](https://github.com/dhruvilp757/bstudio/blob/main/src/renderer/src/stores/browser-store.ts): `src/renderer/src/stores/browser-store.ts`
- [Chat Store](https://github.com/dhruvilp757/bstudio/blob/main/src/renderer/src/stores/chat-store.ts): `src/renderer/src/stores/chat-store.ts`

### IPC Boundary

- [Preload Bridge](https://github.com/dhruvilp757/bstudio/blob/main/src/preload/index.ts): `src/preload/index.ts`
- [IPC Channels](https://github.com/dhruvilp757/bstudio/blob/main/src/shared/ipc-channels.ts): `src/shared/ipc-channels.ts`

### Browser Diagnostics

- [Main Process](https://github.com/dhruvilp757/bstudio/blob/main/src/main/index.ts): `src/main/index.ts`
- [Embedded Browser](https://github.com/dhruvilp757/bstudio/blob/main/src/main/view-manager.ts): `src/main/view-manager.ts`
- [CDP Core](https://github.com/dhruvilp757/bstudio/blob/main/src/main/cdp/cdp-core.ts): `src/main/cdp/cdp-core.ts`
- [CDP Diagnostics](https://github.com/dhruvilp757/bstudio/tree/main/src/main/cdp): `src/main/cdp`
- [Telemetry Types](https://github.com/dhruvilp757/bstudio/blob/main/src/shared/telemetry-types.ts): `src/shared/telemetry-types.ts`

### AI Remediation

- [AI Reasoning](https://github.com/dhruvilp757/bstudio/blob/main/src/main/nemotron/nebius-client.ts): `src/main/nemotron/nebius-client.ts`
- [Atomic Patching](https://github.com/dhruvilp757/bstudio/blob/main/src/main/patch-engine.ts): `src/main/patch-engine.ts`
- [Patch Types](https://github.com/dhruvilp757/bstudio/blob/main/src/shared/patch-types.ts): `src/shared/patch-types.ts`
- [Encrypted Key Store](https://github.com/dhruvilp757/bstudio/blob/main/src/main/secure-storage.ts): `src/main/secure-storage.ts`

### Developer Tools

- [Workspace Services](https://github.com/dhruvilp757/bstudio/tree/main/src/main/ipc): `src/main/ipc`
- [Terminal Sessions](https://github.com/dhruvilp757/bstudio/blob/main/src/main/terminal/pty-manager.ts): `src/main/terminal/pty-manager.ts`
- [API and Load Testing](https://github.com/dhruvilp757/bstudio/blob/main/src/main/load-tester/load-orchestrator.ts): `src/main/load-tester/load-orchestrator.ts`

### Other components

- **Developer**

## Connections

- Developer → Workspace Shell: uses
- Workspace Shell → Monaco Editor: presents
- Workspace Shell → Copilot Sidebar: presents
- Copilot Sidebar → Chat Store: uses (evidence: `src/renderer/src/components/chat/DevChatSidebar.vue`)
- Copilot Sidebar → Browser Store: reads context (evidence: `src/renderer/src/components/chat/DevChatSidebar.vue`)
- Monaco Editor → Preload Bridge: file operations
- Copilot Sidebar → Preload Bridge: AI and patch requests
- Browser Store → Preload Bridge: browser controls
- Preload Bridge → IPC Channels: invokes channels (evidence: `src/preload/index.ts`)
- Main Process → Preload Bridge: configures window bridge (evidence: `src/main/index.ts`)
- Main Process → Embedded Browser: creates (evidence: `src/main/index.ts`)
- Embedded Browser → CDP Core: uses (evidence: `src/main/view-manager.ts`)
- Main Process → CDP Diagnostics: initializes diagnostics (evidence: `src/main/index.ts`)
- CDP Diagnostics → CDP Core: uses CDP
- Main Process → AI Reasoning: initializes (evidence: `src/main/index.ts`)
- Main Process → Atomic Patching: initializes (evidence: `src/main/index.ts`)
- Atomic Patching → Patch Types: uses types (evidence: `src/main/patch-engine.ts`)
- Main Process → Encrypted Key Store: initializes (evidence: `src/main/index.ts`)
- AI Reasoning → Encrypted Key Store: uses stored keys
- Main Process → Terminal Sessions: initializes (evidence: `src/main/index.ts`)
- Main Process → API and Load Testing: initializes load testing (evidence: `src/main/index.ts`)
- API and Load Testing → Telemetry Types: uses types (evidence: `src/main/load-tester/load-orchestrator.ts`)
- Preload Bridge → API and Load Testing: starts load tests (evidence: `src/preload/index.ts`)
- Preload Bridge → Atomic Patching: requests patch or rollback (evidence: `src/preload/index.ts`)
- Preload Bridge → Encrypted Key Store: requests key storage
- Preload Bridge → Workspace Services: requests workspace services
