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
- π― The Mission
- β¨ Key Features
- π¬ How It Works
- ποΈ System Architecture
- π οΈ Tech Stack
- π Quick Start
- π API Reference
- ποΈ Project Structure
- π€ Contributing
- π License
|
|
Beautiful, high-fidelity visualizations of your GitHub contributions over the last 30 days using the GraphQL API. |
Weekly insights generated by Llama 3.1 (via Groq) that analyze your commits to provide actionable feedback. |
A powerful terminal companion ( |
|
Keep the fire alive with precise tracking of your current and all-time longest commit streaks. |
A dedicated, minimalist profile page at |
Seamless GitHub OAuth 2.0 integration with JWT-based session management for the web and CLI. |
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
Clutch uses a modern, decoupled architecture designed for speed and reliability.
| Technology | Purpose |
|---|---|
| UI Framework with modern hooks | |
| Lightning-fast build tool | |
| Utility-first styling | |
| Data visualization |
| Technology | Purpose |
|---|---|
| Runtime environment | |
| High-performance API framework | |
| SQL Toolkit and ORM | |
| Local data persistence |
| Technology | Purpose |
|---|---|
| Data source (GraphQL & REST) | |
| AI insight generation | |
| Secure session management |
- Python 3.11 or higher
- Node.js 20 or higher
- A GitHub OAuth app
- A Groq API key
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.
cd backendpython -m venv venvsource venv/bin/activate # Windows: venv\Scripts\activatepip install -r requirements.txtcp .env.example .envConfigure .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 --reloadThe backend will run at http://localhost:8000. Documentation is available at http://localhost:8000/docs.
cd frontendnpm installcp .env.example .envConfigure .env:
VITE_API_URL=http://localhost:8000
Start the Frontend:
npm run devThe frontend will run at http://localhost:5173.
pip install myclutchOr install locally from source:
cd cli
pip install -e .Login (fully automatic β no token copy-pasting):
clutch loginYour 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 loginAvailable 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 |
| 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 |
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
We love contributions! Please see CONTRIBUTING.md for setup instructions.
This project is licensed under the MIT License.
