# vaibhavkanojia/fishbone architecture

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

- Interactive diagram: https://gitdiagram.com/vaibhavkanojia/fishbone
- Repository: https://github.com/vaibhavkanojia/fishbone

## Overview

##### Project type and purpose
- It comprises two main runtime halves:
- the extension host (the VS Code “backend”) written in TypeScript under src/extension
- a React-based webview “frontend” under src/webview
- There is also a Docusaurus‐based documentation site in docs/fishbone and unit/integration tests under src/test.

##### File structure
Top-level:
- CONFIG & BUILD: .github/, .vscode/, .husky/, esbuild.mjs, tsconfig.json, package.json
- DOCUMENTATION: docs/fishbone/ (Docusaurus site sources)
- EXTENSION RUNTIME: src/extension/ – activation (extension.ts), commands, custom FS & Notebook providers (fbaFSProvider.ts, fbaNotebookProvider.ts), renderers, AI integration (fbAIProvider.ts), utilities, constants
- WEBVIEW FRONTEND: src/webview/ – public (HTML/manifest), React app in src (components, pages, CSS, tests)
- TESTS: src/test/
- ASSETS: images/, db.json, language-configuration files

##### Additional insights from README
- Extensibility: imports, reset workflows
- Third-party libs: React, Material-UI, fishbone-chart, js-yaml, jsonpath

a. Main components
1. VS Code Extension Host
- Activation & Command Controller
- File System Provider (.fba file management)
- Notebook Provider (if using notebook API)
- AI/REST Provider (fbAIProvider, fbAiTools)
- Renderer (cell / NBRQ renderer)
2. Webview Frontend (React App)
- FishboneCanvas (fishboneChart.js)
- Data Providers (REST, dlt logs)
- UI Components (effects, categories, dialogs, summary table)
3. Documentation Site (Docusaurus)
4. External Services
- REST servers (JIRA, GitHub, custom)
- DLT-logs extension (for live log queries)
5. Storage
- .fba analysis files (json via JS-YAML)
- db.json (example data)

b. Relationships & data flows
- VS Code UI → Extension Host registers commands & menus →
- User triggers “New fishbone” or opens .fba → Extension Host spins up a WebviewPanel →
- Extension ↔ Webview communicate via postMessage / onDidReceiveMessage
- Webview makes REST or dlt-logs requests by dispatching messages back to the extension which has credentials/contexts to call external APIs
- Extension writes/reads .fba files via its custom FS provider
- Documentation site is built/deployed separately via Docusaurus (not part of the runtime)

c. Architectural patterns & design principles
- Separation of concerns: host logic vs. UI logic
- Event-driven messaging between extension host & webview
- Pluggable providers (FS, notebook, AI, REST) following VS Code’s Provider APIs
- MV* style in React frontend: container components vs. presentational components
- Plugin extensibility: import/nest fishbones, reset workflows

d. Key technologies & libraries
- Node & VS Code Extension API (TypeScript)
- React, react-dom, Material-UI, fishbone-chart
- Docusaurus (docs)
- esbuild for bundling the extension
- js-yaml & jsonpath for file parsing and queries

## Diagram (Mermaid)

```mermaid
flowchart TD
    UI["VS Code UI"]:::vsblue
    subgraph "VS Code Extension Host"
        A["Activation & Command Controller"]:::vsblue
        B["FS Provider"]:::vsblue
        C["Notebook Provider"]:::vsblue
        D["AI/REST Provider"]:::biz
        E["Renderer (Cell & Notebook)"]:::biz
        F["Formatting Utility"]:::biz
        G["Constants"]:::biz
        H["Utilities"]:::biz
    end

    subgraph "Webview Frontend"
        J["Entry Point (index.js)"]:::ui
        I["App Shell (App.js)"]:::ui
        K["FishboneCanvas"]:::ui
        L["REST Data Provider"]:::ui
        M["DLT Manual Query UI"]:::ui
        N["DLT Filter Assistant"]:::ui
        O["Summary Table"]:::ui
        P["Table Toolbar"]:::ui
        Q["Data Provider Edit Dialog"]:::ui
        R["Summary Dialog"]:::ui
        S["Text Field Edit Dialog"]:::ui
    end

    subgraph "External Services"
        T["REST Servers (JIRA, GitHub)"]:::ext
        U["DLT-Logs Extension"]:::ext
    end

    subgraph "Storage"
        V[[".fba Files"]]:::storage
        W[["db.json"]]:::storage
    end

    subgraph "Documentation Site"
        X["Docusaurus Docs"]:::biz
    end

    subgraph "Tests"
        Y["Test Suites & Runner"]:::biz
    end

    UI --> A
    A --> B
    A --> C
    A --> D
    A --> E
    A --> J
    A <-->|"postMessage"| I
    B --> V
    C --> E
    D --> T
    D --> U
    J --> I
    I --> K
    I --> L
    I --> M
    I --> N
    I --> O
    I --> P
    I --> Q
    I --> R
    I --> S
    Y --> A
    Y --> H

    classDef vsblue fill:#D6EAF8,stroke:#4A90E2,color:#000
    classDef biz fill:#D5F5E3,stroke:#27AE60,color:#000
    classDef ui fill:#FCF3CF,stroke:#F1C40F,color:#000
    classDef ext fill:#FADBD8,stroke:#E74C3C,color:#000
    classDef storage fill:#D2B4DE,stroke:#8E44AD,color:#000

    click A "https://github.com/vaibhavkanojia/fishbone/blob/main/src/extension/extension.ts"
    click B "https://github.com/vaibhavkanojia/fishbone/blob/main/src/extension/fbaFSProvider.ts"
    click C "https://github.com/vaibhavkanojia/fishbone/blob/main/src/extension/fbaNotebookProvider.ts"
    click D "https://github.com/vaibhavkanojia/fishbone/blob/main/src/extension/fbAIProvider.ts"
    click E "https://github.com/vaibhavkanojia/fishbone/blob/main/src/extension/fbaNBRQRenderer.ts"
    click F "https://github.com/vaibhavkanojia/fishbone/blob/main/src/extension/fbaFormat.ts"
    click G "https://github.com/vaibhavkanojia/fishbone/blob/main/src/extension/constants.ts"
    click H "https://github.com/vaibhavkanojia/fishbone/blob/main/src/extension/util.ts"
    click J "https://github.com/vaibhavkanojia/fishbone/blob/main/src/webview/src/index.js"
    click I "https://github.com/vaibhavkanojia/fishbone/blob/main/src/webview/src/App.js"
    click K "https://github.com/vaibhavkanojia/fishbone/blob/main/src/webview/src/components/fishbone/fishboneChart.js"
    click L "https://github.com/vaibhavkanojia/fishbone/blob/main/src/webview/src/components/dataProvider.js"
    click M "https://github.com/vaibhavkanojia/fishbone/blob/main/src/webview/src/components/dltRestQueryManual.js"
    click N "https://github.com/vaibhavkanojia/fishbone/blob/main/src/webview/src/components/dltFilterAssistant.js"
    click O "https://github.com/vaibhavkanojia/fishbone/blob/main/src/webview/src/components/summary/table.js"
    click P "https://github.com/vaibhavkanojia/fishbone/blob/main/src/webview/src/components/summary/tableToolbar.js"
    click Q "https://github.com/vaibhavkanojia/fishbone/blob/main/src/webview/src/components/dataProviderEditDialog.js"
    click R "https://github.com/vaibhavkanojia/fishbone/blob/main/src/webview/src/components/summaryDialog.js"
    click S "https://github.com/vaibhavkanojia/fishbone/blob/main/src/webview/src/components/textFieldEditDialog.js"
    click X "https://github.com/vaibhavkanojia/fishbone/tree/main/docs/fishbone/"
    click Y "https://github.com/vaibhavkanojia/fishbone/blob/main/src/test/runTest.ts"
```
