Skip to content

yousefdergham/leetship

Repository files navigation

LeetShip πŸš€

Automatically commit your accepted LeetCode submissions to GitHub

LeetShip is a cross-browser extension that detects when you submit an accepted solution on LeetCode and automatically commits it to your GitHub repository with clean structure, generated README files, and organized folders.

Chrome Web Store Firefox Add-ons License: MIT TypeScript Vite

✨ Features

  • πŸš€ Automatic Detection: Detects accepted submissions in real-time
  • πŸ“ Clean Organization: Structures solutions by difficulty (easy/0001-two-sum/)
  • πŸ“‹ Generated READMEs: Creates detailed documentation with problem metadata
  • πŸ”’ Secure Authentication: GitHub OAuth with PKCE for secure access
  • 🌐 Cross-Browser: Works on Chrome (MV3) and Firefox
  • ⚑ Offline Support: Queues commits when offline and retries automatically
  • 🎨 Modern UI: Beautiful options page with dark mode support
  • πŸ›‘οΈ Privacy-First: No telemetry, your code stays private

πŸš€ Quick Start

For Users

  1. Download the Extension

    • Chrome: Download from Chrome Web Store (coming soon)
    • Firefox: Download from Firefox Add-ons (coming soon)
  2. Setup

    • Click the LeetShip icon and follow the onboarding wizard
    • Add your GitHub Personal Access Token
    • Select or create a repository for your solutions
    • Configure your preferences
  3. Start Coding

    • Visit LeetCode and solve problems as usual
    • LeetShip automatically detects accepted submissions
    • Check your GitHub repository to see your solutions!

For Developers

# Clone & Install
git clone https://github.com/yousefdergham/leetShip.git
cd leetShip
npm install

# Development
npm run dev          # Start development server
npm run build        # Build for development
npm run build:all    # Build packaged extensions

# Code Quality
npm run lint         # Run ESLint
npm run type-check   # TypeScript type checking
npm test             # Run tests

πŸ“ Repository Structure

LeetShip creates a clean, organized structure in your GitHub repository:

my-leetcode-solutions/
β”œβ”€β”€ README.md              # Auto-updated with statistics
β”œβ”€β”€ easy/
β”‚   β”œβ”€β”€ 0001-two-sum/
β”‚   β”‚   β”œβ”€β”€ solution.py
β”‚   β”‚   └── README.md
β”‚   └── 0026-remove-duplicates/
β”‚       β”œβ”€β”€ solution.java
β”‚       └── README.md
β”œβ”€β”€ medium/
β”‚   └── 0002-add-two-numbers/
β”‚       β”œβ”€β”€ solution.cpp
β”‚       └── README.md
└── hard/
    └── 0004-median-of-two-sorted-arrays/
        β”œβ”€β”€ solution.js
        └── README.md

πŸ—οΈ Architecture

src/
β”œβ”€β”€ background/          # Service worker for submission detection
β”œβ”€β”€ content/             # Content scripts for LeetCode integration
β”œβ”€β”€ ui/                  # User interface components
β”œβ”€β”€ lib/                 # Core libraries
β”‚   β”œβ”€β”€ auth/           # GitHub authentication
β”‚   β”œβ”€β”€ github/         # GitHub API client
β”‚   β”œβ”€β”€ leetcode/       # LeetCode API integration
β”‚   β”œβ”€β”€ storage/        # Extension storage management
β”‚   └── templates/      # README and commit templating
β”œβ”€β”€ styles/             # CSS stylesheets
└── tests/              # Test files

βš™οΈ Configuration

Templates

Customize how your commits and READMEs are generated:

Commit Message Template:

feat(leetcode): AC {{id}}. {{title}} [{{difficulty}}] ({{lang}}) β€” runtime: {{runtime}}, memory: {{memory}}

Available Variables:

  • {{id}} - Zero-padded problem ID (e.g., "0001")
  • {{title}} - Problem title
  • {{difficulty}} - Problem difficulty (easy/medium/hard)
  • {{lang}} - Programming language
  • {{runtime}} - Your solution's runtime
  • {{memory}} - Your solution's memory usage
  • {{link}} - LeetCode problem URL

πŸ”’ Security & Privacy

  • Fine-grained Personal Access Tokens for secure GitHub authentication
  • Minimal permissions - only repository access you grant
  • Encrypted token storage using browser secure storage APIs
  • No telemetry by default - you control what data is sent
  • Local processing - your code is processed locally before GitHub

πŸ§ͺ Testing

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Generate coverage report
npm run test:coverage

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Areas for Contribution

  • 🌐 Additional language support for syntax highlighting
  • πŸ” Enhanced LeetCode problem detection
  • πŸ“Š Statistics and analytics features
  • 🎨 UI/UX improvements
  • πŸ§ͺ Additional test coverage
  • πŸ“š Documentation improvements

πŸ“„ Legal Notes

LeetCode Terms of Service

By default, LeetShip does not include full problem statements in your GitHub commits to respect LeetCode's Terms of Service. The extension only includes:

  • Problem title and metadata
  • Link to the original problem
  • Your solution code
  • Your performance statistics

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

LeetShip is not affiliated with LeetCode or GitHub. This is an independent project designed to help developers organize their coding practice.

πŸ“Š Roadmap

  • Chrome Web Store publication
  • Firefox Add-ons publication
  • GitHub repository creation from extension
  • Advanced statistics and progress tracking
  • Multiple repository support
  • Team/organization repository support
  • Export functionality (JSON, CSV)
  • Problem difficulty progression analytics
  • Integration with other coding platforms

πŸ‘¨β€πŸ’» Creator

LeetShip is created by Yousef Dergham


Made with ❀️ by Yousef Dergham

Automatically sync your coding journey from LeetCode to GitHub

About

LeetShip is a cross-browser extension that detects when you submit an accepted solution on LeetCode and automatically commits it to your GitHub repository with clean structure, generated README files, and organized folders.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors