Skip to content

JittoJoseph/DevMetric

Repository files navigation

DevMetric - GitHub Profile Scorer

Analyze GitHub profiles and get comprehensive developer metrics based on repositories, contributions, code quality, and impact.

Features

  • 🚀 Fast Analysis - Complete profile scoring in under 10 seconds
  • 📊 Comprehensive Scoring - Based on repositories, activity, contributions, impact, consistency, and code quality
  • 🔒 Private Repository Support - Include private repos for enhanced accuracy (optional)
  • 🎨 Beautiful UI - Dark theme with smooth animations
  • 📱 Responsive - Works on desktop and mobile
  • Serverless - Deployed on Vercel with database support
  • 🔐 Secure Authentication - OAuth-based consent for private data access

Tech Stack

  • Framework: Next.js 15 (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS
  • Animations: Framer Motion
  • Charts: Recharts
  • Authentication: NextAuth.js v5
  • Database: Vercel Postgres (Drizzle ORM)
  • API: GitHub REST API (Octokit)

Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • GitHub OAuth App (for private repo access)
  • Vercel Postgres database (for data storage)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/devmetric.git
cd devmetric
  1. Install dependencies:
npm install
  1. Set up environment variables:
cp .env.example .env.local
# Edit .env.local with your configuration
  1. Run the development server:
npm run dev
  1. Open http://localhost:3000

Environment Configuration

Required Variables

# NextAuth.js Configuration
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_nextauth_secret_here

# GitHub OAuth App Credentials
GITHUB_CLIENT_ID=your_github_client_id_here
GITHUB_CLIENT_SECRET=your_github_client_secret_here

# Vercel Postgres Database URL
DATABASE_URL=your_database_url_here

Optional Variables

# GitHub Personal Access Token for higher rate limits
GITHUB_TOKEN=your_github_token_here

Setting Up GitHub OAuth

  1. Go to GitHub Developer Settings
  2. Click "New OAuth App"
  3. Fill in the details:
    • Application name: DevMetric
    • Homepage URL: http://localhost:3000 (or your production URL)
    • Authorization callback URL: http://localhost:3000/api/auth/callback/github
  4. Copy the Client ID and Client Secret to your .env.local

Setting Up Database

  1. Go to Vercel Dashboard
  2. Create a new Postgres database
  3. Copy the DATABASE_URL to your .env.local
  4. Run database migrations (if needed):
npx drizzle-kit push

Rate Limiting

Without GitHub Token

  • 60 requests/hour (IP-based)
  • Suitable for basic usage
  • May hit limits with heavy usage

With GitHub Token (Recommended)

Private Repository Analysis

DevMetric now supports including private repositories in analysis for enhanced accuracy:

How It Works

  1. Consent Flow: Users click "Include Private Repos" to open a consent modal
  2. OAuth Authentication: GitHub OAuth flow grants access to private repositories
  3. Data Collection: Minimal private repo data is collected and stored securely
  4. Enhanced Analysis: Private repos are included in scoring calculations
  5. Privacy Controls: Users can revoke consent anytime

Data Privacy

  • Only repository metadata is stored (name, description, language, stars, etc.)
  • No source code or sensitive files are accessed
  • Data is encrypted and stored securely in Vercel Postgres
  • Users maintain full control with consent revocation
  • Data is automatically deleted when consent is revoked

Deployment

Vercel (Recommended)

  1. Push code to GitHub
  2. Import project in Vercel
  3. Add all environment variables
  4. Deploy!

Manual Deployment

npm run build
npm start

Project Structure

src/
├── app/
│   ├── api/
│   │   ├── analyze/stream/           # SSE analysis endpoint
│   │   ├── auth/[...nextauth]/       # NextAuth configuration
│   │   └── private-repos/            # Private repo management
│   │       ├── check-consent/        # Check consent status
│   │       ├── collect/              # Collect private data
│   │       └── revoke/               # Revoke consent
│   ├── analyze/[username]/           # Results page
│   ├── layout.tsx                   # Root layout
│   └── page.tsx                     # Landing page
├── components/
│   ├── PrivateRepoConsentModal.tsx  # Consent modal
│   └── ...                         # Other UI components
├── lib/
│   ├── auth.ts                     # NextAuth configuration
│   ├── db/                         # Database setup
│   │   ├── schema.ts               # Drizzle schema
│   │   └── index.ts                # Database connection
│   ├── github.ts                   # GitHub API client
│   ├── scoring.ts                  # Scoring algorithm
│   └── quality.ts                  # Code quality checks
└── types/                          # TypeScript definitions

Scoring Algorithm

The score (0-100) is calculated from:

  • Repositories (20%) - Count and language diversity (including private repos)
  • Activity (25%) - Commit frequency and streak
  • Contributions (25%) - PRs, issues, merge ratio
  • Impact (15%) - Stars, forks, followers
  • Consistency (10%) - Account age and activity
  • Code Quality (5%) - Repository quality metrics

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

MIT License - see LICENSE file for details

About

Analyze GitHub profiles and get comprehensive developer metrics based on repositories, contributions, code quality, and impact.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages