Analyze GitHub repositories with beautiful visualizations. View language breakdowns, commit history, code frequency, contributors, and generate embeddable stats widgets for your README.
- Repository Statistics: Total lines of code, additions, deletions, stars, forks, and more
- Language Breakdown: Visual breakdown of all programming languages used with percentages
- Commit History: Detailed commit log with author info, changes, and timestamps
- Code Frequency Chart: Interactive visualization of code changes over time
- Contributors List: Top contributors with their contribution stats
- Embeddable Widgets: Generate SVG images for your README to showcase repo stats
- GitHub OAuth: Sign in to access private repositories and higher API limits
- Privacy First: No credentials stored - all auth happens directly with GitHub
RepoLens generates beautiful SVG widgets you can embed directly in your GitHub README. Available widgets:
Shows total lines, lines added, lines removed, and commit count.
Shows stars, forks, watchers, and open issues.
Displays the top programming languages used in the repository.
All widgets support a theme parameter:
?theme=dark(default) - Dark background?theme=light- Light background
Widgets are cached for 1 hour on CDN to ensure fast loading and reduce API usage.
Your data is never stored. This application:
- Uses GitHub OAuth for secure authentication
- Never saves login credentials or access tokens to any database
- Tokens exist only in your browser session
- All API calls go directly to GitHub
- Sign out anytime to revoke access
- Node.js 18.17 or later
- A GitHub account
- A GitHub OAuth App (instructions below)
- Go to GitHub Developer Settings
- Click "OAuth Apps" then "New OAuth App"
- Fill in the details:
- Application name: RepoLens (or your preferred name)
- Homepage URL:
http://localhost:3000(for development) - Authorization callback URL:
http://localhost:3000/api/auth/callback/github
- Click "Register application"
- Copy the Client ID
- Click "Generate a new client secret" and copy the Client Secret
git clone https://github.com/Technical-1/RepoLens.git
cd repolens
npm installCreate a .env.local file in the root directory:
AUTH_GITHUB_ID=your_github_client_id
AUTH_GITHUB_SECRET=your_github_client_secret
AUTH_SECRET=your_random_secret_hereGenerate AUTH_SECRET with:
openssl rand -base64 32npm run devOpen http://localhost:3000 in your browser.
You can deploy RepoLens to any hosting service that supports Next.js, including Vercel, Netlify, Railway, Render, or your own server.
Example: Deploying to Vercel
- Push your code to GitHub
- Import the project in Vercel Dashboard
- Add environment variables:
AUTH_GITHUB_IDAUTH_GITHUB_SECRETAUTH_SECRET
- Update your GitHub OAuth App callback URL to:
https://your-domain.com/api/auth/callback/github
| Category | Technology |
|---|---|
| Framework | Next.js 15 with App Router |
| UI Library | React 19 |
| Authentication | Auth.js v5 (NextAuth) |
| GitHub API | @octokit/rest |
| Styling | Tailwind CSS 3.4 |
| Charts | Recharts |
| Icons | Lucide React |
| Language | TypeScript 5.7 |
| Image Generation | next/og (Satori) |
| Authentication | Rate Limit | Caching |
|---|---|---|
| Unauthenticated | 60 requests/hour | 10-minute server cache |
| Authenticated (OAuth) | 5,000 requests/hour | No server cache |
| Embed Widgets | Uses unauthenticated | 1-hour CDN cache |
Sign in with GitHub to get higher rate limits for analyzing large repositories.
Caching Strategy:
- Unauthenticated requests are cached server-side for 10 minutes to reduce API pressure
- Embed widgets are cached at the CDN edge for 1 hour
- User repository lists are cached client-side for 5 minutes
- Code frequency polling uses exponential backoff (3s, 6s, 12s, 24s, 48s) to avoid rate limits
repolens/
├── src/
│ ├── app/
│ │ ├── api/
│ │ │ ├── auth/[...nextauth]/route.ts # Auth handlers
│ │ │ ├── embed/
│ │ │ │ ├── stats/route.tsx # Stats widget image
│ │ │ │ ├── languages/route.tsx # Languages widget image
│ │ │ │ └── code-stats/route.tsx # Code stats widget image
│ │ │ ├── repo/
│ │ │ │ ├── route.ts # Main repo analysis
│ │ │ │ └── stats/route.ts # Stats polling endpoint
│ │ │ └── user/repos/route.ts # User repos endpoint
│ │ ├── globals.css
│ │ ├── layout.tsx
│ │ └── page.tsx
│ ├── components/
│ │ ├── Header.tsx
│ │ ├── RepoInput.tsx
│ │ ├── StatsOverview.tsx
│ │ ├── LanguageBreakdown.tsx
│ │ ├── CommitHistory.tsx
│ │ ├── CodeFrequencyChart.tsx
│ │ ├── ContributorsList.tsx
│ │ ├── UserReposList.tsx
│ │ ├── EmbedShare.tsx
│ │ ├── ParticleBackground.tsx
│ │ └── PrivacyNotice.tsx
│ ├── lib/
│ │ └── github.ts
│ ├── types/
│ │ └── index.ts
│ └── auth.ts
├── tailwind.config.ts
├── next.config.ts
├── package.json
└── vercel.json
- 10,000 commit limit: GitHub's statistics API doesn't work for repos with 10,000+ commits
- Rate limiting: Heavy use may hit GitHub API limits (sign in for higher limits)
- Stats computation: Some statistics may take time to compute for new/updated repos
- Embed widgets: Only works for public repositories
Contributions are welcome! Please feel free to submit a Pull Request.
This project is available for personal use only. Commercial use is not permitted without explicit permission.
Built with Next.js 15 and the GitHub API