|
1 | 1 | # CommitCode |
2 | 2 |
|
3 | | -A privacy-focused Chrome Extension that automatically syncs your LeetCode submissions directly to your own GitHub repository. |
4 | | - |
5 | | -## Features |
6 | | -- **Zero Third-Party Servers**: Connects directly to GitHub via their official REST API. No intermediate servers, no data harvesting. |
7 | | -- **Fine-Grained Access**: Uses modern GitHub fine-grained Personal Access Tokens limited *strictly* to a single repository of your choosing. |
8 | | -- **Flexible Folder Structures**: Organize your solutions by Difficulty, Topic, Language, Problem Number, or Flat. |
9 | | -- **Duplicate Detection**: Intelligently hashes your code to prevent spamming your repo with identical submissions. |
10 | | -- **Smart Versioning**: Optionally keep a history of your attempts (e.g., `_v1`, `_v2`) or overwrite in place. |
11 | | -- **Auto-generated README**: Automatically maintains a gorgeous markdown table and difficulty stats right in your repo. |
12 | | -- **File Headers**: Automatically prepends metadata (Title, Difficulty, Runtime, Memory, URL) to every uploaded file. |
13 | | - |
14 | | -## Setup |
15 | | -1. Create a NEW, empty repository on GitHub (e.g., `leetcode-solutions`). |
16 | | -2. Generate a Fine-Grained Personal Access Token (Settings -> Developer Settings). |
17 | | -3. Grant it **Contents: Read and Write** specifically for that one new repository. |
18 | | -4. Install CommitCode in Chrome, enter your token and repo, and solve a problem! |
19 | | - |
20 | | -## Privacy Guarantee |
21 | | -Your code, token, and stats stay strictly between your browser and GitHub. We don't track you. |
22 | | - |
23 | | -## License and Attribution |
| 3 | +<p align="center"> |
| 4 | + <em>A privacy-focused Chrome Extension that automatically syncs your LeetCode submissions directly to your own GitHub repository.</em> |
| 5 | +</p> |
| 6 | + |
| 7 | +## ✨ Features |
| 8 | + |
| 9 | +- **Zero Third-Party Servers**: CommitCode connects directly to GitHub via their official REST API. There are no intermediate servers, no databases, and absolutely no data harvesting. |
| 10 | +- **Fine-Grained Access Control**: Uses modern GitHub fine-grained Personal Access Tokens. You grant access strictly to a single repository of your choosing—not your entire GitHub account. |
| 11 | +- **Flexible Folder Structures**: Organize your solutions exactly how you want them: |
| 12 | + - By Difficulty (`Easy/1-two-sum.js`) |
| 13 | + - By Topic (if available) |
| 14 | + - By Language (`javascript/1-two-sum.js`) |
| 15 | + - Flat structure |
| 16 | +- **Duplicate Detection**: Intelligently hashes your code to prevent spamming your repo with identical submissions if you click "Submit" multiple times. |
| 17 | +- **Smart Versioning**: Optionally keep a history of your attempts (e.g., `_v1`, `_v2`) or choose to overwrite them in place. |
| 18 | +- **Auto-generated README**: Automatically maintains a markdown table and difficulty stats right in your repository. |
| 19 | +- **File Headers**: Automatically prepends metadata (Title, Difficulty, Runtime, Memory, LeetCode URL) to every uploaded file. |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## 🚀 Installation (Developer Mode) |
| 24 | + |
| 25 | +Since CommitCode is currently in active development, you can load it directly into Chrome using Developer Mode. |
| 26 | + |
| 27 | +1. **Clone or Download this repository** to your local machine: |
| 28 | + ```bash |
| 29 | + git clone https://github.com/jaiswalism/commitcode.git |
| 30 | + ``` |
| 31 | +2. **Install dependencies and build** the project: |
| 32 | + ```bash |
| 33 | + cd commitcode |
| 34 | + npm install |
| 35 | + npm run build |
| 36 | + ``` |
| 37 | +3. Open Google Chrome and navigate to `chrome://extensions/`. |
| 38 | +4. Enable **Developer mode** (toggle switch in the top right corner). |
| 39 | +5. Click **Load unpacked** in the top left corner. |
| 40 | +6. Select the `dist/` folder generated in step 2. |
| 41 | + |
| 42 | +--- |
| 43 | + |
| 44 | +## ⚙️ Setup Guide |
| 45 | + |
| 46 | +To get CommitCode working, you need to create a dedicated GitHub repository and provide the extension with a Fine-Grained Personal Access Token (PAT). |
| 47 | + |
| 48 | +### Step 1: Create a Repository |
| 49 | +Create a NEW, empty repository on GitHub (e.g., `leetcode-solutions`). |
| 50 | + |
| 51 | +### Step 2: Generate a Token |
| 52 | +1. Click on your GitHub profile picture and go to **Settings**. |
| 53 | +<br> |
| 54 | +<img src="src/options/assets/Settings.png" width="700" /> |
| 55 | + |
| 56 | +2. Under "Access" on the left sidebar, click **Credentials**. |
| 57 | +<br> |
| 58 | +<img src="src/options/assets/Credentials.png" width="700" /> |
| 59 | + |
| 60 | +3. Click on **Personal access tokens** -> **Fine-grained tokens**. |
| 61 | +<br> |
| 62 | +<img src="src/options/assets/PAT.png" width="700" /> |
| 63 | + |
| 64 | +4. Click **Generate new token**. |
| 65 | +<br> |
| 66 | +<img src="src/options/assets/Generate New Token.png" width="700" /> |
| 67 | + |
| 68 | +### Step 3: Configure Token Permissions |
| 69 | +1. Give your token a name, like `CommitCode Sync`. |
| 70 | +2. Set an **Expiration date** (you can set it to No Expiration if you don't want to recreate it later). |
| 71 | +3. Under **Repository access**, select **Only select repositories** and choose the new repository you created in Step 1. |
| 72 | +<br> |
| 73 | +<img src="src/options/assets/Select Repository Access.png" width="700" /> |
| 74 | + |
| 75 | +4. Under **Permissions** -> **Repository permissions**, find **Contents** and change the access to **Read and write**. |
| 76 | +<br> |
| 77 | +<img src="src/options/assets/Content Permission.png" width="700" /> |
| 78 | + |
| 79 | +### Step 4: Add to Extension |
| 80 | +1. Click **Generate token** at the bottom of the page and copy the token (it will only be shown once!). |
| 81 | +2. Open the CommitCode Options page. |
| 82 | +3. Paste the token into the **Personal Access Token** field. |
| 83 | +4. Enter your repository name in the format `username/repo-name` (e.g., `jaiswalism/leetcode-solutions`). |
| 84 | +5. Select your preferred sync preferences (folder structure, versioning mode). |
| 85 | + |
| 86 | +You are ready! Just solve a problem on LeetCode and CommitCode will handle the rest! |
| 87 | + |
| 88 | +--- |
| 89 | + |
| 90 | +## 🔒 Privacy Guarantee |
| 91 | + |
| 92 | +Your code, token, and stats stay strictly between your browser and GitHub. We don't track you, we don't store your data, and we don't use external servers. |
| 93 | + |
| 94 | +## 📜 License and Attribution |
| 95 | + |
24 | 96 | This project is open-source under the **MIT License**. |
25 | 97 |
|
26 | 98 | You are free to use, copy, modify, and distribute this software, **provided that you give explicit credit to the original author (Shyam Jaiswal)**. The original copyright notice and permission notice must be included in all copies or substantial portions of the software. |
0 commit comments