Instant, automated architectural audits, security vulnerability scans, technical debt indexing, and PR reviews.
Key Features • Architecture • Getting Started • Environment Setup • Deployment • Tech Stack
RepoLens is a modern, production-grade code intelligence SaaS platform built for engineering teams. It continuously scans GitHub repositories with high-throughput LPU-accelerated AI models to identify architectural flaws, detect security vulnerabilities, calculate technical debt indexes, and post automated AI code reviews on GitHub Pull Requests.
- 5-Stage Comprehensive AI Diagnostics:
- Architecture Audit: Analyzes folder hierarchy, separation of concerns, coupling metrics, and design pattern violations.
- Security Vulnerability Scanner: Identifies hardcoded secrets, injection vectors, XSS risks, and authentication bypasses with zero source code retention.
- Scalability & Performance Review: Pinpoints blocking synchronous calls, missing database indexes, N+1 query patterns, and memory leaks.
- File-Level Code Smells: Line-by-line inspection with automated refactor snippets and severity classifications.
- Technical Debt Index: Computes refactor priority matrices and team velocity debt burdens.
- Ultra-Fast LPU Inference: Powered by Groq inference (
qwen/qwen3.8-27bandopenai/gpt-oss-120b) delivering comprehensive repository scans in seconds. - Automated GitHub PR Bot: Instant webhook-driven diff analysis that posts structured, actionable code review comments directly on pull requests.
- Interactive Analytics Dashboard: Health trajectories, radial score gauges, issue breakdowns, and historical trends powered by Recharts.
- Multi-Format Export & Sharing: Generate instant markdown audit reports and secure public shareable inspection links.
- Enterprise-Grade Security: AES-256-GCM token encryption, Clerk authentication, HMAC-verified GitHub webhooks, and zero-storage ephemeral memory analysis.
graph TD
User[Developer / Browser] -->|Auth via Clerk| App[Next.js 14 App Router]
App -->|Encrypted OAuth / REST| GH[GitHub API]
Webhook[GitHub Webhook] -->|PR Events / HMAC SHA-256| App
App -->|Inference Pipeline| AI[Groq LPU Engine / Qwen 27B]
App -->|Drizzle ORM| DB[(Neon Serverless PostgreSQL)]
subgraph Diagnostics Engine
AI --> S1[Stage 1: Repo Tree & Architecture]
AI --> S2[Stage 2: File-Level Code Analysis]
AI --> S3[Stage 3: Security Vulnerabilities]
AI --> S4[Stage 4: Scalability & Performance]
AI --> S5[Stage 5: Technical Debt Index]
end
S1 & S2 & S3 & S4 & S5 --> Agg[Weighted Scoring Engine]
Agg --> DB
Powered by Drizzle ORM and Neon PostgreSQL:
| Table | Purpose |
|---|---|
users |
User profiles, Clerk identity mapping, subscription tier (free / pro), and encrypted GitHub tokens |
repositories |
Connected repositories, metadata, default branches, and last scanned timestamps |
scans |
Diagnostic scan runs, stage progress, individual scores (0–100), summaries, and overall health |
file_reviews |
Per-file findings, line annotations, severity (low, medium, high, critical), and remediation code |
pull_request_reviews |
PR review diff records, risk assessments, breaking change probabilities, and comments |
usage_logs |
Audit trail of scans and token usage per user |
- Node.js: v18.18+ or v20+
- npm / pnpm / yarn
- Git
git clone https://github.com/ShakilUrRehman21/RepoLens.git
cd RepoLens
npm installCreate a local environment file by copying .env.example:
cp .env.example .env.localFill in the required values (see Environment Variables below).
Generate and push database migrations to Neon:
npx drizzle-kit pushnpm run devOpen http://localhost:3000 in your browser.
| Variable | Description | Source |
|---|---|---|
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY |
Clerk Frontend API key | Clerk Dashboard |
CLERK_SECRET_KEY |
Clerk Backend Secret key | Clerk Dashboard |
NEXT_PUBLIC_CLERK_SIGN_IN_URL |
Route for sign-in (/sign-in) |
Default |
NEXT_PUBLIC_CLERK_SIGN_UP_URL |
Route for sign-up (/sign-up) |
Default |
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL |
Redirect after auth (/dashboard) |
Default |
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL |
Redirect after auth (/dashboard) |
Default |
GITHUB_CLIENT_ID |
GitHub OAuth App Client ID | GitHub Developer Settings |
GITHUB_CLIENT_SECRET |
GitHub OAuth App Client Secret | GitHub Developer Settings |
GITHUB_WEBHOOK_SECRET |
HMAC Secret for GitHub Webhooks | Any random string |
GROQ_API_KEY |
Groq API Key for fast LPU inference | Groq Console |
GROQ_MODEL |
Default model (qwen/qwen3.8-27b) |
Groq supported model |
GEMINI_API_KEY |
Google Gemini API Key (optional fallback) | Google AI Studio |
DATABASE_URL |
Connection string with SSL enabled | Neon Console |
ENCRYPTION_KEY |
32-byte hex string for AES-256 token encryption | node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" |
NEXT_PUBLIC_APP_URL |
Full URL of the application (http://localhost:3000 or production domain) |
Vercel domain |
ADMIN_USER_IDS |
Comma-separated list of Clerk User IDs with admin panel access | Clerk User ID (user_...) |
-
Push your code to GitHub:
git add . git commit -m "chore: prepare for production release" git push origin master
-
Import to Vercel:
- Go to Vercel.
- Select your
RepoLensrepository. - Framework Preset will automatically detect Next.js.
-
Set Environment Variables:
- Copy each variable from your
.env.localinto Vercel Project Settings > Environment Variables. - Make sure to set
NEXT_PUBLIC_APP_URLto your production domain (e.g.,https://repolens.vercel.app).
- Copy each variable from your
-
Update Clerk Configuration:
- In the Clerk Dashboard, navigate to Paths and Domains.
- Add your Vercel production domain to allowed redirect URLs and origin domains.
-
Configure GitHub OAuth & Webhooks (Optional for PR Bot):
- In GitHub OAuth App settings, update the callback URL to:
https://<your-domain>/api/auth/callback/github(or Clerk OAuth redirect URL). - In repository settings, add a Webhook pointing to:
https://<your-domain>/api/webhooks/githubwith Content typeapplication/jsonand Secret matchingGITHUB_WEBHOOK_SECRET.
- In GitHub OAuth App settings, update the callback URL to:
- Framework: Next.js 14 (App Router, Server Components, Route Handlers)
- Language: TypeScript
- Styling: Vanilla Tailwind CSS, Lucide Icons, Radix UI Primitives
- State & Data Visualization: Recharts
- Database & ORM: PostgreSQL via Neon Serverless, Drizzle ORM
- Authentication: Clerk
- AI Acceleration: Groq SDK (
qwen/qwen3.8-27b,openai/gpt-oss-120b,openai/gpt-oss-20b) - Git Integrations: Octokit REST API, Webhooks
- Security: AES-256-GCM token encryption, zero source-code retention
This project is licensed under the MIT License.