How bhavesh-ahuja/ai-github-map works
Project type and purpose
• This is a full-stack web application (“AI GitHub Knowledge Map”) whose goal is to ingest GitHub repositories, build a knowledge graph, and surface AI-powered summaries and RAG (Retrieval-Augmented Generation) Q&A over that graph.
File structure
• Top-level:
– README.md (project overview)
– backend/ (Python service layer)
– frontend/ (React app with Vite)
• backend/:
– main.py (entry point, likely Flask/FastAPI server)
– services/file_service.py (file system operations, parsing)
– services/git_service.py (interacts with GitHub or git CLI)
• frontend/:
– package.json, vite.config.js (build tooling)
– src/ (React components, CSS, assets)
– public/, index.html (static assets)
• No obvious database folder—likely uses in-memory or external vector store/AI service.
README
• Feature callouts:
• Repository parsing → handled by file_service/git_service
• Knowledge Graph visualization → frontend graph component(s)
• AI-powered summaries & RAG Q&A → backend calls to LLM or vector database
Main components
a. Frontend (React + Vite)
• UI components (RepoInput, Sidebar, Graph View in Layout)
• HTTP client to backend API
b. Backend API (Python)
• main.py serving REST or WebSocket endpoints
• FileService for file I/O and code parsing
• GitService for cloning/fetching from GitHub
• AI/VectorService (external) for embeddings, RAG, summaries (implied)
c. External Services
• GitHub API (or git CLI)
• AI/LLM provider (OpenAI, Anthropic, etc.)
• Vector database or caching layer (e.g., Pinecone, Weaviate)
d. Data stores (if any)
• In-memory or file-based storage for knowledge graph
• Optional persisted store for embeddings
Relationships and interactions
• User → interacts with Frontend UI
• Frontend → sends HTTP requests (repo URL, query) to Backend API
• Backend API →
1. uses GitService to fetch/clone repository
2. uses FileService to parse files and build graph model
3. calls AI/VectorService for embeddings, indexing, summaries, Q&A
4. returns graph data or AI responses
• Frontend → renders graph, displays summaries, handles user queries
Architectural patterns & design principles
• Layered architecture: UI layer; application/API layer; service layer; external integrations.
• Separation of concerns: file parsing vs. git interactions vs. AI logic.
• Stateless backend processes each request, delegates to specialized services.
• Frontend as single-page application; backend as microservice/API.
Technologies, frameworks, libraries
• Frontend: React, Vite, ESLint, Axios/fetch
• Backend: Python (Flask or FastAPI), Pydantic (maybe), HTTP server
• External: GitHub REST API or git CLI; OpenAI SDK or similar; vector DB client
• Notes on protocols (HTTP/REST, WebSocket) and data formats (JSON, embeddings)