- About The Project
- Screenshots
- Features
- Tech Stack
- How It Works
- Installation
- Configuration
- Usage
- Project Structure
- Future Improvements
- Contributing
- License
CodeforcesSync is a powerful Chrome Extension designed for competitive programmers. It seamlessly bridges your Codeforces journey with your GitHub profile.
Whenever you receive an "Accepted" verdict on Codeforces, this extension automatically detects the submission, extracts your source code, and directly pushes it to a chosen GitHub repository. It works entirely in the background using the official GitHub API, ensuring your coding profile stays up to date without any manual effort.
| Disconnected State | Settings Configuration | Connected State |
|---|---|---|
- โก Automated Background Syncing: No manual copying or committing required. If you solve it, it syncs.
- ๐ฅ Real-time Streak Tracking: Gamify your daily progress with an integrated solving streak tracker right inside the visual popup!
- ๐ง Smart Language Detection: Parses exact language tags (e.g.,
GNU C++20,PyPy 3) and maps them to accurate file extensions (.cpp,.py,.js, etc.). - ๐ก๏ธ Cloudflare Bot Bypass: Intelligently utilizes your active Codeforces tab session to safely fetch code without triggering aggressive Cloudflare blockages.
- ๐ Custom Subdirectories: Store submissions in a specific folder (like
solutions/) by configuring custom repository paths natively from the popup. - โฑ๏ธ Smart API Throttling: Safely manages GitHub Secondary Rate limits and Codeforces API limits behind the scenes using asynchronous delays.
CodeforcesSync is built with modern web technologies:
- React 19 - Powerful User Interface layout
- TypeScript - Type-safe programming
- Tailwind CSS v4 - Beautiful responsive styling
- Vite - Lightning-fast frontend build tool
- Chrome Extension API (Manifest V3) - Core extension functionality
- GitHub REST API - Uploading files and committing code natively
- Polling: The Service Worker (
background.ts) relies on Chrome Alarms to silently poll the official Codeforces API (user.status) every minute. - Filtering: It filters your recent submissions to find new Accepted (OK) verdicts that haven't been previously synced.
- Fetching Code: Instead of a basic
fetch(which Cloudflare blocks), the extension securely injects a fetch execution script into your currently open Codeforces tab to safely extract the raw source code. - Pushing to GitHub: The code is encoded in Base64 and automatically committed to your linked GitHub repository via the GitHub REST API.
CodeforcesSync is distributed via source and Developer Mode in Chrome.
Download the latest Pre-built Release ZIP file from the Releases page or build it manually from source. #[Best Oprtion]
To build from source:
# Clone the repository
git clone https://github.com/mhdnazrul/CodeforcesSync.git
# Navigate into the project
cd CodeforcesSync
# Install dependencies
npm install
# Build the extension
npm run buildThis generates a production-ready dist/ folder containing the compiled Chrome Extension.
- Open Google Chrome and navigate to:
chrome://extensions/ - Turn on Developer mode using the toggle switch in the top right corner.
- Click the Load unpacked button in the top left corner.
- Select the
distfolder located inside your project directory (or the extracteddistfolder from the Release ZIP). - The extension is now installed! (Optional: Pin it to your toolbar for easy access.)
To allow the extension to securely push code on your behalf, you need a standard GitHub Personal Access Token (PAT).
Create a new Public or Private repository on GitHub (e.g., Codeforces-Solutions).
- Go to GitHub โ Settings โ Developer settings โ Personal Access Tokens โ Tokens (classic/fine-grained)
- Click Generate new token โ Fine-grained token.
- set name and date (e.g.,
30 dayor90 days) - **Repository access: Select repositories โ (e.g.,
Codeforces-Solutions) - Permissions:
Contents โ
Read & Write
Commit statuses โRead & Write(optional) - Click Generate token and COPY it immediately โ update your extension with it.
- Click the CodeforcesSync icon in your Chrome toolbar.
- Click the Settings gear icon.
- Fill in your details:
- GitHub Username
- Personal Access Token
- Codeforces Handle (e.g.,
tourist) - Repo Name (e.g.,
Codeforces-Solutions) - (Optional) Check Use Subdirectory and enter a folder name.
- Click Save.
Once configured, the background service takes over!
- Keep Codeforces Active: You must leave a Codeforces tab completely open in your browser while solving. The extension securely borrows your active Codeforces session to bypass Cloudflare Bot-Protection blockages.
- Solve Problems: Submit solutions as normally as you would!
- Automatic Syncing: Once receiving an "Accepted" verdict, CodeforcesSync intercepts the submission, processes the source code locally, and pushes it up to your linked repository.
CodeforcesSync/
โโโ public/ # Static extension assets (icons, manifest)
โโโ src/ # Source code
โ โโโ background/ # Background Service Worker logic (API polling)
โ โโโ utils/ # Helper functions (storage, GitHub API mapping)
โ โโโ App.tsx # Main React UI for the Extension Popup
โ โโโ main.tsx # React entry point
โ โโโ index.css # Tailwind CSS styles
โโโ package.json # Node.js dependencies and scripts
โโโ vite.config.ts # Vite bundler configuration
- Add support for syncing submissions from other platforms (LeetCode, AtCoder, CodeChef).
- Allow customizable commit messages.
- Create an explicit "Sync Now" button in the popup to force an immediate refresh.
- Implement a rich dashboard showing solving statistics and language summaries.
- Submit to Chrome Web Store for easier access.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
Important Note for Developers: Ensure you keep a Codeforces tab open while testing, as the extension relies on active tab sessions to bypass Cloudflare protection!
- Fork the Project.
- Create your Feature Branch (
git checkout -b feature/AmazingFeature). - Commit your Changes (
git commit -m 'Add some AmazingFeature'). - Push to the Branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Code is not syncing?
- Cloudflare Blocking: DevTools might say "Blocked by Cloudflare Error". Ensure you keep the actual
codeforces.comwebsite actively open in your browser. Without a valid tab session, Codeforces treats the background worker as a web scraper bot! - Missing Handle: Double-check that your Codeforces handle in the extension settings matches exactly with your profile.
Distributed under the MIT License. See LICENSE for more information.