Skip to content

Latest commit

 

History

History
237 lines (158 loc) · 6.45 KB

File metadata and controls

237 lines (158 loc) · 6.45 KB

LeetCode to GitHub 🚀

Automatically push your accepted LeetCode solutions to GitHub with OAuth login!

A browser extension that seamlessly syncs your LeetCode accepted submissions to your GitHub repository, helping you build your coding portfolio effortlessly.

Firefox Add-on Chrome Web Store Edge Add-ons


✨ Features

  • 🔄 Automatic Sync - Push accepted solutions to GitHub instantly
  • 🎛️ Toggle Control - Enable/disable auto-push with one click
  • 📊 Activity Log - Track recent submissions in real-time
  • 🔔 Desktop Notifications - Get notified on success or failure
  • 📈 Performance Stats - Save runtime and memory statistics
  • 🎯 Smart Detection - Push each solution only once
  • 📁 Organized Structure - All solutions saved in solution/ folder
  • 🌐 Multi-language Support - C++, Java, Python, JavaScript, and more
  • 🔒 Privacy-First - All data stored locally, no tracking
  • 🔐 OAuth Sign-in - No manual PAT creation for end users

📸 Screenshots

Extension Popup

Extension Popup

Activity Log

Activity Log


🚀 Installation

From Browser Stores

Firefox:

Chrome:

Microsoft Edge:

Manual Installation (Development)

Firefox:

  1. Download or clone this repository
  2. Open Firefox and navigate to about:debugging#/runtime/this-firefox
  3. Click "Load Temporary Add-on"
  4. Select the manifest.json file

Chrome:

  1. Download or clone this repository
  2. Open Chrome and navigate to chrome://extensions/
  3. Enable "Developer mode"
  4. Click "Load unpacked"
  5. Select the extension folder

Microsoft Edge:

  1. Download or clone this repository
  2. Open Edge and navigate to edge://extensions/
  3. Enable "Developer mode"
  4. Click "Load unpacked"
  5. Select the extension folder

⚙️ Setup

  1. Click the extension icon in your browser toolbar
  2. Toggle Extension Status: Turn ON/OFF as needed
  3. Click "CONNECT_GITHUB" to sign in with GitHub OAuth
  4. Repository Path: Enter your repo in format username/repository
  5. Click "SAVE_CONFIG"
  6. Start solving LeetCode problems!

OAuth App Setup (for extension developers)

This extension uses GitHub OAuth Device Flow. Before building for users, configure your GitHub OAuth App client id in scripts/background.js:

  1. Create an OAuth App in GitHub settings
  2. Copy the Client ID
  3. Set GITHUB_OAUTH_CLIENT_ID in scripts/background.js
  4. Rebuild/reload the extension

💡 Usage

  1. Go to LeetCode and solve a problem
  2. Submit your solution
  3. When you see "Accepted" ✅, the extension automatically:
    • Extracts your code
    • Detects the programming language
    • Captures runtime & memory stats
    • Pushes to your GitHub repository
  4. Check the Activity Log in the popup for status
  5. View your solutions in the solution/ folder on GitHub!

Your GitHub Repo Structure:

your-repo/
├── solution/
│   ├── two-sum.cpp
│   ├── add-two-numbers.py
│   ├── longest-substring.java
│   └── ...
└── README.md

🔒 Privacy

This extension respects your privacy:

  • ✅ All configuration stored locally in your browser
  • ✅ No data collection or tracking
  • ✅ No external servers (except GitHub API)
  • ✅ OAuth access token is stored locally in your browser storage
  • ✅ Open source - inspect the code yourself!

See PRIVACY.md for full details.


🛠️ Tech Stack

  • Manifest V3 - Latest extension API
  • Pure JavaScript - No frameworks, lightweight
  • Chrome Storage API - Local data persistence
  • GitHub API - Direct repository integration
  • Monaco Editor Detection - Accurate code extraction

📋 Requirements

  • Firefox 112+ or Chrome 88+
  • Microsoft Edge 88+ (Chromium)
  • GitHub account (OAuth login)
  • LeetCode account

🤝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork this repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development

# Clone the repository
git clone https://github.com/nkdkhtl/leetcode-to-github.git
cd leetcode-to-github

# Make your changes...

# Build the extension
chmod +x build.sh
./build.sh

📝 Changelog

See the full changelog in CHANGELOG.md

v1.0.0 - Initial Release

  • ✨ Auto-push accepted solutions
  • 🎛️ ON/OFF toggle
  • 📊 Activity log
  • 🔔 Desktop notifications

⚠️ Known Issues

  • LeetCode may update their DOM structure - extension will be updated accordingly
  • GitHub API rate limit: 5000 requests/hour
  • Duplicate files will be overwritten

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🙏 Acknowledgments

  • Inspired by various LeetCode sync tools
  • Built with ❤️ for the coding community

📧 Support


Made with ❤️ by Nam Khuc

⭐ Star this repo if you find it useful!