# gupvishesh/codegenie architecture

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

- Interactive diagram: https://gitdiagram.com/gupvishesh/codegenie
- Repository: https://github.com/gupvishesh/codegenie

## Overview

##### Project type and purpose
- This is a VS Code extension called “codegenie” implemented in TypeScript (src/) with a small Python‐based backend (backend/).
- The extension likely provides code‐generation features (hence “codegenie”), exposing commands or a Webview UI in the editor and delegating heavy lifting to a local Python API server.

##### File structure
- Top‐level files and folders:
- package.json, tsconfig.json, eslint.config.mjs – Node/TypeScript configuration for the VS Code extension.
- src/ – extension entrypoints (extension.ts, extension1.ts), a Webview panel implementation (webviewPanel.ts), and tests (src/test/).
- backend/ – a Python API (api.py) and server launcher (server.py), plus requirements.txt.
- .vscodeignore, vsc-extension-quickstart.md, CHANGELOG.md, README.md – extension metadata and docs.
- Patterns:
- “Extension host (Node/TS) ↔ local REST API (Python).”
- MV* style inside the extension (commands, UI, controller).
- A two‐tier architecture: front-end VS Code plugin and back-end service.

##### README for additional insights
- The README is a template but confirms this is a VS Code extension.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Entry Point
    User["User / VS Code Editor"]:::actor
    User -->|triggers command / interacts| extHost

    subgraph "VS Code Extension Host"
        direction TB
        extHost["Extension Host\n(Node.js/TypeScript)"]:::blue
        ext1["extension.ts"]:::blue
        ext2["extension1.ts"]:::blue
        webview["webviewPanel.ts"]:::blue
        pkgNode["package.json"]:::blue
        tsconf["tsconfig.json"]:::blue
        apiClient["API Client\n(HTTP/REST)"]:::blue

        ext1 --> extHost
        ext2 --> extHost
        extHost --> webview
        extHost --> pkgNode
        extHost --> tsconf
        extHost --> apiClient
    end

    subgraph "Local Python API Server"
        direction TB
        pyServer["server.py"]:::green
        apiPy["api.py"]:::green
        reqTxt["requirements.txt"]:::green

        pyServer --> apiPy
        apiPy --> reqTxt
    end

    apiClient -->|"HTTP/REST"| pyServer

    subgraph "External Services"
        direction TB
        extService["External AI API"]:::orange
    end

    apiPy -->|"calls external API"| extService

    %% File System
    fs["Project File System"]:::cyl
    extHost -->|reads/writes| fs

    %% Testing Suite
    test["extension.test.ts"]:::blue
    test --> extHost
    test --> apiClient

    subgraph "Config & Documentation"
        direction TB
        eslintNode["eslint.config.mjs"]:::blue
        ignoreNode[".vscodeignore"]:::blue
        quickNode["vsc-extension-quickstart.md"]:::blue
        readmeNode["README.md"]:::docs
        changelogNode["CHANGELOG.md"]:::docs
        lockNode["package-lock.json"]:::docs
    end

    %% Click Events
    click ext1 "https://github.com/gupvishesh/codegenie/blob/main/src/extension.ts"
    click ext2 "https://github.com/gupvishesh/codegenie/blob/main/src/extension1.ts"
    click webview "https://github.com/gupvishesh/codegenie/blob/main/src/webviewPanel.ts"
    click pkgNode "https://github.com/gupvishesh/codegenie/blob/main/package.json"
    click tsconf "https://github.com/gupvishesh/codegenie/blob/main/tsconfig.json"
    click pyServer "https://github.com/gupvishesh/codegenie/blob/main/backend/server.py"
    click apiPy "https://github.com/gupvishesh/codegenie/blob/main/backend/api.py"
    click reqTxt "https://github.com/gupvishesh/codegenie/blob/main/requirements.txt"
    click test "https://github.com/gupvishesh/codegenie/blob/main/src/test/extension.test.ts"
    click eslintNode "https://github.com/gupvishesh/codegenie/blob/main/eslint.config.mjs"
    click ignoreNode "https://github.com/gupvishesh/codegenie/blob/main/.vscodeignore"
    click quickNode "https://github.com/gupvishesh/codegenie/blob/main/vsc-extension-quickstart.md"
    click readmeNode "https://github.com/gupvishesh/codegenie/blob/main/README.md"
    click changelogNode "https://github.com/gupvishesh/codegenie/blob/main/CHANGELOG.md"
    click lockNode "https://github.com/gupvishesh/codegenie/blob/main/package-lock.json"

    %% Styles
    classDef blue fill:#D0E6FF,stroke:#0366d6,stroke-width:1px;
    classDef green fill:#DFF2D8,stroke:#28a745,stroke-width:1px;
    classDef orange fill:#FFE5B4,stroke:#FF8C00,stroke-width:1px;
    classDef cyl stroke:#000,stroke-width:1px,fill:#FFF9C4,shape:cylinder;
    classDef actor fill:#E0F7FA,stroke:#00838F,stroke-width:1px;
    classDef docs fill:#F3E5F5,stroke:#7B1FA2,stroke-width:1px;
```
