LeetCode Submission Saver is a Chrome extension that automatically saves your successful LeetCode submissions to a GitHub repository. This extension helps you organize and track your coding progress by committing your LeetCode solutions directly to GitHub.
- Automatically captures successful LeetCode submissions.
- Allows you to select a GitHub repository to save your solutions.
- Commits your LeetCode solutions with detailed information (runtime, memory performance, etc.).
- Simple interface for adding your GitHub Personal Access Token (PAT) and selecting a repository.
- Reset functionality to easily reconfigure the extension.
- Add a way to add some notes related to the solution
- leetcode already has a section that allows the user to write some notes, so perhaps this could be used
- perhaps a logic to capture the content section, or a listener of the call since the text will be in the request body
- make the handling of github PATs more secure
- encrypt the PAT and let the user enter a pin to access the PAT
- instead of saving the PAT, just request the token when a commit is made (like an alert)
- have a way of showing that a commit was made successfully to the chosen repository
- success or failure if the PAT/repo was not valid
- currently there is no way of knowing without checking the repo directly
- have a way of checking whether the chosen repository is valid
- if you choose a repo in the extension then delete it, the repository will still be selected even though it doesn't exist
- not the biggest problem since this repo is the user's repository and so they should know if they had deleted the repo or not, but still would be nice to have a manual check button to make sure
- this would also check if the PAT is valid and since PATs can have expiry dates, the check button would be helpful
- Google Chrome: Ensure you have Google Chrome installed on your machine.
- GitHub Account: You need a GitHub account and a Personal Access Token (PAT) with
repopermissions to commit code to your GitHub repositories. - Node.js & npm: You need Node.js and npm installed to build Tailwind CSS.
-
Clone or download the repository to your local machine:
git clone https://github.com/your-repo/leetcode-submission-saver.git
-
Install dependencies:
Navigate to the project directory and install the necessary dependencies:
npm install
-
Build Tailwind CSS:
Run the following command to build Tailwind CSS locally:
npx tailwindcss -i ./input.css -o ./output.css --watch
This command will compile the
input.cssfile intooutput.cssusing Tailwind CSS, and it will watch for any changes so the styles are updated as you modify the CSS. -
Open Chrome and go to
chrome://extensions/. -
Enable Developer Mode (toggle on the top-right corner).
-
Click Load unpacked and select the folder where you cloned or downloaded the extension.
-
The extension will now appear in your Chrome extensions bar.
-
GitHub Personal Access Token (PAT):
- Open the extension by clicking on the LeetCode Submission Saver icon in the Chrome toolbar.
- Enter your GitHub Personal Access Token (PAT) in the provided input field.
- Click the Save button to store the token securely.
-
Select Repository:
- Once your PAT is saved, you can choose the repository where your LeetCode submissions will be committed.
- Use the dropdown menu to select one of your GitHub repositories, then click Save.
-
Commit Submissions:
- After completing a successful submission on LeetCode, the extension will capture the solution and automatically commit it to your selected GitHub repository.
-
Reset:
- You can reset the configuration at any time by clicking the Reset All button in the extension popup.
- Local Storage: The GitHub Personal Access Token (PAT) is stored securely using Chrome's
chrome.storage.localAPI. This storage is local to your device and cannot be accessed by external websites or scripts. - No External Server: The extension does not use any external servers to store or process your PAT. All data remains local to your browser and machine.
- No Hardcoding: The PAT is not hardcoded into the extension, and you are required to input your own token when configuring the extension.
- Token Scope: Ensure that your PAT has the minimum required permissions (typically
reposcope) to commit to your repositories. - Encryption: At this stage, the PAT is not encrypted when stored, which is a known limitation. We recommend revoking the token if you ever uninstall or stop using the extension.
- Use Short-Lived PATs: For enhanced security, consider using short-lived tokens if GitHub enables this functionality.
- Limit PAT Permissions: Only grant the
reposcope and avoid granting excessive permissions when generating your PAT. - Revocation: If the PAT is ever compromised or you no longer need the extension, revoke it immediately via your GitHub account's token management settings.

