BackBrowser Extension & Developer Tooling
#15★ FEATUREDShipped & Open Source

LeetSync

Autonomous, privacy-focused LeetCode to GitHub synchronization engine

Chrome ExtensionTypeScriptGitHub APIAutomation
LeetSync
ENGINEERING // ARCHITECTURE

How It Connects

LeetSync is engineered as a Chrome Extension Manifest V3 background service worker and content script system. When a submission completes on leetcode.com, an in-page observer hooks the submission event and extracts problem slug, difficulty, accepted code, and execution metrics. The service worker authenticates with GitHub via Personal Access Token securely persisted in chrome.storage.local, executes a duplicate check against the destination repository via the GitHub REST API (Octokit/fetch), commits the solution tree in hierarchical folders (e.g., Problem-Name/Solution.ext), and surfaces real-time sync telemetry to the extension popup dashboard.

LeetSync / ARCH MAP
ARCHITECTURE ENGINE
INITIALIZING REPO...
LeetSync architecture diagram
SCROLL TO PANMERMAID.INK

System Components

EXECUTION PIPELINE

How It Works

01
User / LeetCode

Problem Solved & Accepted

User submits problem code; LeetCode judges and renders the green "Accepted" state.

→ Accepted submission DOM state and network payload
02
Content Script

Metadata & Code Extraction

Parses problem title, numeric ID, runtime, memory percentile, language syntax, and raw solution code.

→ Structured Problem Payload
03
Background Worker

Service Worker Verification

Queries chrome.storage.local for encrypted user GitHub token and target repository configuration.

→ Authorized API Context
04
GitHub Client

Repository Tree Duplicate Check

Sends GET request to GitHub contents endpoint to inspect if solution version already exists.

→ SHA hash or 404 (New Problem)
05
GitHub REST API

Atomic Solution Commit

Dispatches PUT request to create file under /{Difficulty}/{Problem_ID}-{Slug}/{Solution_File}.

→ GitHub Commit SHA
06
Popup Notification

Telemetry & UI Feedback

Emits sync status toast and increments user synced problems count in local metrics database.

→ Synchronized State
STACK // ARCHITECTURE INTEL⚡ LIVE SPECS

Technical Breakdown

Granular architectural layers, runtime dependencies, and audited production decisions.

STACK: TypeScript, Chrome Extension Manifest V3, GitHub REST API
  • React with Tailwind CSS embedded inside Chrome Extension action popup
    copy
  • Real-time badge counter updating active sync state on browser toolbar
    copy
  • Accessible settings panel for selecting repo name, branch, and directory convention
    copy
  • Chrome Manifest V3 background service worker with event-driven execution
    copy
  • Asynchronous queueing pipeline to handle bursts of concurrent submissions smoothly
    copy

Engineering Tradeoffs & Key Decisions

Why this architecture over alternatives
3 ARCHITECTURAL CHOICES
DECISION #1AUDITED

Manifest V3 Service Worker over Persistent Background Pages

↳

Implemented purely event-driven Service Worker rather than a persistent background page.

Complies with modern Chrome security standards, consumes zero RAM when idle, and wakes on demand.

PRODUCTION TESTEDZERO REGRESSIONS
DECISION #2AUDITED

Client-Side Only Authentication Flow

↳

Tokens are stored strictly in browser chrome.storage with no telemetry backend.

Guarantees absolute developer privacy: personal GitHub tokens never transit an intermediary server.

PRODUCTION TESTEDZERO REGRESSIONS
DECISION #3AUDITED

Hierarchical Difficulty Directory Scheme

↳

Organized repository paths by difficulty tag and problem ID rather than a flat root list.

Enables clean navigation on GitHub and automated portfolio generation scripts for engineering interviews.

PRODUCTION TESTEDZERO REGRESSIONS
✓

Audited Production Outcomes & Metrics

HIGH IMPACT RESULTS
▸Built an autonomous Chrome extension that automatically syncs accepted LeetCode solutions directly to user GitHub repositories.
▸Implemented privacy-focused token persistence via chrome.storage.local with secure OAuth authentication flow.
▸Designed a modern dashboard with real-time stats tracking, language badges, and one-click repo linking.