# abhishekmohite55/glideit architecture

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

- Interactive diagram: https://gitdiagram.com/abhishekmohite55/glideit
- Repository: https://github.com/abhishekmohite55/glideit

## Overview

1. **Repository shape**
   GlideIt is split into two major subsystems: a **Python CLI/package** that scans source code and builds a graph model, and a **React/Vite renderer** that turns that graph into a standalone interactive HTML app. The design is offline-first: the output is a static bundle that can be opened without a server.

2. **End-to-end data flow**
   The main pipeline is: **scan files → parse source into AST-derived entities → assemble a graph → serialize JSON → bundle the renderer with that graph data**. The renderer then loads the generated graph payload and performs all visualization and interaction locally in the browser.

3. **Python command layer**
   `glideit/cli.py` and `glideit/__main__.py` are the entry points for the CLI. The README describes two modes: one command to analyze a repo and generate the visualization bundle, and another to serve the already-built output. This means the Python side owns both the analysis phase and the optional local preview server.

4. **Repository scanning boundary**
   `glideit/walker.py` is the filesystem discovery layer. Its job is to walk the target repository while respecting ignore rules, so the rest of the system only sees files that should be analyzed. This is the first boundary between raw project contents and the code graph pipeline.

5. **Language extraction layer**
   `glideit/extractors/` contains the AST extraction subsystem. `base.py` defines the common extractor contract, while `python_extractor.py` and `jsx_extractor.py` implement language-specific parsing. The README indicates the extractors identify functions, classes, React components, hooks, routes, and call/HTTP relationships, so this layer is responsible for turning source syntax into semantic nodes and edges.

6. **Graph assembly and serialization**
   `glideit/graph.py` is the structural core that likely merges extractor output into a unified graph model and writes it to JSON. This is where nodes, edges, depth, grouping, and metadata become a portable data artifact. The generated graph data is what the frontend consumes; it is not re-derived in the browser.

7. **Build/bundle orchestration**
   `glideit/renderer_builder.py` appears to bridge the Python pipeline and the frontend build. Its role is likely to package the React app, place the generated graph data into the renderer’s public assets, and produce the final `glideit-out/` static bundle. This is the handoff point between analysis and visualization.

8. **Frontend application boundary**
   `glideit/renderer/` is a self-contained client application built with React and Vite. `src/main.jsx` and `src/App.jsx` boot the app, while page-level components such as `CodeFlowPage.jsx`, `ApiPage.jsx`, and `JsxPage.jsx` organize the visual modes. The renderer does not parse source code; it only renders the precomputed graph and handles interaction.

9. **Visualization and layout subsystem**
   `src/layout.js` and `src/utils/layout.js` handle graph layout, with README describing an ELK-style layered arrangement. The important architectural point is that layout is computed from the graph model, not hardcoded in the UI, so the same data can be rearranged by depth or orientation without changing the analysis pipeline.

10. **Interaction and navigation state**
    Several components manage how users explore the graph: `CanvasToolbar.jsx` controls depth filtering and layout direction, `BreadcrumbBar.jsx` shows ancestor traces, `LegendPanel.jsx` exposes color/shortcut help, and `Navbar.jsx` frames the app. Hooks such as `useKeyBindings.js` and `useSpacePan.js` capture global navigation behavior like keyboard shortcuts and space-drag panning.

11. **Graph traversal utilities**
    `src/utils/findPathToRoot.js` supports breadcrumb/backtrace behavior by walking incoming relationships back to root entry points. This is a browser-side traversal utility layered on top of the precomputed graph structure, enabling hover and selection interactions without extra backend calls.

12. **Styling and visual clustering**
    `clusterColors.js` and `styles/index.css` define the visual identity of the graph, including subsystem coloring and dark-theme presentation. The clustering mentioned in the README is a presentation layer decision derived from graph topology, helping separate connected components visually.

13. **Deployment model**
    There is no persistent backend service or database. The Python CLI produces a static artifact, and the renderer is shipped as browser assets. The only runtime boundary is the optional local preview server used to serve the already-generated files.

14. **What to diagram**
    An accurate architecture diagram should show three layers: **analysis CLI**, **generated graph artifact**, and **static React renderer**. The critical arrows are: filesystem input into scanners, scanners into extractors, extractors into graph assembly, graph JSON into renderer assets, and browser interactions staying entirely inside the frontend after load.

Main entry points: [`glideit/renderer/src/App.jsx`](https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/src/App.jsx) (App Shell), [`glideit/extractors/base.py`](https://github.com/abhishekmohite55/glideit/blob/main/glideit/extractors/base.py) (Extractor API), [`glideit/graph.py`](https://github.com/abhishekmohite55/glideit/blob/main/glideit/graph.py) (Graph Core), [`glideit/renderer/public/graph-data.json`](https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/public/graph-data.json) (Graph JSON)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Analysis CLI"]
  node_cli["CLI<br/>entrypoints<br/>[cli.py]"]
  node_main["Main<br/>entrypoint<br/>[__main__.py]"]
  node_walker["Walker<br/>filesystem scan<br/>[walker.py]"]
  node_extract_base["Extractor API<br/>extractor contract<br/>[base.py]"]
  node_py_extractor["Python AST<br/>python extractor"]
  node_jsx_extractor["JSX AST<br/>jsx extractor<br/>[jsx_extractor.py]"]
  node_graph_core["Graph Core<br/>graph model<br/>[graph.py]"]
  node_builder["Bundle Builder<br/>renderer bridge"]
end

subgraph group_artifact["Graph Artifact"]
  node_graph_json["Graph JSON<br/>generated artifact<br/>[graph-data.json]"]
end

subgraph group_renderer["Static Renderer"]
  node_renderer_main["Boot<br/>react entry<br/>[main.jsx]"]
  node_app_shell["App Shell<br/>react app<br/>[App.jsx]"]
  node_code_flow["Code Flow<br/>page<br/>[CodeFlowPage.jsx]"]
  node_api_page["API View<br/>page<br/>[ApiPage.jsx]"]
  node_jsx_page["JSX View<br/>page<br/>[JsxPage.jsx]"]
  node_layout["Layout<br/>[layout.js]"]
  node_interaction["Interaction<br/>ui controls<br/>[CanvasToolbar.jsx]"]
  node_graph_utils["Graph Utils<br/>browser utilities<br/>[findPathToRoot.js]"]
end

node_cli -->|"scan"| node_walker
node_main -->|"invoke"| node_cli
node_walker -->|"dispatch"| node_extract_base
node_extract_base -->|"implements"| node_py_extractor
node_extract_base -->|"implements"| node_jsx_extractor
node_py_extractor -->|"emit nodes"| node_graph_core
node_jsx_extractor -->|"emit nodes"| node_graph_core
node_graph_core -->|"serialize"| node_graph_json
node_builder -->|"embed"| node_graph_json
node_builder -->|"bundle"| node_renderer_main
node_graph_json -->|"load"| node_renderer_main
node_renderer_main -->|"mount"| node_app_shell
node_app_shell -->|"route"| node_code_flow
node_app_shell -->|"route"| node_api_page
node_app_shell -->|"route"| node_jsx_page
node_app_shell -->|"arrange"| node_layout
node_layout -->|"traverse"| node_graph_utils
node_app_shell -->|"controls"| node_interaction
node_interaction -->|"trace"| node_graph_utils

click node_cli "https://github.com/abhishekmohite55/glideit/blob/main/glideit/cli.py"
click node_main "https://github.com/abhishekmohite55/glideit/blob/main/glideit/__main__.py"
click node_walker "https://github.com/abhishekmohite55/glideit/blob/main/glideit/walker.py"
click node_extract_base "https://github.com/abhishekmohite55/glideit/blob/main/glideit/extractors/base.py"
click node_py_extractor "https://github.com/abhishekmohite55/glideit/blob/main/glideit/extractors/python_extractor.py"
click node_jsx_extractor "https://github.com/abhishekmohite55/glideit/blob/main/glideit/extractors/jsx_extractor.py"
click node_graph_core "https://github.com/abhishekmohite55/glideit/blob/main/glideit/graph.py"
click node_builder "https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer_builder.py"
click node_graph_json "https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/public/graph-data.json"
click node_renderer_main "https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/src/main.jsx"
click node_app_shell "https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/src/App.jsx"
click node_code_flow "https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/src/components/CodeFlowPage.jsx"
click node_api_page "https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/src/components/ApiPage.jsx"
click node_jsx_page "https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/src/components/JsxPage.jsx"
click node_layout "https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/src/layout.js"
click node_interaction "https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/src/components/CanvasToolbar.jsx"
click node_graph_utils "https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/src/utils/findPathToRoot.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_cli,node_main,node_walker,node_extract_base,node_py_extractor,node_jsx_extractor,node_graph_core,node_builder toneBlue
class node_graph_json toneAmber
class node_renderer_main,node_app_shell,node_code_flow,node_api_page,node_jsx_page,node_layout,node_interaction,node_graph_utils toneMint
```

## Components

### Analysis CLI

Python command layer that scans source repositories, extracts entities, and assembles graph data.

- [CLI](https://github.com/abhishekmohite55/glideit/blob/main/glideit/cli.py): entrypoints · Command entry points for running analysis and previewing output. · `glideit/cli.py`
- [Main](https://github.com/abhishekmohite55/glideit/blob/main/glideit/__main__.py): entrypoint · Module entry used when invoking the package as a script. · `glideit/__main__.py`
- [Walker](https://github.com/abhishekmohite55/glideit/blob/main/glideit/walker.py): filesystem scan · Discovers repository files while applying ignore boundaries. · `glideit/walker.py`
- [Extractor API](https://github.com/abhishekmohite55/glideit/blob/main/glideit/extractors/base.py): extractor contract · Shared interface for language-specific source extractors. · `glideit/extractors/base.py`
- [Python AST](https://github.com/abhishekmohite55/glideit/blob/main/glideit/extractors/python_extractor.py): python extractor · Parses Python source into semantic nodes and relationships. · `glideit/extractors/python_extractor.py`
- [JSX AST](https://github.com/abhishekmohite55/glideit/blob/main/glideit/extractors/jsx_extractor.py): jsx extractor · Parses JSX/React source into components, hooks, and links. · `glideit/extractors/jsx_extractor.py`
- [Graph Core](https://github.com/abhishekmohite55/glideit/blob/main/glideit/graph.py): graph model · Merges extracted entities into the unified graph structure. · `glideit/graph.py`
- [Bundle Builder](https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer_builder.py): renderer bridge · Packages the frontend and injects generated graph data into the static output. · `glideit/renderer_builder.py`

### Graph Artifact

Generated JSON payload that bridges analysis and visualization.

- [Graph JSON](https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/public/graph-data.json): generated artifact · Portable graph payload consumed by the renderer at runtime. · `glideit/renderer/public/graph-data.json`

### Static Renderer

React/Vite client that loads the graph and handles visualization and interaction locally.

- [Boot](https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/src/main.jsx): react entry · Vite/React entry that mounts the browser application. · `glideit/renderer/src/main.jsx`
- [App Shell](https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/src/App.jsx): react app · Top-level application state and page routing for visualization modes. · `glideit/renderer/src/App.jsx`
- [Code Flow](https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/src/components/CodeFlowPage.jsx): page · Primary graph exploration view for code relationships. · `glideit/renderer/src/components/CodeFlowPage.jsx`
- [API View](https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/src/components/ApiPage.jsx): page · Specialized page for API-oriented graph exploration. · `glideit/renderer/src/components/ApiPage.jsx`
- [JSX View](https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/src/components/JsxPage.jsx): page · Specialized page for React/JSX-oriented graph exploration. · `glideit/renderer/src/components/JsxPage.jsx`
- [Layout](https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/src/layout.js): graph layout · Computes layered positioning and orientation from the graph model. · `glideit/renderer/src/layout.js`
- [Interaction](https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/src/components/CanvasToolbar.jsx): ui controls · Toolbar, breadcrumbs, legend, navbar, and keyboard/pan hooks for navigation. · `glideit/renderer/src/components/CanvasToolbar.jsx`
- [Graph Utils](https://github.com/abhishekmohite55/glideit/blob/main/glideit/renderer/src/utils/findPathToRoot.js): browser utilities · Client-side traversal helpers such as root-path lookup for breadcrumbs. · `glideit/renderer/src/utils/findPathToRoot.js`

## Connections

- CLI → Walker: scan · CLI starts repository discovery.
- Main → CLI: invoke · Package entry delegates to CLI commands.
- Walker → Extractor API: dispatch · Discovered files are handed to language extractors through the common contract.
- Extractor API → Python AST: implements · Python parser fulfills the extractor interface.
- Extractor API → JSX AST: implements · JSX parser fulfills the extractor interface.
- Python AST → Graph Core: emit nodes · Python entities are merged into the graph model.
- JSX AST → Graph Core: emit nodes · JSX entities are merged into the graph model.
- Graph Core → Graph JSON: serialize · Unified graph is written as portable JSON.
- Bundle Builder → Graph JSON: embed · Build step places graph data into the renderer bundle.
- Bundle Builder → Boot: bundle · Python build orchestrates the frontend package.
- Graph JSON → Boot: load · Browser app consumes the generated payload.
- Boot → App Shell: mount · React entry boots the application shell.
- App Shell → Code Flow: route · Shell selects the main code-flow view.
- App Shell → API View: route · Shell can switch to API-focused view.
- App Shell → JSX View: route · Shell can switch to JSX-focused view.
- App Shell → Layout: arrange · Pages compute visual placement from graph data.
- Layout → Graph Utils: traverse · Layout and navigation helpers use graph traversal utilities.
- App Shell → Interaction: controls · Shared UI controls manage filtering, breadcrumbs, shortcuts, and pan behavior.
- Interaction → Graph Utils: trace · Breadcrumb and backtrace features walk to root entries.
