Skip to content
nvsaigokul-sudoPublic

About

RepoLens is an AI-powered repository intelligence platform that scans technology stack signatures, calculates codebase health scores, maps system architectures, and writes Gemini-enriched career summaries.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

RepoLens v2: Enterprise AI-Powered Repository Auditing & Code Intelligence Platform

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


πŸ“– Table of Contents

  1. System Architecture
  2. Key Features & Capabilities
  3. Performance & Optimization Engine
  4. Technology Stack
  5. Unified Docker & Deployment Pipeline
  6. Desktop Launcher (RepoLens.exe)
  7. Local Development Setup
  8. Detailed Technical Architecture

πŸ— System 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]
Loading

1. Unified Single-Service Serving

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.

2. SPA Route Redirection

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.

3. Origin-Relative API Routing

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.


🌟 Key Features & Capabilities

1. AI Repository Report Card

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)

2. Repository DNA Visualization

Presents strength metrics represented as sleek, CSS-visualized horizontal bar charts for quick identification of backend, frontend, devops, database, performance, and AI-native capabilities.

3. AI Risk Radar & Threat Audit

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.

4. Interactive Architecture Map & Review Feed

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.

5. Repository Evolution Journey Timeline

An interactive milestone tracker charting year-over-year repository evolution, structural upgrades, and main release points.

6. Recruiter Perspective Panel

Features backend skill checks, interview readiness indicators, star ratings across backend/documentation/readiness, and explicit recruiter recommendation tags to assess repository quality.

7. Side-by-Side Comparison Mode

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).

8. Smart AI Chat Suggestions

Context-aware suggestion pills positioned directly above the typing input box to quickly request architecture breakdowns, code reviews, and dependency checks.


⚑ Performance & Optimization Engine

RepoLens incorporates advanced client-side caching and fetch cancellation architectures to feel instant:

1. Stale-While-Revalidate (SWR) Caching

  • 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.

2. HTTP ETag Conditional Requests

GitHub API profile lookups check locally stored ETags (If-None-Match). Unmodified assets return 304 Not Modified, preserving rate limit quotas.

3. Query Abort Controllers

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.


πŸ›  Technology Stack

Frontend

  • React 18 & TypeScript
  • Vite (Build toolchain)
  • Framer Motion (Spring layout transitions)
  • Lucide React (Branding iconography)

Backend

  • Spring Boot 3.x & Java 21
  • Maven (Dependency manager)
  • Google Gemini Client (Integrated with the gemini-3.5-flash model)

Desktop Launcher

  • C# (.NET Framework) (Compiles native executable wrapper)
  • PowerShell (Automated zip extraction and packaging scripts)

🐳 Unified Docker & Deployment Pipeline

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"]

πŸ’» Desktop Application Download & Installation

RepoLens includes a native C# launcher and self-contained installer (RepoLens.exe) that deploys a local environment.

πŸ“₯ Download Link

  • 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

πŸ“‹ Release Specifications

  • 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)

πŸš€ Installation Instructions

  1. Prerequisites: Ensure Docker Desktop is installed and running on your system.
  2. Download: Click the download link above to fetch the RepoLens.exe installer.
  3. Execution: Double-click RepoLens.exe to 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.
  4. 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.

πŸ—‘ Uninstallation

To cleanly remove RepoLens from your machine, simply:

  1. Open Windows Apps & Features / Settings.
  2. Search for RepoLens and click Uninstall.
  3. The uninstaller will automatically run docker compose down -v to purge container databases, delete shortcuts, remove registry keys, and wipe %LocalAppData%\RepoLens\.

πŸš€ Local Development Setup

Prerequisites

  • Java JDK 21
  • Node.js 20+
  • Maven 3.8+

Step 1: Run the Backend

  1. Navigate to the backend directory:
    cd titansearch-backend
  2. Export your developer API keys in your terminal environment:
    export GITHUB_TOKEN="your_github_token"
    export GEMINI_API_KEY="your_gemini_api_key"
  3. Run the Spring Boot application:
    mvn spring-boot:run

Step 2: Run the Frontend

  1. Navigate to the frontend directory:
    cd titansearch-frontend
  2. Install dependencies:
    npm install
  3. Run in developer hot-reload mode:
    npm run dev
  4. Access the frontend in your browser at http://localhost:5173.

Step 3: Package the Desktop Launcher

To compile changes into the self-contained launcher executable, execute the build script from a PowerShell terminal at the root:

.\build_launcher.ps1

This generates the packaged client wrapper at RepoLens.exe.


πŸ” Detailed Architecture & Technical Walkthrough

1. Asynchronous Workers & Thread-Local Propagation

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-Token and X-Gemini-Key).
  • The Solution: RepoLens implements a SecurityContext class using ThreadLocal variables. 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 own SecurityContext at startup.
  • Integration: RestClient interceptors and Gemini API clients pull authorization details from SecurityContext when RequestContextHolder returns 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()
Loading

2. ZIP Archive Downloader Proxy & CORS Bypass

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 RestClient fetches 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 with application/zip MIME type headers. This circumvents browser CORS checks entirely.

3. Custom Markdown Compiler for AI Chat

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 _blank target anchors.

About

RepoLens is an AI-powered repository intelligence platform that scans technology stack signatures, calculates codebase health scores, maps system architectures, and writes Gemini-enriched career summaries.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages