GitHub Profile Analyzer

Comprehensive GitHub profile analysis tool with AI-powered scoring, real-time metrics, and exportable reports.

Next.js TypeScript Bun PostgreSQL License
Stars Repo Size Forks Website

GitHub: 0xarchit/github-profile-analyzer
Live Demo: https://github.0xarchit.is-a.dev

Features

Profile Analysis

  • AI-Driven Evaluation: Detailed scoring and developer type classification
  • Language Detection: Proficiency analysis across your repositories
  • Repository Analysis: Contribution metrics and project insights

Authentication & Security

  • GitHub OAuth 2.0: Secure authentication flow
  • JWT Sessions: Token-based session management with jose
  • AES-256-GCM Encryption: Protects sensitive data at rest
  • Rate Limiting: Upstash Rate Limit for abuse prevention
  • Security: SQL injection and XSS protection

Data & Export

  • Contribution Calendar: Real-time parsing and streak calculation
  • PDF Reports: Generate exportable reports with profile snapshots
  • Encrypted Storage: Secure analysis history and snapshots

Performance

  • Redis Caching: Upstash Redis for response caching
  • Optimized Queries: Efficient Neon PostgreSQL operations
  • Concurrent Handling: Built for high-throughput with Bun runtime

User Experience

  • Star Verification: Access control through repository stars
  • Guest Sessions: Limited access without authentication
  • User Settings: Personalized preferences
  • Responsive UI: Tailwind CSS with dark mode support

System Architecture

graph TD
    A[User Browser] -->|OAuth Login| B[Next.js App]
    B -->|Authenticate| C[GitHub OAuth]
    C -->|Callback| B
    
    B -->|Analyze Profile| D[API Routes]
    D -->|Fetch Data| E[GitHub API]
    D -->|Cache| F[Upstash Redis]
    D -->|Store| G[Neon PostgreSQL]
    
    D -->|AI Analysis| H[AI Model]
    D -->|Generate| I[PDF Report]
    
    B -->|Display| J[Dashboard]
    J -->|Settings| K[User Preferences]
    J -->|History| L[Analysis Snapshots]

Tech Stack

Category Technologies
Framework Next.js 16 with React 19
Language TypeScript
Runtime Bun
Database Neon PostgreSQL
Authentication JWT with jose, GitHub OAuth 2.0
Caching Upstash Redis
Rate Limiting Upstash Rate Limit
PDF Generation react-pdf
Styling Tailwind CSS
Validation Zod schemas

Getting Started

Prerequisites

  • Bun runtime
  • GitHub OAuth application credentials
  • Neon PostgreSQL database
  • Upstash Redis instance

Installation

git clone https://github.com/0xarchit/github-profile-analyzer.git
cd github-profile-analyzer
bun install

Environment Variables

Create a .env.local file:

GITHUB_TOKENS=
NEXT_PUBLIC_APP_URL=
GITHUB_PAT_TOKENS=
GITHUB_MODEL=
DATABASE_WRITE=
DATABASE_READ=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
JWT_SECRET=
UPSTASH_TOKEN=
UPSTASH_URL=
ENCRYPTION_SECRET=

Development

bun run dev

Server runs on http://localhost:3000

Production Build

bun run build
bun run start

API Routes

Method Endpoint Description
POST /api/analyze Analyze GitHub profile
GET /api/contributions Fetch contribution data
GET /api/star-status Verify star status
GET /api/scans/[id] Retrieve scan results
POST /api/auth/github Initiate GitHub OAuth
GET /api/auth/github/callback OAuth callback handler
GET /api/auth/me Get current user
POST /api/auth/logout Logout user
GET /api/users/settings Fetch user settings
POST /api/users/settings Update user settings

Project Structure

src/
├── app/                 # Next.js app router
│   ├── api/            # API route handlers
│   ├── auth/           # Authentication pages
│   └── dashboard/      # User dashboard
├── components/          # React components
│   ├── ui/             # Reusable UI elements
│   └── features/       # Feature-specific components
├── lib/                 # Utilities and helpers
│   ├── auth.ts         # Authentication utilities
│   ├── db.ts           # Database connection
│   └── cache.ts        # Redis caching
└── types/               # TypeScript type definitions

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Security

The project implements:

  • AES-256-GCM encryption for sensitive data
  • Rate limiting and abuse prevention
  • SQL injection and XSS protection
  • JWT-based session management