How hitesh-kumar-s/repomind-ai works
Purpose and Entry Points
RepoMind AI is a Spring Boot application that fetches public repository documentation and selected files, then uses an LLM to produce structured, interview-oriented analysis and answer follow-up questions. The backend starts at src/main/java/com/projectanalyzer/project_analyzer/ProjectAnalyzerApplication.java; the browser UI is served from src/main/resources/static/index.html.
HTTP/API Boundary
REST controllers separate client interactions into repository analysis and contextual chat flows:
• src/main/java/com/projectanalyzer/project_analyzer/controller/AnalyzerController.java
• src/main/java/com/projectanalyzer/project_analyzer/controller/ChatController.java
The frontend submits a repository URL for analysis, renders markdown-oriented output, and sends subsequent questions through the chat endpoint.
Repository Acquisition and Platform Abstraction
RepositoryService is the platform-neutral boundary for obtaining repository context. Platform-specific adapters handle URL/platform differences and remote API calls:
• src/main/java/com/projectanalyzer/project_analyzer/service/RepositoryService.java
• src/main/java/com/projectanalyzer/project_analyzer/service/GitHubService.java
• src/main/java/com/projectanalyzer/project_analyzer/service/GitLabService.java
• src/main/java/com/projectanalyzer/project_analyzer/service/BitbucketService.java
The primary acquisition flow is URL detection → provider service → README/key-file extraction. Public repositories are the intended scope, with branch fallback behavior described for common branch names.
Context Lifecycle
Fetched README and repository-structure information is represented as reusable context, allowing analysis and later chat requests to use the same project grounding:
• src/main/java/com/projectanalyzer/project_analyzer/model/ContextData.java
• src/main/java/com/projectanalyzer/project_analyzer/service/ChatService.java
• src/main/java/com/projectanalyzer/project_analyzer/dto/ChatRequest.java
This is the central anti-hallucination boundary: prompts should be constrained to acquired repository context and documentation quality.
LLM Provider Layer
LLMService abstracts generation from concrete hosted providers:
• src/main/java/com/projectanalyzer/project_analyzer/service/LLMService.java
• src/main/java/com/projectanalyzer/project_analyzer/service/GroqLLMService.java
• src/main/java/com/projectanalyzer/project_analyzer/service/OpenRouterLLMService.java
Analysis requests generate structured sections such as overview, features, stack, architecture, interview explanation, quality assessment, and suggestions. Chat requests reuse prior context and may support differing response modes.
Runtime, Configuration, and External Services
The application runs on Java 17+ with Spring Boot and Maven (pom.xml), normally exposing HTTP on port 8080. Runtime credentials/configuration are held in:
• src/main/resources/application.properties
External dependencies are GitHub, GitLab, and Bitbucket APIs for repository content, plus Groq/OpenRouter LLM APIs. GitHub token support addresses API rate limits. The container entrypoint is defined by Dockerfile; deployment is suitable for Docker/EC2 with API keys injected as environment variables.
Primary Control Flow
1. Client loads the static UI and submits a repository URL.
2. AnalyzerController delegates to repository services to retrieve documentation/context.
3. The selected LLM implementation receives grounded context and returns structured analysis.
4. Context is retained or passed forward for ChatController/ChatService.
5. Chat requests combine the user question with repository context and return a constrained AI response.
Main entry points: RepositoryService.java Repository service · LLMService.java LLM service · AnalyzerController.java Analyzer controller · ChatController.java Chat controller
Components 18
Browser UI
- Static UI · Submits repository URLs and follow-up questions.
src/main/resources/static/index.html
Spring Boot API
- Application entry
src/main/java/com/projectanalyzer/project_analyzer/ProjectAnalyzerApplication.java - Analyzer controller
src/main/java/com/projectanalyzer/project_analyzer/controller/AnalyzerController.java - Chat controller
src/main/java/com/projectanalyzer/project_analyzer/controller/ChatController.java - Repository context · Reusable README and selected repository structure grounding.
src/main/java/com/projectanalyzer/project_analyzer/model/ContextData.java - Chat request
src/main/java/com/projectanalyzer/project_analyzer/dto/ChatRequest.java - Chat service · Combines question and acquired context.
src/main/java/com/projectanalyzer/project_analyzer/service/ChatService.java - Runtime configuration · Credentials and provider settings are injected at runtime.
src/main/resources/application.properties
Repository Acquisition
- Repository service · Detects provider and obtains repository context.
src/main/java/com/projectanalyzer/project_analyzer/service/RepositoryService.java - GitHub adapter
src/main/java/com/projectanalyzer/project_analyzer/service/GitHubService.java - GitLab adapter
src/main/java/com/projectanalyzer/project_analyzer/service/GitLabService.java - Bitbucket adapter
src/main/java/com/projectanalyzer/project_analyzer/service/BitbucketService.java
LLM Layer
- LLM service · Produces structured analysis and constrained answers.
src/main/java/com/projectanalyzer/project_analyzer/service/LLMService.java - Groq implementation
src/main/java/com/projectanalyzer/project_analyzer/service/GroqLLMService.java - OpenRouter implementation
src/main/java/com/projectanalyzer/project_analyzer/service/OpenRouterLLMService.java
External APIs
- Repository APIs · GitHub, GitLab, and Bitbucket public repository APIs.
- LLM APIs · Groq and OpenRouter.
Other components
- Container image
Dockerfile
Connections 25
- Static UI → Analyzer controller: analyze repository
- Static UI → Chat controller: ask follow-up
- Application entry → Analyzer controller: serves HTTP
- Application entry → Chat controller: serves HTTP
- Analyzer controller → Repository service: fetch context
- Repository service → GitHub adapter: detects GitHub URL
- Repository service → GitLab adapter: detects GitLab URL
- Repository service → Bitbucket adapter: detects Bitbucket URL
- GitHub adapter → Repository APIs: read files
- GitLab adapter → Repository APIs: read files
- Bitbucket adapter → Repository APIs: read files
- Repository service → Repository context: builds grounded context
- Analyzer controller → LLM service: request analysis
- Repository context → LLM service: grounds prompt
- Chat request → Chat controller: request payload
- Chat controller → Chat service: delegate chat
- Chat service → Repository context: reuse context
- Chat service → LLM service: generate answer
- LLM service → Groq implementation: provider implementation
- LLM service → OpenRouter implementation: provider implementation
- Groq implementation → LLM APIs: inference request
- OpenRouter implementation → LLM APIs: inference request
- Runtime configuration → Repository service: provider credentials
- Runtime configuration → LLM service: provider settings
- Container image → Application entry: runs application