Skip to content

A chrome extension helping people auto save their code to github when leetcoding.

License

Notifications You must be signed in to change notification settings

yjaw/leetcommit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ LeetCommit

Automatically sync your LeetCode & NeetCode solutions to GitHub with a built-in spaced repetition review system.

Chrome Web Store Version License

โœจ Features

๐Ÿ“Š Multi-Platform Support

  • โœ… LeetCode (leetcode.com, leetcode.cn)
  • โœ… NeetCode (neetcode.io)
  • ๐Ÿ”œ More platforms coming soon!

๐Ÿ”„ Automatic Sync

  • Detects successful submissions automatically (100% test cases passed)
  • Syncs code and problem descriptions to GitHub
  • Creates organized folder structure (problem-slug/)
  • Preserves all metadata (difficulty, tags, language, platform)
  • Smart README updates (skips if difficulty unknown and folder exists)

๐Ÿ“š Spaced Repetition System

  • Built-in review scheduler
  • Helps you retain problem-solving patterns
  • Smart intervals based on SuperMemo SM-2 algorithm

๐ŸŽฏ Smart Features

  • Only syncs 100% passed solutions
  • 3-second delay before detection (avoids false positives)
  • Badge notification for sync status (โœ“ success, โœ— error)
  • Platform detection in popup
  • Minimal permissions required

๐Ÿ”ง Installation

From Chrome Web Store (Recommended)

  1. Visit the Chrome Web Store (link coming soon)
  2. Click "Add to Chrome"
  3. Follow the setup instructions

From Source (Development)

  1. Clone this repository:

    git clone https://github.com/yjaw/leetcommit.git
    cd leetcommit
  2. Open Chrome and navigate to chrome://extensions/

  3. Enable "Developer mode" (toggle in top right)

  4. Click "Load unpacked" and select the leetcommit folder

โš™๏ธ Setup (2 minutes)

1. Get GitHub Personal Access Token

  1. Go to GitHub Settings โ†’ Developer settings โ†’ Personal access tokens โ†’ Tokens (classic)
  2. Click "Generate new token (classic)"
  3. Give it a name (e.g., "LeetCommit")
  4. Select scope: repo (Full control of private repositories)
  5. Click "Generate token"
  6. Copy the token (you won't see it again!)

2. Configure Extension

  1. Click the LeetCommit icon in your Chrome toolbar
  2. Click on the status card to open settings
  3. Paste your GitHub Personal Access Token
  4. Enter your repository name (format: username/repo)
  5. Click "Connect GitHub"

3. Start Coding!

  1. Go to LeetCode or NeetCode
  2. Solve a problem
  3. Submit your solution
  4. Wait for 100% test cases to pass
  5. See the green โœ“ badge on the extension icon
  6. Check your GitHub repo!

๐Ÿ“ Repository Structure

Your GitHub repository will be organized like this:

your-repo/
โ”œโ”€โ”€ two-sum/
โ”‚   โ”œโ”€โ”€ README.md          # Problem description with badges
โ”‚   โ””โ”€โ”€ two-sum.py         # Your solution
โ”œโ”€โ”€ add-two-numbers/
โ”‚   โ”œโ”€โ”€ README.md
โ”‚   โ””โ”€โ”€ add-two-numbers.js
โ””โ”€โ”€ ...

README.md Example

# [1. Two Sum](https://leetcode.com/problems/two-sum/)

![LeetCode](https://img.shields.io/badge/LeetCode-grey) ![Easy](https://img.shields.io/badge/Easy-brightgreen)

Given an array of integers nums and an integer target...

๐ŸŽฎ Usage

Automatic Sync

Just solve problems normally! The extension will:

  1. Detect when you click "Submit"
  2. Wait 3 seconds
  3. Check if 100% test cases passed
  4. Sync to GitHub automatically
  5. Show a badge (โœ“ or โœ—) for 5 seconds

Manual Trigger (for testing)

Open the browser console on a problem page and run:

leetcommitManualTrigger()

Review System

  1. Click "View Reviews" in the popup
  2. See your scheduled reviews
  3. Click on a problem to review it
  4. Rate your recall (Easy/Good/Hard)
  5. System adjusts next review interval

๐Ÿ” Debugging

See DEBUG.md for detailed debugging instructions.

Quick tips:

  • Content Script Console: Right-click page โ†’ Inspect โ†’ Console
  • Service Worker Console: chrome://extensions โ†’ LeetCommit โ†’ Service worker
  • Popup Console: Right-click popup โ†’ Inspect

๐Ÿ—๏ธ Architecture

Content Scripts

  • submission_observer_lc.js - LeetCode detection
  • submission_observer_nc.js - NeetCode detection

Background Service Worker

  • github_client.js - GitHub API integration, sync logic

Popup

  • popup.html/js - Configuration UI

Options Page

  • review.html/js - Spaced repetition review system

See docs/multi_platform_architecture.md for more details.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a PR

Adding a New Platform

See docs/multi_platform_architecture.md for instructions.

๐Ÿ“ Privacy

LeetCommit respects your privacy:

  • โœ… No data collection
  • โœ… No analytics
  • โœ… No external servers
  • โœ… All data stored locally
  • โœ… Direct sync to YOUR GitHub

See PRIVACY_POLICY.md for full details.

๐Ÿ“„ License

MIT License - see LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Inspired by the coding community's need for better solution tracking
  • Built with love for interview preparation

๐Ÿ“ž Support

๐Ÿ—บ๏ธ Roadmap

  • Support for more platforms (HackerRank, CodeForces, etc.)
  • Statistics dashboard
  • Export to PDF
  • Team collaboration features
  • VS Code extension

Made with โค๏ธ for the coding community

โญ Star this repo if you find it helpful!

About

A chrome extension helping people auto save their code to github when leetcoding.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published