RepoLens is a premium, high-performance web and desktop platform designed to discover, scan, audit, and analyze GitHub repositories. It integrates advanced AI model pipelines with repository telemetry to deliver code review feeds, interactive architecture maps, security audits, and developer metrics.
This repository is structured as a unified monorepo containing both the React frontend and Spring Boot backend, designed to compile and deploy under a single unified web service.
π Live Demo: https://repolens-7hhs.onrender.com
- System Architecture
- Key Features & Capabilities
- Performance & Optimization Engine
- Technology Stack
- Unified Docker & Deployment Pipeline
- Desktop Launcher (
RepoLens.exe) - Local Development Setup
- Detailed Technical Architecture
RepoLens adopts a single-origin, unified architecture where the React SPA frontend is built and served directly by the Spring Boot embedded Tomcat container. This eliminates CORS concerns, optimizes static asset delivery, and enables single-service hosting.
graph TD
User[Browser / Client] -->|HTTP Requests| SpringBoot[Spring Boot Tomcat Server - Port 8080]
SpringBoot -->|Serves Static Assets| ReactSPA[React SPA Frontend]
SpringBoot -->|API Endpoints /api/v1/*| APIControllers[API Controllers]
SpringBoot -->|Fallback Forwarding| ReactRouter[SPA Route Redirect /index.html]
APIControllers -->|AI Queries| GeminiAPI[Google Gemini 2.5 AI Model]
APIControllers -->|Metadata & Content| GitHubAPI[GitHub REST API]
ReactSPA -->|Download Link| DesktopEXE[RepoLens.exe Static Asset]
The React frontend static files are compiled into dist and copied into src/main/resources/static/ of the backend resources during build time. The entire application runs as a single JAR package.
To support client-side routing (React Router) natively under Spring Boot, WebViewController.java intercepts client browser refreshes on routes like /repository/** and forwards them internally to /index.html.
In production, frontend API fetches automatically omit base URLs and query relative endpoints (/api/v1/...). In local development mode (npm run dev), the client falls back to querying the backend service on http://localhost:8080.
Replaces generic scores with a detailed evaluation matrix across 8 core dimensions:
- Architecture (e.g. modularity, layer separation)
- Maintainability (code cleaniness, complexity)
- Documentation (inline comments, README maturity)
- Testing (unit/integration suite health)
- Security (secrets leak detection, vulnerability audit)
- Scalability (concurrency, load management)
- Code Organization (directory tree structures)
- Dependency Health (outdated libraries, bloat check)
Presents strength metrics represented as sleek, CSS-visualized horizontal bar charts for quick identification of backend, frontend, devops, database, performance, and AI-native capabilities.
Renders a grid mapping critical threats (Documentation gaps, Security concerns, Testing lacks, Dependency status, and Technical Debt levels) using intuitive color-coded indicators (Green, Yellow, Red) and clear recommendations.
Visualizes backend layers, frontend layers, database layers, and testing components. Clicking any architectural layer filters the code review comments to show findings corresponding to that module.
An interactive milestone tracker charting year-over-year repository evolution, structural upgrades, and main release points.
Features backend skill checks, interview readiness indicators, star ratings across backend/documentation/readiness, and explicit recruiter recommendation tags to assess repository quality.
Allows users to type another repository (e.g., mybatis/spring) and render comparative tables side-by-side (health scores, maintainability, technology stack, and recommender stars).
Context-aware suggestion pills positioned directly above the typing input box to quickly request architecture breakdowns, code reviews, and dependency checks.
RepoLens incorporates advanced client-side caching and fetch cancellation architectures to feel instant:
- Search Cache: Page queries, slider parameters, and results lists are cached in memory. Navigating back from detail views restores states instantly.
- Detail Metadata Cache: Caches tech stacks, health score matrices, AI summaries, and structural diagrams per repository. Detail pages load in under 50ms.
- File Explorer Cache: Persists previously opened directory folders and file code drawer text previews in memory. Expanding, collapsing, and selecting files is instant.
GitHub API profile lookups check locally stored ETags (If-None-Match). Unmodified assets return 304 Not Modified, preserving rate limit quotas.
Pending backend search queries and repository details fetches are aborted instantly if the user updates parameters or navigates away. This prevents overlapping state commits, race conditions, and memory leaks.
- React 18 & TypeScript
- Vite (Build toolchain)
- Framer Motion (Spring layout transitions)
- Lucide React (Branding iconography)
- Spring Boot 3.x & Java 21
- Maven (Dependency manager)
- Google Gemini Client (Integrated with the
gemini-3.5-flashmodel)
- C# (.NET Framework) (Compiles native executable wrapper)
- PowerShell (Automated zip extraction and packaging scripts)
The project's root Dockerfile defines a 3-stage multi-stage builder to create a lightweight, optimized runtime image:
# Stage 1: Build React SPA
FROM node:20-alpine AS frontend-build
WORKDIR /app
COPY titansearch-frontend/package*.json ./
RUN npm install
COPY titansearch-frontend/ ./
RUN npm run build
# Stage 2: Build Spring Boot Backend
FROM maven:3.9-amazoncorretto-21 AS backend-build
WORKDIR /app
COPY titansearch-backend/pom.xml ./
RUN mvn dependency:go-offline
COPY titansearch-backend/ ./
COPY --from=frontend-build /app/dist/ ./src/main/resources/static/
# Packages the precompiled desktop executable for direct user download
COPY RepoLens.exe ./src/main/resources/static/
RUN mvn clean package -DskipTests
# Stage 3: Run Application
FROM amazoncorretto:21-alpine
WORKDIR /app
COPY --from=backend-build /app/target/*.jar app.jar
EXPOSE 8080
ENV SPRING_PROFILES_ACTIVE=prod
ENTRYPOINT ["java", "-jar", "app.jar"]RepoLens includes a native C# launcher and self-contained installer (RepoLens.exe) that deploys a local environment.
- From Web App Browser (Recommended): Download directly from the sidebar of the running website at
/RepoLens.exe. - From GitHub Releases: π Download RepoLens for Windows v0.2.0
- Current Version:
v0.2.0 - File Size:
32.48 MB - Architecture:
Windows 10 / 11 (64-bit) - Dependencies: Docker Desktop (required to run local databases and service containers)
- Prerequisites: Ensure Docker Desktop is installed and running on your system.
- Download: Click the download link above to fetch the
RepoLens.exeinstaller. - Execution: Double-click
RepoLens.exeto run the first-time setup wizard. The installer will automatically:- Extract the Spring Boot JAR runtime and React static assets to
%LocalAppData%\RepoLens\. - Setup a local Docker Compose context and start all service containers.
- Configure a clean uninstaller entry in Windows settings under Programs and Features.
- Create desktop and Start Menu shortcuts.
- Extract the Spring Boot JAR runtime and React static assets to
- Onboarding: Once services initialize, the browser automatically opens to
http://localhost:3000. You will be welcomed by the onboarding setup screen, prompting you to enter your personal API keys (GitHub token and Gemini API key) which are validated on the spot and securely stored locally.
To cleanly remove RepoLens from your machine, simply:
- Open Windows Apps & Features / Settings.
- Search for RepoLens and click Uninstall.
- The uninstaller will automatically run
docker compose down -vto purge container databases, delete shortcuts, remove registry keys, and wipe%LocalAppData%\RepoLens\.
- Java JDK 21
- Node.js 20+
- Maven 3.8+
- Navigate to the backend directory:
cd titansearch-backend - Export your developer API keys in your terminal environment:
export GITHUB_TOKEN="your_github_token" export GEMINI_API_KEY="your_gemini_api_key"
- Run the Spring Boot application:
mvn spring-boot:run
- Navigate to the frontend directory:
cd titansearch-frontend - Install dependencies:
npm install
- Run in developer hot-reload mode:
npm run dev
- Access the frontend in your browser at
http://localhost:5173.
To compile changes into the self-contained launcher executable, execute the build script from a PowerShell terminal at the root:
.\build_launcher.ps1This generates the packaged client wrapper at RepoLens.exe.
When a user requests repository analysis or health summaries, the backend schedules async operations using @Async on background threads (handled by Spring's task executors) to avoid blocking the main request thread:
- The Challenge: Asynchronous threads do not share the servlet request thread's thread-local storage. Thus,
RequestContextHolder.getRequestAttributes()returns null in background threads. This prevents standard REST controllers from propagating client-provided headers (X-GitHub-TokenandX-Gemini-Key). - The Solution: RepoLens implements a SecurityContext class using
ThreadLocalvariables. The controllers extract the token and keys from the request headers and pass them as method parameters to the asynchronous services. The background threads then populate their ownSecurityContextat startup. - Integration: RestClient interceptors and Gemini API clients pull authorization details from
SecurityContextwhenRequestContextHolderreturns null, allowing secure, authenticated API requests in background tasks.
sequenceDiagram
participant Browser
participant Controller
participant AsyncService
participant SecurityContext
participant GitHub/Gemini
Browser->>Controller: GET /ai-summary (with X-GitHub-Token)
Controller->>AsyncService: generateSummaryAsync(repository, token)
Controller->>Browser: 202 ACCEPTED (PENDING)
Note over AsyncService: Runs in background thread pool
AsyncService->>SecurityContext: setGitHubToken(token)
AsyncService->>GitHub/Gemini: Fetch Data (Interceptor extracts token from SecurityContext)
AsyncService->>SecurityContext: clear()
GitHub's file archive endpoint redirects browser queries to codeload.github.com, which lacks appropriate CORS headers for web-based downloads:
- Direct Downloads: When fetching directly in the browser, the cross-origin preflight/redirect fails.
- Proxy Implementation: RepoLens implements a proxy endpoint
/api/v1/repositories/{owner}/{repo}/zip. - Server-to-Server Stream: The React frontend requests this endpoint passing user credentials in the headers. The backend
RestClientfetches the zip archive directly from GitHub, handles the redirect, streams the binary data as a byte array, and writes it directly to the response output stream withapplication/zipMIME type headers. This circumvents browser CORS checks entirely.
To ensure fast, secure, and style-consistent markdown rendering without loading heavy external dependencies:
- Markdown Parser: The chat interface uses a custom regex-based parser,
renderChatMarkdown, that operates on client message logs. - Parsed Components:
- Fenced Code Blocks: Translates
```lang code ```to clean<pre>blocks with inline-overflow scrolling. - Tables: Parses table delimiters (
|) and structures them into properly formatted HTML tables. - Bold/Italics: Translates
**text**and*text*to strong/em elements. - Links/Paragraphs: Converts raw URLs and markdown bracket links to secure
_blanktarget anchors.
- Fenced Code Blocks: Translates