Skip to content

gcharpe1604/gitanalyzer

Repository files navigation

GitAnalyzer


Analyze commit quality. Understand developer behavior. Improve your Git workflow.
Turns commit analysis from a score into a feedback system.


πŸ”— Live Demo

gitanalyzer-ai.netlify.app


πŸ“ˆ Status

Actively developed. Open to feedback and improvements.


πŸš€ Overview

GitAnalyzer fetches commit data from any public GitHub user or repository and applies a rule-based scoring system to evaluate commit message quality. It surfaces common problems β€” vague language, missing structure, inconsistent style β€” and gives concrete suggestions to fix them.

Unlike generic linters, GitAnalyzer works at the repository level. It looks at patterns across all commits, not just a single message. It identifies a developer's commit style, flags systemic issues, and provides ranked suggestions. Signed-in users can also generate a commit message from a pasted git diff and sync analysis history across sessions.


Key Features

  • Commit scoring (0–10) β€” Uses a weighted, explainable rubric across format, clarity, style, context, and hygiene

  • Sub-score breakdown β€” Three sub-metrics displayed alongside the main score:

    • Clarity β€” measures specificity, useful subject length, and placeholder language
    • Structure β€” measures valid Conventional Commit headers, types, and scopes
    • Consistency β€” evaluates how uniform commit quality is across the repository using score variance
  • Confidence indicator β€” If a repository has fewer than 20 commits, the dashboard shows a low-confidence warning so you know the data is limited

  • Top Issues β€” Automatically identifies the most impactful problems:

    • High rate of vague commit openers
    • Missing Conventional Commits prefixes
    • High score variance across contributors
    • Bad commit percentage above a threshold
  • Suggested Improvements β€” Rule-based suggestions derived from each repository's specific weaknesses (not generic advice)

  • Developer Type classification β€” Categorizes commit behavior into one of four types: Night Owl Coder, Consistent Builder, Burst Committer, or Weekend Hacker β€” based on time-of-day and day-of-week patterns

  • Dashboard visualizations β€” Commit time distribution chart, commit type breakdown, score distribution bar, and history timeline

  • Shareable routes β€” The analyzer, developer repository index, repository reports, and commit workshop have stable browser URLs

  • Diff-grounded AI generation (logged-in users only) β€” Every signed-in account receives 15 platform-funded suggestions per month. After that, users can continue with personal Groq, OpenRouter, or Gemini keys stored in their browser

  • Persistent analysis history β€” Signed-in users have repository analyses saved to Supabase. Guest analyses are not added to history

  • Authentication β€” Sign in or create an account with GitHub or Google through Supabase Auth

  • Detailed PDF reports β€” Download one polished report containing the score summary, quality dimensions, priority findings, recommendations, type distribution, and commit appendix


How It Works

  1. Enter a target β€” Type a GitHub username (e.g. torvalds) or a repository path (e.g. facebook/react) into the search bar
  2. Data is fetched β€” The GitHub API returns up to 100 recent commits from the target
  3. Messages are analyzed β€” Each commit message is scored individually using the rule-based engine
  4. Insights are computed β€” Sub-scores, developer type, top issues, and suggestions are derived from aggregate patterns
  5. Dashboard renders β€” Results are displayed across score cards, charts, and feedback sections
  6. AI generation (logged-in only) β€” Users paste a git diff before requesting one of 15 monthly suggestions; personal provider keys take over after the allowance is used
  7. History is saved β€” Logged-in users have the analysis persisted to their Supabase profile for future reference

Scoring System

Each commit message is evaluated on a 100-point weighted rubric and presented as a 0–10 score:

Dimension Weight What it checks
Format 20 Valid Conventional Commit syntax, type, and optional scope
Clarity 30 Specificity, useful length, descriptive detail, and placeholder language
Style 20 Imperative mood, casing, punctuation, and readable phrasing
Context 15 Whether the subject identifies a meaningful action and whether complex changes include a body
Hygiene 15 Header length, whitespace, and subject/body separation

Git-generated merge and revert messages are recognized separately so normal repository maintenance is not treated as malformed work.

Score interpretation:

  • 8–10 β†’ Good
  • 6–7 β†’ Warning
  • 0–5 β†’ Bad

Examples:

❌  fix bug
    Score: 4.7/10 β€” missing prefix, too short, placeholder subject

βœ…  feat(auth): prevent duplicate token refresh
    Score: 9.5/10 β€” valid structure, imperative wording, specific subject

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Browser                    β”‚
β”‚                                             β”‚
β”‚  React + TypeScript (Vite)                  β”‚
β”‚  β”œβ”€β”€ InputSection   β†’ user/repo entry       β”‚
β”‚  β”œβ”€β”€ SummarySection β†’ scores + insights     β”‚
β”‚  β”œβ”€β”€ CommitList     β†’ per-commit breakdown  β”‚
β”‚  β”œβ”€β”€ Playground     β†’ scoring + diff generationβ”‚
β”‚  β”œβ”€β”€ ReportDownload β†’ detailed PDF report   β”‚
β”‚  └── HistorySidebar β†’ saved analyses        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
       β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚  GitHub REST   β”‚
       β”‚  API v3        β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Rule-Based Analyzer    β”‚
    β”‚  simpleAnalyzer.ts      β”‚
    β”‚  - per-commit scoring   β”‚
    β”‚  - sub-score aggregationβ”‚
    β”‚  - feedback generation  β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  AI Layer (optional)    β”‚
    β”‚  llmService.ts          β”‚
    β”‚  User-selected keys     β”‚
    β”‚  Groq / OpenRouter / Geminiβ”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Supabase               β”‚
    β”‚  - OAuth authentication β”‚
    β”‚  - Analysis persistence β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

src/
β”œβ”€β”€ components/       # Reusable UI components (React)
β”œβ”€β”€ contexts/         # React Context providers (Auth, Theme)
β”œβ”€β”€ services/         # External API integrations (GitHub, Supabase, LLMs)
β”œβ”€β”€ types/            # TypeScript type definitions
β”œβ”€β”€ utils/            # Helper functions and analysis logic
β”œβ”€β”€ App.tsx           # Main application component
└── main.tsx          # Application entry point

Tech Stack

Layer Technology
Framework React 19 + TypeScript
Routing React Router
Build Tool Vite
Styling Vanilla CSS with CSS custom properties
Data Source GitHub REST API v3
AI Providers Google Gemini, OpenRouter, Groq
PDF Reports jsPDF
Auth + Database Supabase
Deployment Netlify

Screenshots

Dashboard Commit Analysis AI Suggestion
Dashboard Analysis AI

Setup

Prerequisites

  • Node.js β‰₯ 18
  • A Supabase project (for auth and history)
  • Optional: a personal Gemini, OpenRouter, or Groq key after the 15 monthly platform suggestions are used

Steps

# 1. Clone the repository
git clone https://github.com/gcharpe1604/gitanalyzer.git
cd gitanalyzer

# 2. Install dependencies
npm install

# 3. Configure environment variables
cp .env.example .env
# Edit .env with your values

# 4. Start the full local app, including Netlify Functions for AI generation
npm run dev

Use npm run dev:vite only for UI work that does not need AI generation or other Netlify Functions.

Environment Variables

# Supabase (required for auth and history)
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key

# GitHub token (optional β€” increases rate limit from 60 to 5000 req/hr)
VITE_GITHUB_TOKEN=your_github_token

# Netlify Functions only β€” mark these as secret and include Functions scope
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SECRET_KEY=your-supabase-secret-or-service-role-key
GROQ_API_KEY=your-groq-key
OPENROUTER_API_KEY=your-openrouter-key
GEMINI_API_KEY=your-gemini-key

Never use a VITE_ prefix for Groq, OpenRouter, Gemini, or Supabase secret keys. Vite variables are browser-facing. Configure the server-only names above in Netlify and redeploy. Personal provider keys are added from the signed-in account menu and remain separated by account in that browser.


Supabase history schema

Signed-in analysis history is stored in the Supabase public.analyses table. For a new Supabase project, apply the checked-in migration before testing History:

supabase db push

The migrations secure per-user analysis history and maintain the private, atomic monthly AI allowance used by the Netlify Function.


Why Commit Messages Matter

A commit message is documentation written at the moment of change β€” when context is freshest. Poor commit histories make code review harder, debug sessions slower, and onboarding more painful.

Tools like git blame, git bisect, and changelogs all depend on meaningful commit messages. Yet most teams treat commit messages as an afterthought.

GitAnalyzer makes the quality of commit messages visible. By scoring and surfacing patterns at the repository level, it gives developers and teams a concrete starting point for improvement β€” without needing to read through hundreds of commits manually.


License

MIT

About

Analyze GitHub commit quality, uncover developer patterns, and improve commit messages with explainable scoring, actionable insights, and AI-assisted suggestions.

Topics

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors