How abhishekmohite55/glideit works
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: App.jsx App Shell · base.py Extractor API · graph.py Graph Core · graph-data.json Graph JSON
Components 17
Analysis CLI
Python command layer that scans source repositories, extracts entities, and assembles graph data.
- CLI · Command entry points for running analysis and previewing output.
glideit/cli.py - Main · Module entry used when invoking the package as a script.
glideit/__main__.py - Walker · Discovers repository files while applying ignore boundaries.
glideit/walker.py - Extractor API · Shared interface for language-specific source extractors.
glideit/extractors/base.py - Python AST · Parses Python source into semantic nodes and relationships.
glideit/extractors/python_extractor.py - JSX AST · Parses JSX/React source into components, hooks, and links.
glideit/extractors/jsx_extractor.py - Graph Core · Merges extracted entities into the unified graph structure.
glideit/graph.py - Bundle Builder · 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 · 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 · Vite/React entry that mounts the browser application.
glideit/renderer/src/main.jsx - App Shell · Top-level application state and page routing for visualization modes.
glideit/renderer/src/App.jsx - Code Flow · Primary graph exploration view for code relationships.
glideit/renderer/src/components/CodeFlowPage.jsx - API View · Specialized page for API-oriented graph exploration.
glideit/renderer/src/components/ApiPage.jsx - JSX View · Specialized page for React/JSX-oriented graph exploration.
glideit/renderer/src/components/JsxPage.jsx - Layout · Computes layered positioning and orientation from the graph model.
glideit/renderer/src/layout.js - Interaction · Toolbar, breadcrumbs, legend, navbar, and keyboard/pan hooks for navigation.
glideit/renderer/src/components/CanvasToolbar.jsx - Graph Utils · Client-side traversal helpers such as root-path lookup for breadcrumbs.
glideit/renderer/src/utils/findPathToRoot.js
Connections 19
- 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.