MapMyRepo is a powerful AI-powered visualization tool that transforms any GitHub repository or local codebase into an interactive, navigable node graph. Perfect for understanding complex architectures, onboarding new developers, or exploring unfamiliar codebases.
Features β’ Demo β’ Installation β’ Usage β’ Tech Stack
- Force-Directed Layout: Files and folders represented as interconnected nodes using D3.js
- Smooth Navigation: Zoom, pan, and drag nodes to explore your codebase intuitively
- Visual Hierarchy: Distinct icons and colors for folders, files, and different file types
- Node Expansion: Double-click folders to expand/collapse their contents dynamically
- Smart Summaries: Automatically generates architectural overviews for folders and files
- Code Analysis: Explains the purpose, exports, and key functionality of individual files
- Contextual Q&A: Ask questions about your codebase and get intelligent, context-aware answers
- Real-time Insights: Chat interface integrated directly into the node selection panel
- Local Upload: Drag and drop folders directly from your file system
- GitHub Integration: Paste any public GitHub repository URL to visualize instantly
- Smart Parsing: Automatically filters out
node_modules,.git, and other build artifacts
- Dark/Light Mode: Fully themed interface that adapts to your preference
- Glassmorphism Design: Sleek, modern sidebar with backdrop blur effects
- Responsive Layout: Works seamlessly on desktop and tablet devices
- Animated Backgrounds: Dynamic particle effects and grid animations
Try visualizing any public repository:
https://github.com/facebook/react
https://github.com/microsoft/vscode
https://github.com/vercel/next.js
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher) - Download here
- npm or yarn package manager
- Git - Download here
- Google Gemini API Key - Get one free
git clone https://github.com/vasu-devs/MapMyRepo.git
cd MapMyRepoUsing npm:
npm installOr using yarn:
yarn installCreate a .env.local file in the root directory:
# For Windows
copy .env.example .env.local
# For macOS/Linux
cp .env.example .env.localThen add your API keys to .env.local:
# Google Gemini AI API Key (Required)
VITE_GEMINI_API_KEY=your_gemini_api_key_here
# GitHub Personal Access Token (Optional - for private repos and higher rate limits)
VITE_GITHUB_TOKEN=your_github_token_hereπ Getting Your API Keys:
- Gemini API Key: Visit Google AI Studio, sign in, and click "Create API Key"
- GitHub Token (Optional): Go to GitHub Settings > Developer settings > Personal access tokens and generate a new token with
reposcope
npm run devThe application will start at http://localhost:5173 (Vite's default port).
npm run buildThe optimized build will be created in the dist folder.
To preview the production build locally:
npm run preview- Click the upload zone or drag and drop a folder from your file system
- MapMyRepo will parse the directory structure (excludes
node_modules,.git, etc.) - The graph will render automatically
- Paste a full GitHub repository URL into the input field:
https://github.com/username/repository - Press Enter or click the arrow button
- The repository will be fetched and visualized
| Action | Effect |
|---|---|
| Scroll | Zoom in/out |
| Click + Drag | Pan across the canvas |
| Click Node | Select node and open sidebar |
| Double-Click Folder | Expand/collapse folder contents |
| Hover Node | Highlight connected nodes |
Once you select a node:
- Details Tab: View file/folder metadata and AI-generated architectural summary
- Discussion Tab: Ask questions like:
- "What does this file do?"
- "Where is authentication handled?"
- "Explain the routing structure"
- "What are the main exports of this module?"
Click the theme toggle button (βοΈ/π) in the top-right corner to switch between light and dark modes.
| Technology | Purpose |
|---|---|
| React 19 | UI framework with modern hooks |
| TypeScript | Type-safe JavaScript |
| Vite | Lightning-fast build tool |
| D3.js | Force-directed graph visualization |
| Tailwind CSS | Utility-first styling |
| Google Gemini AI | Code analysis and Q&A |
| Marked | Markdown rendering for AI responses |
| JetBrains Mono | Developer-friendly monospace font |
MapMyRepo/
βββ components/
β βββ FileUploader.tsx # Landing page & upload logic
β βββ RepoVisualizer.tsx # D3.js graph visualization
β βββ Sidebar.tsx # Node details & AI chat panel
β βββ SearchBar.tsx # (Future) Search functionality
βββ services/
β βββ fileService.ts # File parsing & GitHub API integration
β βββ geminiService.ts # Google Gemini AI integration
βββ public/
β βββ favicon.svg # App favicon
β βββ ...
βββ App.tsx # Main application layout
βββ index.tsx # React entry point
βββ types.ts # TypeScript type definitions
βββ vite.config.ts # Vite configuration
βββ tsconfig.json # TypeScript configuration
βββ package.json # Project dependencies
The project uses Vite with React plugin. Key configurations in vite.config.ts:
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
server: {
port: 5173,
},
build: {
outDir: 'dist',
},
})For private repositories or to avoid rate limits, configure a GitHub Personal Access Token:
- Generate a token at github.com/settings/tokens
- Select
reposcope for private repositories - Add to
.env.local:VITE_GITHUB_TOKEN=your_token_here
Contributions are welcome! Here's how you can help:
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/MapMyRepo.git
- Create a branch:
git checkout -b feature/amazing-feature
- Make your changes and commit:
git commit -m "Add amazing feature" - Push to your fork:
git push origin feature/amazing-feature
- Open a Pull Request
- Follow the existing code style (TypeScript, React Hooks)
- Add TypeScript types for all new code
- Test your changes thoroughly
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini AI for powerful code analysis capabilities
- D3.js community for excellent graph visualization tools
- React and Vite teams for modern web development tools
Vasudev Siddharth
- GitHub: @vasu-devs
- Twitter/X: @Vasu_Devs
- Portfolio: [Coming Soon]
Graph doesn't render
- Ensure your repository has valid file structure
- Check browser console for errors
- Try clearing browser cache and reloading
AI features not working
- Verify
VITE_GEMINI_API_KEYis correctly set in.env.local - Check that the API key is valid at Google AI Studio
- Ensure you have an active internet connection
GitHub repository fetch fails
- Ensure the repository URL is correct and public
- For private repos, add
VITE_GITHUB_TOKENto.env.local - Check if you've hit GitHub API rate limits (60 requests/hour without token)
Application won't start
- Delete
node_modulesand reinstall:rm -rf node_modules && npm install - Ensure you're using Node.js v18 or higher:
node --version - Check for port conflicts on 5173
- Add search functionality to find specific files/folders
- Export graph as image (PNG/SVG)
- Support for private GitHub repositories
- Dependency graph visualization for imports/exports
- Code metrics and statistics dashboard
- Multi-repository comparison view
- VSCode extension integration
If you find MapMyRepo useful, please consider:
- β Starring this repository
- π¦ Sharing on Twitter/X
- π Reporting bugs and issues
- π‘ Suggesting new features
Made with β€οΈ and β by Vasu-Devs