AI-Powered Repository Intelligence & Architecture Visualization Platform
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."
| 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 |
gitSdm/
βββ π api/ # Vercel serverless functions
βββ π server/ # Backend services & router
β βββ ai/ # AI provider, prompt & task handlers
β βββ cache/ # LRU caching layer
β βββ config/ # App configuration & env validation
β βββ github/ # GitHub API client
β βββ graph/ # Graph building & layout algorithms
β βββ parser/ # Dependency & file analysis
β βββ router/ # Modular backend routers (AI, repo, search)
β βββ search/ # Semantic search, embeddings & QA engine
β βββ services/ # Business logic layer
β βββ utils/ # HTTP, logging utilities
βββ π src/ # Frontend application
β βββ app/ # App providers & routing
β βββ components/ # UI components
β β βββ explorer/ # File explorer & code inspector dock
β β βββ home/ # Modular landing page sections
β β βββ ui/ # shadcn/ui primitives & styling wrapper
β β βββ viz/ # Visual workspace modules
β β βββ ai-sidebar/ # Context-aware chat tabs & tools
β β βββ architecture/ # Mermaid configs & interactive generators
β β βββ layout/ # Viz sidebar & workspace layout
β β βββ learning-path/ # Code learning simulation player
β β βββ top-nav/ # Branch switcher & stats menus
β βββ features/ # Feature modules
β β βββ ai/ # AI task integration hooks
β β βββ graph/ # Graph rendering, styles & layout worker
β β βββ canvas/ # ReactFlow & D3-force engines
β β βββ force/ # Custom D3 minimap & canvas painters
β βββ hooks/ # Custom React hooks
β βββ lib/ # Shared API client & utilities
β βββ pages/ # Route-level page components
β βββ stores/ # Zustand global stores (e.g. vizStore)
β βββ styles/ # Tailwind CSS global styles
β βββ types/ # TypeScript definitions
βββ π public/ # Static assets (including layout worker)
βββ π .agents/ # AI agent configurations
- Bun >= 1.1 (recommended runtime and package manager)
- Node.js >= 22 (alternative backend support)
- GitHub Personal Access Token (for API access)
# Clone the repository
git clone https://github.com/bayue48/gitSdm.git
cd gitSdm
# Install dependencies
bun install
# Copy environment variables
cp .env.example .env| 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-2.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 |
# Start development server
bun dev# Build for production
bun run build
# Preview production build
bun run previewThe 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 gitsdmFor 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.
# Deploy directly from source
gcloud run deploy gitsdm \
--source . \
--region asia-southeast1 \
--allow-unauthenticated \
--env-vars-file .env- Instant parsing of any public GitHub repository
- Dependency graph generation with
d3-forceanddagrelayout algorithms - File classification by type (component, utility, config, etc.)
- Module boundary detection for architectural insights
- Architecture summaries via Google Gemini, OpenAI, or Anthropic Claude
- Code explanations for specific files and modules in
StandardandELI5 (Explain It Like I'm 5)modes - Smart file suggestions based on context
- Learning paths for onboarding to new codebases
- Force-directed graphs with
@xyflow/react(React Flow) - Real-time filtering by file type, module, or dependency
- Branch comparison with visual diff
- High-resolution exports to PNG and PDF for dependency maps
- Interactive Mermaid flowcharts with SVG and PNG download support
- Contributor analytics with
rechartsvisualizations - Commit timeline and activity patterns
- Trending repositories discovery
- File explorer with syntax highlighting via
highlight.js - Dynamic presets that automatically adjust based on active AI provider configurations
| 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 4.0 | Styling |
| shadcn/ui 4 | Component primitives |
| Recharts 2 | Charts & analytics |
| Mermaid 11 | Diagram generation |
| html-to-image | Element/SVG to image conversion |
| jsPDF | PDF generation library |
| Lucide React | Icon library |
| 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 |
| Technology | Purpose |
|---|---|
| Google Cloud Run | Deployment platform |
| Docker | Containerization |
| Bun | Package management |
| Bun Test | Testing framework |
| ESLint 9 | Code quality |
Enter a GitHub URL β gitSdm fetches & parses β Interactive graph appears
Click nodes β View file contents β Trace dependencies β Understand modules
Select "Explain Architecture" β AI analyzes structure β Natural language summary
Select branches β Visual diff β See architectural changes
# Run all tests
bun test
# Run with coverage
bun run test:coverage
# Watch mode
bun run test:watchTest files are co-located with source files (25 test suites):
server/ai/provider.test.tsserver/ai/service.test.tsserver/cache/lru.test.tsserver/config/app-config.test.tsserver/github/client.test.tsserver/github/fetch-tree.test.tsserver/github/mock-data.test.tsserver/github/parse-url.test.tsserver/graph/graph-builder.test.tsserver/graph/layout.test.tsserver/parser/dependency-analyzer.test.tsserver/parser/file-classifier.test.tsserver/parser/import-resolver.test.tsserver/parser/manifest-parsers/index.test.tsserver/search/chunker.test.tsserver/search/constants.test.tsserver/search/embedding-provider.test.tsserver/search/qa-engine.test.tsserver/search/search-engine.test.tsserver/search/vector-store.test.tsserver/services/analyze-repo.test.tsserver/services/get-file.test.tsserver/services/trending.test.tsserver/utils/errors.test.tsserver/utils/logger.test.ts
- AI-generated architecture diagrams β High-quality Mermaid flowcharts detailing module boundaries and system workflows.
- Commit History & Activity β Interactive timeline visualizing author patterns and directory churn over time.
- Export to PDF / PNG / SVG β High-res canvas snapshots and vector diagram outputs for documentation.
- Private repository support β Secure OAuth authentication and credential storage to map private codebases.
- Monorepo-aware dependency grouping β Automatic workspace detection (npm/pnpm/yarn) and cross-package mapping.
- AI-powered semantic search & Q&A β Context-aware vector search to ask code questions and locate entry points. (Beta)
- Change impact analysis (Blast Radius) β Visualizer highlighting transitive dependents to predict edit breakages.
- CI/CD integration β GitHub Action to automatically comment visual architecture diffs on PR updates.
- Interactive path pruning & editing β Tools to manually prune/group nodes and export tailored subgraphs.
- Multi-repository mapping β Cross-repo mapping to trace frontend-to-backend API and SDK dependencies.
We welcome contributions! See our contributing guidelines for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Improve graph rendering performance
- Add new AI providers
- Improve parser accuracy
- Create better onboarding flows
- Enhance repository analytics
- 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.
This project is licensed under the MIT License.
See the LICENSE file for more information.
