Code Relationship VisualizerCode Relationship Visualizer OverviewOverview Code Relationship Visualizer is a developer tool that analyzes source code and generates interactive dependency graphs, helping developers understand large codebases faster. The tool scans project files, extracts relationships between modules, services, classes, and functions, and visualizes those relationships in an interactive graph. ExampleExample Instead of manually tracing dependencies: UserService
AuthService
TokenManager Developers can explore the architecture visually through an interactive interface. Problem StatementProblem Statement As software projects grow, understanding code relationships becomes increasingly difficult. Common challenges include: Large repositories with hundreds of files Unknown dependencies between modules Difficult onboarding for new developers Hidden circular dependencies Complex refactoring processes Lack of architecture visibility Developers often spend significant time reading code before understanding how components interact. Proposed SolutionProposed Solution Create a tool that automatically analyzes source code and generates: Dependency graphs Call graphs Architecture maps Circular dependency reports Dead code reports Impact analysis visualizations The generated output should be easy to explore through a web-based interactive interface. Project GoalsProject Goals Primary GoalsPrimary Goals Simplify understanding of large repositories Improve developer onboarding Reduce time spent tracing dependencies Assist in architecture reviews Support refactoring activities Secondary GoalsSecondary Goals Detect architectural issues Identify unused modules Generate documentation automatically Integrate into development workflows
Product VisionProduct Vision The project should evolve into a complete Code Intelligence Platform. Initial VisionInitial Vision npx codeviz Generate dependency reports instantly. Long-Term VisionLong-Term Vision npx codeviz analyze
Core FeaturesCore Features
Analyze imports and module references.
UserController
UserService
UserRepository OutputOutput
Zoom and Pan Support
Track function-to-function relationships.
login()
authenticate()
generateToken() Useful for understanding execution flow.
Detect dependency loops.
Identify unused files and modules.
PaymentService.ts Not referenced anywhere.
Select a node and view all affected components.
AuthService
UserService AdminService SessionService Useful before refactoring.
Allow teams to define architecture rules.
Target UsersTarget Users Individual DevelopersIndividual Developers Understanding unfamiliar projects
Learning architecture Development TeamsDevelopment Teams Onboarding new members Code reviews Architecture discussions Open Source ContributorsOpen Source Contributors Understanding large repositories Navigating unfamiliar codebases Supported LanguagesSupported Languages Version 1Version 1 JavaScript TypeScript
TypeScript Compiler API provides reliable AST parsing. Version 2Version 2
Using Python's built-in AST module. Version 3Version 3
Additional language support through dedicated parsers. System ArchitectureSystem Architecture
AST Parser
Technical ComponentsTechnical Components File ScannerFile Scanner Responsible for locating source files. Supported patterns: src//*.ts src//.tsx src/**/.js src/**/*.jsx AST ParserAST Parser Extracts imports, exports, classes, and function relationships.
import { AuthService } from './auth'
"source": "UserService", "target": "AuthService"
Graph BuilderGraph Builder Transforms relationships into graph structures.
Visualization EngineVisualization Engine Renders interactive dependency maps.
Recommended Technology StackRecommended Technology Stack Core EngineCore Engine LanguageLanguage TypeScript ParsingParsing TypeScript Compiler API CLI FrameworkCLI Framework
Build ToolBuild Tool tsup TestingTesting
LintingLinting ESLint VisualizationVisualization Preferred OptionPreferred Option
Modern UI
AlternativeAlternative
Product InterfacesProduct Interfaces
- CLI Interface1. CLI Interface Primary interface.
npx codeviz or npx codeviz src
- HTML Report Generator2. HTML Report Generator
npx codeviz --html
report/ ├── index.html ├── assets/ └── graph.json Open directly in a browser.
- VS Code Extension3. VS Code Extension Potential future feature.
- GitHub Action4. GitHub Action Analyze pull requests automatically.
- uses: codeviz/action Outputs architecture changes within PR comments. Development RoadmapDevelopment Roadmap Phase 1 — MVPPhase 1 — MVP GoalGoal Dependency extraction and CLI output.
[x] File scanning [x] AST parsing [x] Dependency extraction [x] Terminal visualization
4 weeks
Phase 2 — Interactive VisualizationPhase 2 — Interactive Visualization GoalGoal Generate interactive HTML reports.
[x] Cytoscape.js integration [x] Search functionality [x] Zoom and pan [x] Node inspection [x] Impact analysis
4 weeks Phase 3 — Advanced AnalysisPhase 3 — Advanced Analysis
[x] Circular dependency detection [x] Dead code detection [x] Architecture validation
4 weeks Phase 4 — EcosystemPhase 4 — Ecosystem
VS Code Extension GitHub Action CI/CD Integration
4–6 weeks Future OpportunitiesFuture Opportunities SaaS PlatformSaaS Platform Potential cloud offering: npx codeviz upload
Enterprise FeaturesEnterprise Features
Success MetricsSuccess Metrics
Faster onboarding time Reduced architecture misunderstandings Reduced refactoring risks Increased repository visibility Improved developer productivity Project TaglineProject Tagline "Understand your codebase before reading every file."