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. For logged-in users, it also offers AI-powered commit message improvements and saves analysis history across sessions.


Key Features

  • Commit scoring (0–10) β€” Scores commit messages based on clarity, structure, and consistency

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

    • Clarity β€” penalizes messages that start with vague terms like fix, update, wip, or misc
    • Structure β€” measures what percentage of commits use typed prefixes (feat:, fix:, chore:, etc.)
    • 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

  • AI commit suggestions (logged-in users only) β€” Logged-in users can request an AI-rewritten version of any commit message. The AI strictly follows Conventional Commits and enforces imperative mood. This feature is gated to manage API usage and provide a personalized experience. Supported providers: Gemini, OpenRouter, Groq (with automatic fallback)

  • Persistent analysis history β€” Logged-in users have their repository analyses saved to Supabase. Guest sessions use localStorage

  • Authentication β€” Email/password sign-up and sign-in via Supabase Auth. Username is collected at registration and displayed in the navbar

  • Copy Summary β€” One-click button to copy a plain-text analysis summary to the clipboard


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 suggestions (logged-in only) β€” Users can click "Improve with AI" on any commit to get a rewritten message
  7. History is saved β€” Logged-in users have the analysis persisted to their Supabase profile for future reference

Scoring System

Each commit message starts at a score of 10. Points are deducted for:

Rule Deduction
Missing Conventional Commits prefix (e.g. feat:) βˆ’2
Subject line shorter than 10 characters βˆ’2
Contains vague words (stuff, things, wip, misc) βˆ’2
Subject does not start with an imperative verb βˆ’1
Subject ends with a period βˆ’1

Score interpretation:

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

Examples:

❌  fix bug
    Score: 4/10 β€” missing prefix, too short, non-specific subject

βœ…  fix(auth): remove null check in login token validator
    Score: 10/10 β€” typed prefix, imperative verb, specific subject, correct length

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Browser                    β”‚
β”‚                                             β”‚
β”‚  React + TypeScript (Vite)                  β”‚
β”‚  β”œβ”€β”€ InputSection   β†’ user/repo entry       β”‚
β”‚  β”œβ”€β”€ SummarySection β†’ scores + insights     β”‚
β”‚  β”œβ”€β”€ CommitList     β†’ per-commit breakdown  β”‚
β”‚  β”œβ”€β”€ Playground     β†’ AI suggestion editor  β”‚
β”‚  └── 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          β”‚
    β”‚  Gemini β†’ OpenRouter    β”‚
    β”‚          β†’ Groq         β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Supabase               β”‚
    β”‚  - Auth (email/password)β”‚
    β”‚  - 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 18 + TypeScript
Build Tool Vite
Styling Vanilla CSS with CSS custom properties
Data Source GitHub REST API v3
AI Providers Google Gemini, OpenRouter, Groq
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: API keys for Gemini, OpenRouter, or Groq (for AI suggestions)

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 development server
npm run dev

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

# AI providers (optional β€” at least one required for AI suggestions)
VITE_GEMINI_API_KEY=your_gemini_key
VITE_OPENROUTER_API_KEY=your_openrouter_key
VITE_GROQ_API_KEY=your_groq_key

The app works without AI keys β€” scoring and insights are fully rule-based. AI suggestions are only activated when at least one provider key is configured and the user is signed in.


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

Releases

No releases published

Packages

 
 
 

Contributors

Languages