An enterprise-grade automation system that synchronizes, organizes, and documents your LeetCode solutions with comprehensive analytics and documentation.
Features β’ Setup β’ Usage β’ Documentation β’ Contributing β’ Contact
- Key Features
- System Architecture
- Project Structure
- Setup Guide
- Usage
- Documentation
- Solution Structure
- Tech Stack
- Contributing
- Analytics
- Roadmap
- Contact
- License
- Automated Synchronization: Daily automatic sync of your LeetCode solutions (my workflow will run at midnight (00:00) on the first day of every month. Modify for your own schedule)
- Smart Organization: Solutions categorized by difficulty and topics
- Comprehensive Documentation: Detailed README for each problem
- Multi-language Support: Handles solutions in various programming languages
- Performance Tracking: Runtime and memory usage statistics
- Version Control: Complete history of solution improvements
- GitHub Actions Integration: Automated workflow with manual trigger option
- Analytics Dashboard: Track your progress and improvements
- Custom Tagging: Organize solutions by patterns and techniques
graph TD
A[LeetCode API] -->|Fetch Solutions| B[Sync Service]
B -->|Process & Format| C[GitHub API]
C -->|Create/Update| D[Repository]
E[GitHub Actions] -->|Trigger| B
F[Manual Trigger] -->|Activate| E
D -->|Generate| G[Documentation]
D -->|Update| H[Analytics]
leetcode-solutions/
βββ π easy/
β βββ ####-problem-name/
β βββ README.md # Problem description & stats
β βββ solution.{ext} # Solution implementation
β βββ test_cases.json # Test cases and examples
βββ π medium/
βββ π hard/
βββ π .github/
β βββ workflows/
β βββ sync.yml # GitHub Actions workflow
βββ π scripts/
β βββ sync_leetcode.py # Main sync script
β βββ utils/ # Helper utilities
βββ π README.md # Main documentation
βββ π stats/ # Performance analytics
- GitHub Account with repository access
- LeetCode Account
- Python 3.10 or higher
- Git CLI
-
Repository Setup
# Clone the repository git clone https://github.com/thetoriqul/leetcode-solutions.git cd leetcode-solutions # Install dependencies pip install -r requirements.txt
-
Environment Configuration
# Create .env file cp .env.example .env # Add your configuration GH_PAT=your_github_token LEETCODE_SESSION=your_leetcode_session (Remeber, you have to regularly monitor the credentials) GITHUB_REPO=thetoriqul/leetcode-solutions
-
GitHub Secret Configuration
Navigate to:
Settings > Secrets and Variables > Actions
Required Secrets:
GH_PAT: your_github_personal_access_token LEETCODE_SESSION: your_leetcode_session_cookie (Remeber, you have to regularly monitor the credentials)
-
GitHub Personal Access Token Setup
- Visit:
Settings > Developer settings > Personal access tokens > Tokens (classic)
- Required Scopes:
- repo (Full control of private repositories) - workflow (Update GitHub Action workflows) - admin:org (Optional: For organization-level access)
- Visit:
-
LeetCode Session Token Retrieval
// Browser DevTools (F12) -> Console document.cookie.split(';').find(cookie => cookie.includes('LEETCODE_SESSION') ).split('=')[1]
Solutions are automatically synchronized at midnight (00:00) on the first day of every month.
- Visit the Actions tab
- Select "Sync LeetCode Solutions"
- Click "Run workflow"
- Select branch (default: main)
- Trigger the workflow
# Run sync script locally
python scripts/sync_leetcode.py --days 7 # Sync last 7 days
python scripts/sync_leetcode.py --all # Sync all solutions
Each solution includes:
# Problem Title
## Difficulty: [Easy/Medium/Hard]
## Topics: [Array, String, Dynamic Programming, etc.]
## Problem Description
[Detailed problem statement]
## Approach
- Time Complexity: O(n)
- Space Complexity: O(1)
[Detailed approach explanation]
## Solution Stats
| Metric | Value |
|---------|-------|
| Runtime | x ms |
| Memory | x MB |
| Date | YYYY-MM-DD |
## Code Implementation
[Solution with comments]
## Test Cases
[Example test cases]
- Python 3.10+: Core implementation
- GitHub Actions: Automation workflow
- Docker: Containerization (optional)
- PyGithub: GitHub API integration
- requests: HTTP client for LeetCode API
- python-dotenv: Environment management
- pytest: Testing framework
- black: Code formatting
- isort: Import sorting
- pre-commit: Git hooks
- flake8: Linting
- mypy: Type checking
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Commit your changes using conventional commits
git commit -m 'feat: add amazing feature'
- Push to your branch
git push origin feature/amazing-feature
- Open a Pull Request
feat: New feature
fix: Bug fix
docs: Documentation update
style: Code style update
refactor: Code refactoring
test: Test update
chore: Build tasks update
Track your LeetCode progress with built-in analytics:
- Solution success rate
- Runtime percentile
- Memory usage percentile
- Problem-solving patterns
- Time complexity distribution
- Language usage statistics
- Solution performance analytics dashboard
- Multiple language template support
- Automatic complexity analysis
- Integration with LeetCode contests
- Custom solution tagging system
- AI-powered solution suggestions
- Interactive learning paths
- Community contribution features
- Performance optimization tools
Connect with me:
- Portfolio: thetoriqul.com
- Email: [email protected]
- LinkedIn: thetoriqul
- GitHub: @TheToriqul
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ by TheToriqul