Skip to content

bayue48/gitSdm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

gitSdmΞ² (Git Software Dependency Map Beta v0.9.0)

AI-Powered Repository Intelligence & Architecture Visualization Platform

TypeScript React Vite License PRs Welcome Build


Repository Graph


✨ Overview

gitSdm transforms how developers understand unfamiliar codebases. Instead of spending hours reading through files and tracing dependencies, gitSdm provides instant, interactive architecture visualization powered by AI.

"The kind of deep insight that normally takes days of reading code β€” delivered in seconds."

🎯 Value Proposition

Problem Solution
πŸ•’ Hours spent onboarding to new repos ⚑ Instant architecture overview
πŸ” Manual dependency tracing πŸ•ΈοΈ Interactive dependency graph
πŸ“š Scattered documentation πŸ€– AI-generated code explanations
🧩 Unclear module boundaries 🎯 Visual file classification

πŸ—οΈ Architecture

gitSdm/
β”œβ”€β”€ πŸ“ api/                    # Vercel serverless functions
β”‚   β”œβ”€β”€ ai/                    # AI endpoints (architecture, explain, suggest)
β”‚   β”œβ”€β”€ repo/                  # Repository data endpoints
β”‚   └── trending.ts            # Trending repositories
β”œβ”€β”€ πŸ“ server/                 # Backend services
β”‚   β”œβ”€β”€ ai/                    # AI provider & prompt management
β”‚   β”œβ”€β”€ cache/                 # LRU caching layer
β”‚   β”œβ”€β”€ github/                # GitHub API integration
β”‚   β”œβ”€β”€ graph/                 # Graph building & layout algorithms
β”‚   β”œβ”€β”€ parser/                # Dependency & file analysis
β”‚   β”œβ”€β”€ services/              # Business logic layer
β”‚   └── utils/                 # HTTP, logging utilities
β”œβ”€β”€ πŸ“ src/                    # Frontend application
β”‚   β”œβ”€β”€ app/                   # App providers & routing
β”‚   β”œβ”€β”€ components/            # UI components
β”‚   β”‚   β”œβ”€β”€ contributors/      # Contributor analytics
β”‚   β”‚   β”œβ”€β”€ explorer/          # File explorer & code inspector
β”‚   β”‚   β”œβ”€β”€ home/              # Landing page components
β”‚   β”‚   β”œβ”€β”€ layout/            # Navigation & layout
β”‚   β”‚   β”œβ”€β”€ theme/             # Theme synchronization
β”‚   β”‚   β”œβ”€β”€ timeline/          # Repository timeline
β”‚   β”‚   β”œβ”€β”€ ui/                # Reusable UI primitives
β”‚   β”‚   └── viz/               # Visualization components
β”‚   β”œβ”€β”€ features/              # Feature modules
β”‚   β”‚   β”œβ”€β”€ ai/                # AI integration hooks
β”‚   β”‚   └── graph/             # Graph rendering engine
β”‚   β”œβ”€β”€ hooks/                 # Custom React hooks
β”‚   β”œβ”€β”€ lib/                   # Utilities & API client
β”‚   β”œβ”€β”€ pages/                 # Route pages
β”‚   β”œβ”€β”€ stores/                # State management
β”‚   β”œβ”€β”€ styles/                # Global styles
β”‚   └── types/                 # TypeScript definitions
β”œβ”€β”€ πŸ“ public/                 # Static assets
β”œβ”€β”€ πŸ“ assets/                 # Screenshots & media
└── πŸ“ .agents/                # AI agent configurations

πŸš€ Quick Start

Prerequisites

  • Node.js β‰₯ 22 (Alpine)
  • pnpm β‰₯ 9 (recommended) or npm/yarn
  • GitHub Personal Access Token (for API access)

Installation

# Clone the repository
git clone https://github.com/bayue48/gitSdm.git
cd gitSdm

# Install dependencies
pnpm install

# Copy environment variables
cp .env.example .env

Environment Configuration

Variable Description
GITHUB_TOKEN Optional. Increases GitHub API rate limits for public repos
AI_PROVIDER mock (default), gemini,openai, or anthropic
OPENAI_API_KEY Required when AI_PROVIDER=openai
ANTHROPIC_API_KEY Required when AI_PROVIDER=anthropic
GEMINI_API_KEY Required when AI_PROVIDER=gemini
GEMINI_MODEL Optional when AI_PROVIDER=gemini; defaults to gemini-1.5-flash
GEMINI_API_VERSION Optional when AI_PROVIDER=gemini; defaults to v1alpha
OPENAI_MODEL Optional when AI_PROVIDER=openai; defaults to gpt-4o-mini
ANTHROPIC_MODEL Optional when AI_PROVIDER=anthropic; defaults to claude-3-5-haiku-latest

Development

# Start development server (frontend + backend)
pnpm dev

# Or run separately:
pnpm dev:frontend  # Vite dev server on :5173
pnpm dev:backend   # Express dev server on :3001

Production Build

# Build for production
pnpm build

# Preview production build
pnpm preview

Docker Deployment

The Docker image builds the Vite app, bundles a small Node server, serves static files from dist/, and handles /api/* using the same API router as development/Vercel.

# Build Docker image
docker build -t gitsdm .

# Run container
docker run -p 3000:3000 --env-file .env gitsdm

For minimal setup, GITHUB_TOKEN is optional but recommended. AI features use AI_PROVIDER=mock by default; set the matching API key when using gemini, openai, or anthropic.

Google Cloud Run

# Deploy directly from source
gcloud run deploy gitsdm \
  --source . \
  --region asia-southeast1 \
  --allow-unauthenticated \
  --env-vars-file .env

🧩 Core Features

πŸ”¬ Repository Analysis

  • Instant parsing of any public GitHub repository
  • Dependency graph generation with d3-force and dagre layout algorithms
  • File classification by type (component, utility, config, etc.)
  • Module boundary detection for architectural insights

πŸ€– AI-Powered Insights

  • Architecture summaries via Google Gemini, OpenAI, or Anthropic Claude
  • Code explanations for specific files and modules in Standard and ELI5 (Explain It Like I'm 5) modes
  • Smart file suggestions based on context
  • Learning paths for onboarding to new codebases

πŸ•ΈοΈ Interactive Visualization

  • Force-directed graphs with @xyflow/react (React Flow)
  • Real-time filtering by file type, module, or dependency
  • Branch comparison with visual diff
  • Mermaid diagram export for documentation

πŸ“Š Repository Intelligence

  • Contributor analytics with recharts visualizations
  • Commit timeline and activity patterns
  • Trending repositories discovery
  • File explorer with syntax highlighting via highlight.js

πŸ› οΈ Technology Stack

Frontend

Technology Purpose
React 19 UI framework
TypeScript 5.8 Type safety
Vite 6 Build tooling
@xyflow/react 12 Graph visualization
Framer Motion 12 Animations
TanStack React Query 5 Data fetching
Tailwind CSS 3.4 Styling
Recharts 2 Charts & analytics
Mermaid 11 Diagram generation
Lucide React Icon library

Backend

Technology Purpose
Node.js 22 Runtime
Express (via Vercel) API server
Octokit 21 GitHub API client
LRU Cache 11 Response caching
Google GenAI 2.6 AI provider
OpenAI 4 AI provider
Anthropic SDK 0.39 AI provider

Infrastructure

Technology Purpose
Google Cloud Run Deployment platform
Docker Containerization
pnpm Package management
Vitest Testing framework
ESLint 9 Code quality

πŸ“– Usage Guide

1. Analyze a Repository

Enter a GitHub URL β†’ gitSdm fetches & parses β†’ Interactive graph appears

2. Explore Architecture

Click nodes β†’ View file contents β†’ Trace dependencies β†’ Understand modules

3. Get AI Insights

Select "Explain Architecture" β†’ AI analyzes structure β†’ Natural language summary

4. Compare Branches

Select branches β†’ Visual diff β†’ See architectural changes

πŸ§ͺ Testing

# Run all tests
pnpm test

# Run with coverage
pnpm test:coverage

# Watch mode
pnpm test:watch

Test files are co-located with source files:

  • server/parser/manifest-parsers/index.test.ts
  • server/github/parse-url.test.ts
  • server/graph/graph-builder.test.ts
  • server/graph/layout.test.ts
  • server/parser/dependency-analyzer.test.ts
  • server/parser/file-classifier.test.ts

πŸ—ΊοΈ Roadmap

Planned Features

  • AI-generated architecture diagrams
  • Commit History
  • Private repository support
  • Export to PDF / PNG
  • Monorepo-aware dependency grouping

🀝 Contributing

We welcome contributions! See our contributing guidelines for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Contribution Ideas

  • Improve graph rendering performance
  • Add new AI providers
  • Improve parser accuracy
  • Create better onboarding flows
  • Enhance repository analytics

πŸ”’ Security

  • API keys are never exposed to the client
  • Environment variables are securely handled
  • Rate limiting prevents abuse
  • GitHub API access follows OAuth best practices

If you discover a vulnerability, please open a private security report.


πŸ“„ License

This project is licensed under the MIT License.

See the LICENSE file for more information.


About

AI-powered repository intelligence and architecture visualization platform that helps developers instantly understand unfamiliar GitHub repositories through interactive graphs and AI-generated insights.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages