Skip to content

Latest commit

Β 

History

151 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

βš™οΈ Clutch

AI-Powered Developer Activity & Productivity Dashboard

GitHub Live Demo


React FastAPI Python TypeScript TailwindCSS Groq


Clutch β€” the ultimate developer companion β€” is an open-source dashboard that connects directly to your GitHub to visualize your coding journey. It tracks commit streaks, identifies activity patterns, and provides AI-powered weekly insights to help you understand your productivity better than ever before.


🌐 Live Demo Β· πŸ“– API Docs Β· πŸ’» CLI Tool Β· πŸ› Report Bug Β· ✨ Request Feature


πŸ“‹ Table of Contents


🎯 The Mission

GitHub tracks your work. Clutch tracks you.

  • Visualize your contribution streaks and longest active periods.
  • Understand your coding patterns with AI-powered weekly summaries.
  • Identify your most productive days and top-performing repositories.
  • Access your stats instantly via the terminal with a dedicated CLI.
  • Showcase your developer identity with a professional public profile.

"Clutch isn't just a dashboard; it's a mirror for your developer journey, helping you stay consistent and focused."


✨ Key Features

πŸ“Š Activity Charts

Beautiful, high-fidelity visualizations of your GitHub contributions over the last 30 days using the GraphQL API.

🧠 AI Summaries

Weekly insights generated by Llama 3.1 (via Groq) that analyze your commits to provide actionable feedback.

⚑ CLI First

A powerful terminal companion (myclutch) for instant access to streaks, stats, and insights.

πŸ”₯ Streak Tracking

Keep the fire alive with precise tracking of your current and all-time longest commit streaks.

🌍 Public Profiles

A dedicated, minimalist profile page at /u/username to share your achievements with the world.

πŸ” Secure Auth

Seamless GitHub OAuth 2.0 integration with JWT-based session management for the web and CLI.


πŸ”¬ How It Works

flowchart LR
    A["User Login"] --> B["GitHub OAuth"]
    B --> C["Data Sync"]
    C --> D["Analytics Engine"]
    D --> E["Visual Dashboard"]
    
    C --> C1["GraphQL API"]
    C --> C2["REST API"]
    
    D --> D1["Streak Calculator"]
    D --> D2["Language Parser"]
    D --> D3["AI Insights (Groq)"]
    
    E --> E1["Web UI"]
    E --> E2["CLI Tool"]
    
    style A fill:#000,color:#fff
    style B fill:#000,color:#fff
    style C fill:#000,color:#fff
    style C1 fill:#000,color:#fff
    style C2 fill:#000,color:#fff
    style D fill:#000,color:#fff
    style D1 fill:#000,color:#fff
    style D2 fill:#000,color:#fff
    style D3 fill:#000,color:#fff
    style E fill:#000,color:#fff
    style D3 fill:#000,color:#fff
    style E1 fill:#000,color:#fff
    style E2 fill:#000,color:#fff
Loading

πŸ—οΈ System Architecture

Clutch uses a modern, decoupled architecture designed for speed and reliability.

Architecture Diagram


πŸ› οΈ Tech Stack

Frontend

Technology Purpose
React UI Framework with modern hooks
Vite Lightning-fast build tool
Tailwind Utility-first styling
Recharts Data visualization

Backend

Technology Purpose
Python Runtime environment
FastAPI High-performance API framework
SQLAlchemy SQL Toolkit and ORM
SQLite Local data persistence

External Services

Technology Purpose
GitHub Data source (GraphQL & REST)
Groq AI insight generation
JWT Secure session management

πŸš€ Quick Start

Prerequisites

  • Python 3.11 or higher
  • Node.js 20 or higher
  • A GitHub OAuth app
  • A Groq API key

1️⃣ Create a GitHub OAuth App

Navigate to GitHub Developer Settings and create a new OAuth app:

  • Homepage URL: http://localhost:5173
  • Authorization callback: http://localhost:8000/auth/github/callback

Copy the Client ID and Client Secret.

2️⃣ Backend Setup

cd backend
python -m venv venv
source venv/bin/activate        # Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env

Configure .env:

DATABASE_URL = sqlite:///./clutch.db

SECRET_KEY = your-secret-key

ALGORITHM = HS256

ACCESS_TOKEN_EXPIRE_MINUTES = 10080

GITHUB_CLIENT_ID = your_client_id

GITHUB_CLIENT_SECRET = your_client_secret

GITHUB_REDIRECT_URI = http://localhost:8000/auth/github/callback

GROQ_API_KEY = your_groq_key

FRONTEND_URL = http://localhost:5173

ENVIRONMENT = development

Start the Backend:

uvicorn app.main:app --reload

The backend will run at http://localhost:8000. Documentation is available at http://localhost:8000/docs.

3️⃣ Frontend Setup

cd frontend
npm install
cp .env.example .env

Configure .env:

VITE_API_URL=http://localhost:8000

Start the Frontend:

npm run dev

The frontend will run at http://localhost:5173.

4️⃣ CLI Setup

pip install myclutch

Or install locally from source:

cd cli
pip install -e .

Login (fully automatic β€” no token copy-pasting):

clutch login

Your browser opens, you authorize on GitHub, and the terminal automatically captures the token. Done.

To point the CLI at a local backend instead of the hosted API:

export CLUTCH_API_URL=http://localhost:8000
clutch login

Available Commands:

Command Description
clutch login Login via GitHub OAuth (automatic)
clutch logout Logout and clear credentials
clutch whoami Show logged-in user
clutch streak Current and longest commit streak
clutch stats [--days N] Activity stats for last N days
clutch heatmap [--weeks N] Contribution heatmap for last N weeks
clutch repos Most recently active repositories
clutch insight AI-generated weekly insight
clutch patterns Coding patterns and habits
clutch status Login status and API health
clutch --version Show CLI version

πŸ“Š API Reference

Method Endpoint Description
GET /auth/github Start GitHub OAuth flow
GET /auth/github/callback Handle OAuth callback
GET /users/me Get authenticated user profile
GET /users/{username} Get public user profile
GET /github/activity Fetch activity for last N days
GET /github/streak Calculate current and longest streaks
GET /github/languages Retrieve language breakdown
POST /github/sync Sync activity data to database
GET /insights/weekly Generate AI weekly insights
GET /insights/patterns Detect coding patterns

πŸ—‚οΈ Project Structure

clutch/
β”‚
β”œβ”€β”€ backend/                        # FastAPI backend service
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ main.py                 # App entry point, registers all routers
β”‚   β”‚   β”œβ”€β”€ settings.py             # Environment variables and configuration
β”‚   β”‚   β”œβ”€β”€ database.py             # SQLAlchemy database connection and session
β”‚   β”‚   β”œβ”€β”€ dependencies.py         # JWT authentication middleware
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ models/                 # Database Schemas
β”‚   β”‚   β”‚   β”œβ”€β”€ user.py             # User model β€” stores GitHub profile and tokens
β”‚   β”‚   β”‚   β”œβ”€β”€ activity.py         # DailyActivity model β€” stores synced GitHub stats
β”‚   β”‚   β”‚   └── insight.py          # WeeklyInsight model β€” stores AI generated insights
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ routers/                # API Endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.py             # GitHub OAuth flow and JWT creation
β”‚   β”‚   β”‚   β”œβ”€β”€ github.py           # Activity, streak, language and sync endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ users.py            # User profile endpoints
β”‚   β”‚   β”‚   └── insights.py         # AI insight and pattern detection endpoints
β”‚   β”‚   β”‚
β”‚   β”‚   └── services/               # Core Logic
β”‚   β”‚       β”œβ”€β”€ github_service.py   # GitHub GraphQL API calls and data processing
β”‚   β”‚       └── insights_service.py # AI integration and pattern detection
β”‚   β”‚
β”‚   β”œβ”€β”€ requirements.txt
β”‚   └── .env.example
β”‚
β”œβ”€β”€ frontend/                       # React + TypeScript frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main.tsx                # React entry point
β”‚   β”‚   β”œβ”€β”€ App.tsx                 # Router setup and protected routes
β”‚   β”‚   β”œβ”€β”€ index.css               # Global styles and design tokens
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ context/
β”‚   β”‚   β”‚   └── AuthContext.tsx     # Auth state management and JWT handling
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”‚   └── api.ts              # Axios instance with auth interceptors
β”‚   β”‚   β”‚
β”‚   β”‚   └── pages/                  # Application Views
β”‚   β”‚       β”œβ”€β”€ Landing.tsx         # Landing page with sign in
β”‚   β”‚       β”œβ”€β”€ Dashboard.tsx       # Main dashboard with stats and charts
β”‚   β”‚       β”œβ”€β”€ Profile.tsx         # Public user profile page
β”‚   β”‚       └── AuthCallback.tsx    # Handles GitHub OAuth redirect and token storage
β”‚   β”‚
β”‚   β”œβ”€β”€ public/
β”‚   β”‚   └── _redirects              # SPA routing config
β”‚   β”œβ”€β”€ package.json
β”‚   └── .env.example
β”‚
└── cli/                              # Command Line Tool (published as myclutch)
    β”œβ”€β”€ clutch_cli/
    β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”œβ”€β”€ main.py                   # CLI entry point using Typer
    β”‚   β”œβ”€β”€ api.py
    β”‚   β”œβ”€β”€ config.py                 # Config and token storage
    β”‚   β”œβ”€β”€ theme.py
    β”‚   β”‚
    β”‚   β”œβ”€β”€ activity/                 # Activity related commands
    β”‚   β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”‚   β”œβ”€β”€ patterns.py
    β”‚   β”‚   β”œβ”€β”€ stats.py
    β”‚   β”‚   └── streak.py
    β”‚   β”‚
    β”‚   β”œβ”€β”€ authentication/           # Authentication commands
    β”‚   β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”‚   β”œβ”€β”€ login.py
    β”‚   β”‚   β”œβ”€β”€ logout.py
    β”‚   β”‚   └── whoami.py
    β”‚   β”‚
    β”‚   β”œβ”€β”€ insights/                 # AI Insights
    β”‚   β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”‚   └── weekly.py
    β”‚   β”‚
    β”‚   β”œβ”€β”€ repositories/             # Repository commands
    β”‚   β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”‚   └── list.py
    β”‚   β”‚
    β”‚   └── system/                   # System commands
    β”‚       β”œβ”€β”€ __init__.py
    β”‚       └── status.py
    β”œβ”€β”€ README.md                   # PyPI package description
    └── pyproject.toml              # Modern build config

🀝 Contributing

We love contributions! Please see CONTRIBUTING.md for setup instructions.


πŸ“œ License

This project is licensed under the MIT License.

About

Helping out developers out there : )

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Contributors

Languages