Automatically capture your accepted LeetCode & GeeksforGeeks submissions and push them to a GitHub repository β with full metadata, organized by platform and difficulty.
Features β’ Architecture β’ Installation β’ How It Works β’ Tech Stack
Competitive programmers and interview preppers solve hundreds of problems, but:
- β Solutions are trapped inside LeetCode / GFG platforms
- β No easy way to showcase your work on GitHub
- β Manually copying code + creating files is tedious
- β You lose context β runtime stats, problem descriptions, difficulty tags
A Chrome extension that automatically detects when you submit an accepted solution on LeetCode or GeeksforGeeks and pushes it to your GitHub repo with:
- Full source code in the correct file format
- Auto-generated README with problem details, stats, and badges
- Organized folder structure by platform and difficulty level
- Zero manual effort β just solve and submit!
| Feature | Description |
|---|---|
| π Auto-Sync | Detects accepted submissions in real-time β no clicking needed |
| π Dual Platform | Supports both LeetCode and GeeksforGeeks |
| π Smart Organization | Files organized as LeetCode/Easy/0001-two-sum/solution.py and GFG/Medium/reverse-a-linked-list/solution.cpp |
| π Rich READMEs | Auto-generated with difficulty badges, tags, stats, problem description |
| π 18+ Languages | Python, C++, Java, JavaScript, Go, Rust, TypeScript, and more |
| π Multi-Language | Submit same problem in different languages β all solutions kept |
| π Full Metadata | Runtime, memory, percentile beats, timestamps, problem links |
| βͺ Sync Past Submissions | Backfill all your historical LeetCode solutions with one click |
| Feature | Description |
|---|---|
| π‘ Offline Queue | Failed pushes are queued and auto-retried when back online |
| π Exponential Backoff | Smart retry with increasing delays (5min β 10min β 20min) |
| ποΈ Auto-Create Repo | Creates the GitHub repo automatically if it doesn't exist |
| π‘οΈ Duplicate Prevention | Tracks submission IDs β never syncs the same submission twice |
| π Auto-Detect Branch | Works with main, master, or any custom default branch |
| β‘ Rate Limit Aware | Monitors GitHub API limits and delays requests when needed |
| Feature | Description |
|---|---|
| π¨ Premium Dark Theme | Glassmorphism popup with smooth animations |
| π Dashboard | Total syncs, difficulty breakdown with progress rings |
| π History Log | Last 50 synced submissions with platform badges (LC/GFG) |
| π Toast Notifications | In-page success/failure alerts on LeetCode & GFG |
| βοΈ Settings Panel | GitHub token, repo name, auto-sync toggle, past sync button |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Chrome Extension (Manifest V3) β
β β
β ββββββββββββββββ ββββββββββββββββββββββ ββββββββββββββββββ β
β β Popup UI β β Content Scripts β β Background β β
β β β β β β Service β β
β β β’ Dashboard β β LeetCode: β β Worker β β
β β β’ History ββββΊβ β’ inject.js ββββΊβ β β
β β β’ Settings β β β’ content.js β β β’ GitHub API β β
β β β β β β β’ Offline Q β β
β ββββββββββββββββ β GeeksforGeeks: β β β’ Retry Logic β β
β β β’ gfg_inject.js ββββΊβ β’ Past Sync β β
β β β’ gfg_content.js β βββββββββ¬βββββββββ β
β ββββββββββββββββββββββ β β
β βββββββΌβββββββ β
β β GitHub API β β
β β (REST v3) β β
β ββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
your-solutions-repo/
βββ LeetCode/
β βββ Easy/
β β βββ 0001-two-sum/
β β β βββ README.md β Problem details + stats
β β β βββ solution.py β Your Python solution
β β β βββ solution.cpp β Your C++ solution (multi-lang!)
β β βββ 0070-climbing-stairs/
β β βββ README.md
β β βββ solution.java
β βββ Medium/
β β βββ 0056-merge-intervals/
β β βββ README.md
β β βββ solution.cpp
β βββ Hard/
β βββ 0004-median-of-two-sorted-arrays/
β βββ README.md
β βββ solution.java
βββ GFG/
βββ Easy/
β βββ reverse-a-string/
β βββ README.md
β βββ solution.cpp
βββ Medium/
β βββ topological-sort/
β βββ README.md
β βββ solution.java
βββ Hard/
βββ longest-prefix-suffix/
βββ README.md
βββ solution.py
| Component | Technology |
|---|---|
| Extension | Chrome Manifest V3 |
| Language | Vanilla JavaScript (ES6+) |
| Styling | CSS3 (Glassmorphism, Animations) |
| LeetCode Data | GraphQL API (unofficial, session-based) |
| GFG Data | __NEXT_DATA__ extraction + DOM scraping + XHR interception |
| GitHub Push | GitHub REST API v3 (Contents API) |
| Storage | chrome.storage.local |
| Retry | chrome.alarms API |
- Clone this repository
git clone https://github.com/shivam16s/leetcode-gfg-sync.git
- Open Chrome β
chrome://extensions/ - Enable Developer Mode (top-right toggle)
- Click "Load unpacked" β select the cloned folder
- Click the extension icon β go to Settings tab
- Enter your GitHub Personal Access Token (create one here with
reposcope) - Enter your target repository name
- Click "Save & Test Connection" β should show β green status
- Start solving problems on LeetCode or GFG β solutions auto-sync! π
leetcode-gfg-sync/
βββ manifest.json # Extension configuration (Manifest V3)
βββ scripts/
β βββ inject.js # LeetCode β intercepts submissions
β βββ content.js # LeetCode β GraphQL fetch + toast
β βββ gfg_inject.js # GFG β intercepts submissions
β βββ gfg_content.js # GFG β __NEXT_DATA__ + DOM scraping
β βββ background.js # Service worker β GitHub API + queue
βββ popup/
β βββ popup.html # 3-tab popup UI
β βββ popup.css # Dark glassmorphism theme
β βββ popup.js # Popup logic & state
βββ styles/
β βββ toast.css # In-page notification styles
βββ icons/
β βββ icon16.png # Toolbar icon
β βββ icon48.png # Extensions page icon
β βββ icon128.png # Store icon
βββ docs/
βββ IMPLEMENTATION_PLAN.md # Technical architecture document
βββ TASKS.md # Development milestone tracker
- Token stored locally β never sent anywhere except
api.github.com - No external analytics β zero tracking, zero telemetry
- Minimal permissions β only
storage,activeTab,alarms - Open source β full code audit possible
- CSP compliant β proper
web_accessible_resourcesusage
| Language | Extension | Language | Extension |
|---|---|---|---|
| Python | .py |
TypeScript | .ts |
| C++ | .cpp |
C | .c |
| Java | .java |
C# | .cs |
| JavaScript | .js |
Go | .go |
| Ruby | .rb |
Swift | .swift |
| Kotlin | .kt |
Rust | .rs |
| Scala | .scala |
PHP | .php |
| Dart | .dart |
Racket | .rkt |
| Erlang | .erl |
Elixir | .ex |
| MySQL | .sql |
Pandas | .py |
- Project ideation & architecture design
- Core extension (manifest, content scripts, service worker)
- LeetCode submission interception
- GeeksforGeeks submission interception
- GitHub API integration (create/update files)
- Multi-language support per problem
- Sync past LeetCode submissions
- Popup UI (dashboard, history, settings)
- Toast notifications on LeetCode & GFG pages
- Offline queue & retry logic
- Extension icons & branding
- Chrome Web Store submission
MIT License β feel free to fork, modify, and distribute.
Built with β€οΈ for the competitive programming community
Stop manually copying code. Let the extension do it for you.