Automatic LeetCode to GitHub Sync with AI Code Analysis & Peer Reviews
LeetGit is a modern Chrome (Manifest V3) extension designed to automatically sync your accepted LeetCode solutions directly to your GitHub repository. It acts as your personal coding portfolio builder, generating AI-powered problem explanations and automated code quality reviews on every submission.
| Feature | Description |
|---|---|
| 🔐 Seamless GitHub OAuth | Connect via GitHub's Device Flow — 1-click authorization with zero raw tokens stored in code. |
| ✅ Accepted-Only Interception | Intercepts LeetCode's judge results and only pushes code when your solution is Accepted. |
| 🤖 AI Complexity Analysis | Automatically generates problem descriptions + Time & Space complexity breakdowns in README.md. |
| 📋 AI Code Reviews | Creates a dedicated REVIEW.md file with code quality ratings and optimization suggestions. |
| 📊 Dashboard & Streaks | Interactive SVG ring chart tracking Easy / Medium / Hard solved counts and daily coding streaks. |
| 📶 Offline Queueing | Submissions are cached locally during network drops and auto-synced when back online. |
| 📁 Flexible Folder Layouts | Organize your repo by Difficulty (solutions/Easy/two-sum), Language, or Flat structure. |
[LeetCode Submit] ➔ [Judge: Accepted] ➔ [LeetGit Interceptor]
│
┌──────────────────────────────────────────┴──────────────────────────────────────────┐
▼ ▼
[GitHub Commit] [AI Dispatcher]
Push solution code to repo Generate README & REVIEW
- Solve a LeetCode problem and click Submit.
- LeetGit watches the judge result — if Accepted, it immediately triggers.
- Pushes code to GitHub in your preferred directory structure.
- AI generates docs — Gemini / OpenRouter creates
README.md(complexity analysis) andREVIEW.md(peer review). - Dashboard updates — Increments your Easy/Medium/Hard counters and daily streak automatically.
- Clone or download this repository:
git clone https://github.com/salim7-s/Leetgit.git
- Open Chrome and navigate to
chrome://extensions. - Enable Developer mode (toggle in top-right corner).
- Click Load unpacked and select the
LeetGitdirectory.
- Create a target repository on GitHub (e.g.,
leetcode-solutions). - Click the LeetGit icon in your Chrome extension bar.
- In Settings, click Connect GitHub Account (1-click OAuth login).
- Enter your target Repository Name (e.g.,
leetcode-solutions). - Click Save Changes.
LeetGit supports multiple free AI providers to generate code reviews:
- Gemini AI: Get a free key at aistudio.google.com.
- OpenRouter: Free community models at openrouter.ai.
- Groq: Free high-speed models at console.groq.com.
Choose how solutions are organized inside your GitHub repository:
- By Difficulty (Default):
solutions/Easy/two-sum/two-sum.py - By Language:
solutions/Python/two-sum/two-sum.py - Flat Layout:
solutions/two-sum/two-sum.py
manifest.json Chrome Extension MV3 manifest configuration
popup.html Extension dashboard & settings document
background.js MV3 service worker adapter entry point
src/
├── background/ GitHub REST API, OAuth Device Flow, AI Dispatcher, Queue, Stats
├── content/ LeetCode submission interceptor & page bridge
└── popup/ Dashboard SVG rings, settings forms, & event controllers
tests/ Node.js unit regression test suite
Distributed under the MIT License. See LICENSE for more information.