# akash-xcoder/git-flow architecture

> Architecture diagram of the GitHub repository akash-xcoder/git-flow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akash-xcoder/git-flow
- Repository: https://github.com/akash-xcoder/git-flow

## Overview

RepoFlow Visualizer turns a GitHub repository URL into an editable architecture graph and supports inspecting, customizing, arranging, and exporting it. The primary flow runs from the browser UI through repository-tree retrieval and graph generation, then renders the result on a React Flow canvas. The graph also includes editor utilities and the Supabase sync/storage subsystem; their runtime wiring is not established by the sampled evidence, so uncertain connections are omitted or marked dashed.

Main entry points: [`app/page.tsx`](https://github.com/akash-xcoder/git-flow/blob/main/app/page.tsx) (Web interface), [`lib/repo-graph.ts`](https://github.com/akash-xcoder/git-flow/blob/main/lib/repo-graph.ts) (Repository graph model), [`app/api/github/route.ts`](https://github.com/akash-xcoder/git-flow/blob/main/app/api/github/route.ts) (GitHub inspection API), [`app/api/generate/route.ts`](https://github.com/akash-xcoder/git-flow/blob/main/app/api/generate/route.ts) (Graph generation API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_repo_ingestion["Repository ingestion"]
  node_github_route["GitHub inspection API<br/>[route.ts]"]
end

subgraph group_graph_generation["Graph generation"]
  node_repo_graph["Repository graph model<br/>[repo-graph.ts]"]
  node_generate_route["Graph generation API<br/>[route.ts]"]
end

subgraph group_graph_editor["Graph editor"]
  node_web_ui["Web interface<br/>[page.tsx]"]
  node_canvas["Flow canvas<br/>[page.tsx]"]
  node_layout["Graph layout<br/>[layout.ts]"]
  node_edge_snapping["Edge snapping<br/>[edge-snapping.ts]"]
  node_collision["Node collision<br/>[node-collision.ts]"]
  node_custom_node["Custom node view<br/>[CustomNode.tsx]"]
  node_group_node["Group node view<br/>[GroupNode.tsx]"]
  node_category_styles["Category styles"]
  node_inspector["Node inspector"]
  node_context_menu["Context menu<br/>[ContextMenu.tsx]"]
  node_context_utils["Context utilities"]
  node_export["Image export"]
end

subgraph group_sync_storage["Sync and storage"]
  node_github_sync["GitHub sync function<br/>[index.ts]"]
  node_supabase_db[("Supabase database")]
end

node_engineer(("Repository user"))
node_github{{"GitHub API"}}
node_gemini{{"Gemini"}}

node_engineer -->|"submits repository"| node_web_ui
node_web_ui -.->|"requests tree"| node_github_route
node_github_route -->|"fetches tree"| node_github
node_github_route -->|"filters paths"| node_repo_graph
node_web_ui -.->|"requests graph"| node_generate_route
node_generate_route -->|"generates graph"| node_gemini
node_generate_route -->|"normalizes or derives"| node_repo_graph
node_web_ui -->|"builds topology"| node_repo_graph
node_web_ui -->|"renders graph"| node_canvas
node_web_ui -->|"arranges graph"| node_layout
node_layout -->|"snaps connections"| node_edge_snapping
node_web_ui -->|"updates connections"| node_edge_snapping
node_web_ui -.->|"updates nodes"| node_collision
node_web_ui -->|"renders nodes"| node_custom_node
node_custom_node -->|"uses styles"| node_category_styles
node_web_ui -->|"renders groups"| node_group_node
node_web_ui -->|"edits selection"| node_inspector
node_web_ui -->|"opens actions"| node_context_menu
node_context_menu -->|"builds actions"| node_context_utils
node_context_utils -->|"parses repository"| node_repo_graph
node_web_ui -->|"exports canvas"| node_export
node_github_sync -.->|"persists cache"| node_supabase_db

click node_web_ui "https://github.com/akash-xcoder/git-flow/blob/main/app/page.tsx"
click node_github_route "https://github.com/akash-xcoder/git-flow/blob/main/app/api/github/route.ts"
click node_repo_graph "https://github.com/akash-xcoder/git-flow/blob/main/lib/repo-graph.ts"
click node_generate_route "https://github.com/akash-xcoder/git-flow/blob/main/app/api/generate/route.ts"
click node_canvas "https://github.com/akash-xcoder/git-flow/blob/main/app/page.tsx"
click node_layout "https://github.com/akash-xcoder/git-flow/blob/main/utils/layout.ts"
click node_edge_snapping "https://github.com/akash-xcoder/git-flow/blob/main/src/utils/edge-snapping.ts"
click node_collision "https://github.com/akash-xcoder/git-flow/blob/main/src/utils/node-collision.ts"
click node_custom_node "https://github.com/akash-xcoder/git-flow/blob/main/components/CustomNode.tsx"
click node_group_node "https://github.com/akash-xcoder/git-flow/blob/main/components/GroupNode.tsx"
click node_category_styles "https://github.com/akash-xcoder/git-flow/blob/main/src/utils/node-category-styles.ts"
click node_inspector "https://github.com/akash-xcoder/git-flow/blob/main/components/NodeInspectorPanel.tsx"
click node_context_menu "https://github.com/akash-xcoder/git-flow/blob/main/components/ContextMenu.tsx"
click node_context_utils "https://github.com/akash-xcoder/git-flow/blob/main/src/utils/context-menu-utils.ts"
click node_export "https://github.com/akash-xcoder/git-flow/blob/main/src/utils/react-flow-export.ts"
click node_github_sync "https://github.com/akash-xcoder/git-flow/blob/main/supabase/functions/github-sync/index.ts"
click node_supabase_db "https://github.com/akash-xcoder/git-flow/blob/main/supabase/migrations/20261116212628_create_cached_diagrams.sql"

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_github_route,node_engineer toneBlue
class node_repo_graph,node_generate_route toneAmber
class node_web_ui,node_canvas,node_layout,node_edge_snapping,node_collision,node_custom_node,node_group_node,node_category_styles,node_inspector,node_context_menu,node_context_utils,node_export,node_github toneMint
class node_github_sync,node_supabase_db toneRose
class node_gemini toneIndigo
```

## Components

### Repository ingestion

- [GitHub inspection API](https://github.com/akash-xcoder/git-flow/blob/main/app/api/github/route.ts): `app/api/github/route.ts`

### Graph generation

- [Repository graph model](https://github.com/akash-xcoder/git-flow/blob/main/lib/repo-graph.ts): `lib/repo-graph.ts`
- [Graph generation API](https://github.com/akash-xcoder/git-flow/blob/main/app/api/generate/route.ts): `app/api/generate/route.ts`

### Graph editor

- [Web interface](https://github.com/akash-xcoder/git-flow/blob/main/app/page.tsx): `app/page.tsx`
- [Flow canvas](https://github.com/akash-xcoder/git-flow/blob/main/app/page.tsx): `app/page.tsx`
- [Graph layout](https://github.com/akash-xcoder/git-flow/blob/main/utils/layout.ts): `utils/layout.ts`
- [Edge snapping](https://github.com/akash-xcoder/git-flow/blob/main/src/utils/edge-snapping.ts): `src/utils/edge-snapping.ts`
- [Node collision](https://github.com/akash-xcoder/git-flow/blob/main/src/utils/node-collision.ts): `src/utils/node-collision.ts`
- [Custom node view](https://github.com/akash-xcoder/git-flow/blob/main/components/CustomNode.tsx): `components/CustomNode.tsx`
- [Group node view](https://github.com/akash-xcoder/git-flow/blob/main/components/GroupNode.tsx): `components/GroupNode.tsx`
- [Category styles](https://github.com/akash-xcoder/git-flow/blob/main/src/utils/node-category-styles.ts): `src/utils/node-category-styles.ts`
- [Node inspector](https://github.com/akash-xcoder/git-flow/blob/main/components/NodeInspectorPanel.tsx): `components/NodeInspectorPanel.tsx`
- [Context menu](https://github.com/akash-xcoder/git-flow/blob/main/components/ContextMenu.tsx): `components/ContextMenu.tsx`
- [Context utilities](https://github.com/akash-xcoder/git-flow/blob/main/src/utils/context-menu-utils.ts): `src/utils/context-menu-utils.ts`
- [Image export](https://github.com/akash-xcoder/git-flow/blob/main/src/utils/react-flow-export.ts): `src/utils/react-flow-export.ts`

### Sync and storage

- [GitHub sync function](https://github.com/akash-xcoder/git-flow/blob/main/supabase/functions/github-sync/index.ts): `supabase/functions/github-sync/index.ts`
- [Supabase database](https://github.com/akash-xcoder/git-flow/blob/main/supabase/migrations/20261116212628_create_cached_diagrams.sql): `supabase/migrations/20261116212628_create_cached_diagrams.sql`

### Other components

- **Repository user**
- **GitHub API**
- **Gemini**

## Connections

- Repository user → Web interface: submits repository (evidence: `app/page.tsx`)
- Web interface → GitHub inspection API: requests tree
- GitHub inspection API → GitHub API: fetches tree (evidence: `app/api/github/route.ts`)
- GitHub inspection API → Repository graph model: filters paths (evidence: `app/api/github/route.ts`)
- Web interface → Graph generation API: requests graph
- Graph generation API → Gemini: generates graph (evidence: `app/api/generate/route.ts`)
- Graph generation API → Repository graph model: normalizes or derives (evidence: `app/api/generate/route.ts`)
- Web interface → Repository graph model: builds topology (evidence: `app/page.tsx`)
- Web interface → Flow canvas: renders graph (evidence: `app/page.tsx`)
- Web interface → Graph layout: arranges graph (evidence: `app/page.tsx`)
- Graph layout → Edge snapping: snaps connections (evidence: `utils/layout.ts`)
- Web interface → Edge snapping: updates connections (evidence: `app/page.tsx`)
- Web interface → Node collision: updates nodes (evidence: `app/page.tsx`)
- Web interface → Custom node view: renders nodes (evidence: `app/page.tsx`)
- Custom node view → Category styles: uses styles (evidence: `components/CustomNode.tsx`)
- Web interface → Group node view: renders groups (evidence: `app/page.tsx`)
- Web interface → Node inspector: edits selection (evidence: `app/page.tsx`)
- Web interface → Context menu: opens actions (evidence: `app/page.tsx`)
- Context menu → Context utilities: builds actions (evidence: `components/ContextMenu.tsx`)
- Context utilities → Repository graph model: parses repository (evidence: `src/utils/context-menu-utils.ts`)
- Web interface → Image export: exports canvas (evidence: `app/page.tsx`)
- GitHub sync function → Supabase database: persists cache
