How ashutoshpalhare/repolens works
RepoLens is a browser-based GitHub repository explorer. Users submit a repository reference, then browse its file tree and source, review repository insights, or inspect a lightweight import-dependency map. The documented workflow and sampled code show repository data fetching and analysis coordinated by a React Query hook, with dependency analysis optionally delegated to a worker. The workspace route wiring and several panel implementations were not sampled, so those connections reflect documented capabilities; uncertain implementation details are omitted.
Main entry points: useRepoData.ts Repository data hook · github.ts GitHub API client · index.tsx Repository input · r.$owner.$repo.tsx Repository workspace
Components 19
Repository entry
- Repository input
src/routes/index.tsx - Repository workspace
src/routes/r.$owner.$repo.tsx - Repository overview
src/routes/r.$owner.$repo.overview.tsx - Architecture route
src/routes/r.$owner.$repo.architecture.tsx
Repository data
- Input parser
src/lib/github.ts - Repository data hook
src/hooks/useRepoData.ts - GitHub API client
src/lib/github.ts - Repository data types
src/types/repo.ts
Analysis
- File tree and insights
src/lib/analysis.ts - Source file selection
src/lib/analysis.ts - Source parser
src/lib/parse.ts - Dependency graph builder
src/lib/analysis.ts - Analysis worker
src/lib/deps.worker.ts
Workspace
- File explorer
src/components/repolens/FileExplorer.tsx - Code viewer
src/components/repolens/CodeViewer.tsx - Insights panel
src/components/repolens/InsightsPanel.tsx - Architecture map
src/components/repolens/ArchitectureView.tsx
Other components
- Developer
- GitHub REST API
Connections 24
- Developer → Repository input: enters repository
- Repository input → Input parser: validates reference
- Repository input → Repository workspace: navigates to
- Repository workspace → Repository data hook: loads repository
- Repository data hook → GitHub API client: requests metadata and tree
- GitHub API client → GitHub REST API: fetches repository data
- Repository data hook → File tree and insights: builds tree and insights
- Repository data hook → Repository data types: uses shared data shapes
- Repository data hook → GitHub API client: fetches selected file
- Repository data hook → File explorer: provides file tree
- Repository data hook → Code viewer: provides file content
- Repository data hook → Insights panel: provides insights
- Repository data hook → Repository overview: provides repository data
- Repository workspace → Architecture route: opens architecture
- Repository data hook → Source file selection: selects source files
- Repository data hook → GitHub API client: fetches candidate sources
- Source file selection → Source parser: parses source imports
- Source parser → Dependency graph builder: produces parsed modules
- Repository data hook → Analysis worker: dispatches graph request
- Analysis worker → Dependency graph builder: builds graph
- Repository data hook → Dependency graph builder: builds graph on fallback
- Repository data hook → Architecture map: provides dependency graph
- Architecture route → Architecture map: renders dependency map
- Architecture map → Code viewer: opens selected file