Skip to content

nkdkhtl/leetcode-to-github

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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!

About

This extension helps push your accepted solution to your selected repository

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors