Intelligent AI-powered coding assistant for LeetCode problems with advanced features and beautiful UI
- π Features
- π¦ Installation
- π― Quick Start
- π¨ UI Features
- β¨οΈ Keyboard Shortcuts
- π§ Configuration
- π οΈ Development
- π€ Contributing
- π Security
- π Support
- π License
- π€ Smart Problem Explanation - Understand complex algorithms with AI-powered explanations
- π‘ Intelligent Solutions - Get optimized solutions in your preferred programming language
- π§ Thinking Approach - Learn multiple problem-solving strategies and approaches
- π Code Analysis - Analyze your code for errors, optimizations, and improvements
- π Minimize to Corner - Smart pin functionality with state preservation
- π±οΈ Drag & Drop - Fully draggable modal and minimized pin
- π One-Click Copy - Clean code copying with multiple fallback methods
- β¨οΈ Keyboard Shortcuts - Power user shortcuts for quick access
- π± Responsive Design - Works perfectly on all screen sizes
- π― Resizable Interface - Resize from any corner or edge
- π Secure API Integration - GROQ Llama 4 Scout 17B AI model integration
- πΎ State Preservation - Never lose your work with smart state management
- β‘ Performance Optimized - Lightweight and fast loading
- π‘οΈ Error Handling - Robust error handling with user-friendly messages
- π Debug Mode - Built-in debugging tools for development
- Visit the Chrome Web Store
- Search for "LeetCode AI Assistant"
- Click "Add to Chrome"
- Confirm installation
- Download or clone this repository
git clone https://github.com/byteom/leetcode-ai-assistant.git cd leetcode-ai-assistant
- Open Chrome and navigate to
chrome://extensions/
- Enable "Developer mode" in the top right
- Click "Load unpacked" and select the extension folder
- The extension icon should appear in your toolbar
- Click the extension icon in your Chrome toolbar
- Enter your GROQ API key in the welcome screen
- Click "Save" to store your credentials securely
- Go to any LeetCode problem page
- The extension will automatically detect the problem
- Click the extension icon or use keyboard shortcut
Ctrl+Shift+L
- π Explain Problem - Get detailed problem explanation
- π‘ Show Solution - Receive optimized code solutions
- π§ Thinking Approach - Learn problem-solving strategies
- π Analyze My Code - Get feedback on your code
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π€ AI Coding Assistant [π] [β‘] [Γ] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β [π Explain] [π‘ Solution] [π§ Thinking] [π Analyze] β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Response Area with Syntax Highlighting β β
β β [π Copy Code] [β Scroll to Top] β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββ
β π€ AI Assistant β
β Powered by GROQ β
βββββββββββββββββββββββ
Shortcut | Action |
---|---|
Ctrl+Shift+L |
Open/Close AI Assistant |
Ctrl+Shift+E |
Explain Problem |
Ctrl+Shift+S |
Show Solution |
Ctrl+Shift+T |
Thinking Approach |
Ctrl+Shift+A |
Analyze Code |
Esc |
Close Modal |
Ctrl+C |
Copy Code (when focused) |
The extension uses GROQ's Llama 4 Scout 17B model for AI responses. You'll need:
- GROQ API key (get it from console.groq.com)
- Valid API credentials
- Theme: Light/Dark mode support
- Language: Multiple programming language support
- Response Length: Configurable response detail level
- Auto-minimize: Automatic pinning behavior
leetcode-ai-assistant/
βββ manifest.json # Extension manifest
βββ background.js # Background script
βββ content.js # Content script (main logic)
βββ popup.js # Popup interface
βββ popup.html # Popup markup
βββ popup.css # Popup styles
βββ modal.css # Modal styles
βββ styles.css # Global styles
βββ welcome.html # Welcome screen
βββ welcome.js # Welcome logic
βββ icons/ # Extension icons
β βββ icon16.png
β βββ icon32.png
β βββ icon48.png
β βββ icon128.png
βββ README.md # Project documentation
βββ CONTRIBUTING.md # Contribution guidelines
βββ LICENSE # License file
βββ CHANGELOG.md # Version history
βββ CODE_OF_CONDUCT.md # Community standards
βββ SECURITY.md # Security policy
βββ SUPPORT.md # Support guide
- Modal Management: Creates and manages the AI assistant modal
- API Integration: Handles GROQ API communication
- UI Interactions: Manages drag, resize, and minimize functionality
- State Management: Preserves user state and responses
- Code Processing: Handles code extraction and formatting
- Extension Lifecycle: Manages extension startup and shutdown
- API Key Storage: Securely stores user credentials
- Message Handling: Coordinates between popup and content scripts
- Welcome Screen: API key setup and configuration
- Status Display: Shows connection status and settings
- Quick Actions: Direct access to common functions
async function callGROQAPI(prompt, apiKey) {
const response = await fetch('https://api.groq.com/openai/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'meta-llama/llama-4-scout-17b-16e-instruct',
messages: [{ role: 'user', content: prompt }],
temperature: 0.7,
max_tokens: 2000
})
});
return response.json();
}
function showAssistantModal() {
// Creates modal with modern UI
// Handles state preservation
// Sets up event listeners
}
function minimizeToCorner(modal) {
// Minimizes modal to compact pin
// Preserves current state
// Makes pin draggable
}
function setupCopyButtons() {
// Adds copy buttons to code blocks
// Handles multiple copy methods
// Provides visual feedback
}
- Gradient Backgrounds: Beautiful color transitions
- Glass Morphism: Translucent effects with backdrop blur
- Smooth Animations: 300ms transitions for all interactions
- Responsive Layout: Adapts to different screen sizes
- Accessibility: High contrast and keyboard navigation
/* Primary Colors */
--primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
--secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
--accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
/* Status Colors */
--success: #4CAF50;
--error: #F44336;
--warning: #FF9800;
--info: #2196F3;
- Font Family: System fonts with fallbacks
- Font Sizes: Responsive scaling (14px - 24px)
- Line Height: 1.6 for optimal readability
- Font Weights: 400 (normal), 600 (semibold), 700 (bold)
We welcome contributions from the community! This project thrives on collaboration and we appreciate all forms of contributions.
- π Bug Reports: Help us identify and fix issues
- π‘ Feature Requests: Suggest new features and improvements
- π Documentation: Improve guides and documentation
- π¨ UI/UX: Enhance the user interface and experience
- π§ Code: Submit pull requests with improvements
- π§ͺ Testing: Help test features and report issues
- π Community: Help other users and spread the word
-
Fork the repository
git clone https://github.com/byteom/leetcode-ai-assistant.git cd leetcode-ai-assistant
-
Set up development environment
- Load the extension in Chrome developer mode
- Test on LeetCode problem pages
- Check browser console for debugging
-
Make your changes
- Follow our coding standards
- Test thoroughly
- Update documentation if needed
-
Submit your contribution
- Create a pull request
- Follow our PR template
- Wait for review and feedback
- Code Style: Follow existing code patterns and conventions
- Testing: Test on multiple browsers and LeetCode pages
- Documentation: Update docs for new features
- Communication: Be respectful and constructive
- Licensing: All contributions are licensed under the same terms
For comprehensive contribution guidelines, please see:
- CONTRIBUTING.md - Detailed contribution process
- CODE_OF_CONDUCT.md - Community standards
- SECURITY.md - Security reporting procedures
We take security seriously and appreciate security researchers who help us maintain a secure codebase.
- Secure API Communication: All API calls use HTTPS
- Input Validation: All user inputs are validated and sanitized
- No Data Collection: Extension doesn't collect personal data
- Local Storage: API keys stored securely in browser storage
- Error Handling: Secure error handling prevents information disclosure
Please do NOT report security vulnerabilities through public GitHub issues.
Instead, please report them privately:
- Email: security@example.com
- Subject:
[SECURITY] LeetCode AI Assistant Vulnerability Report
- Response Time: We aim to respond within 48 hours
For detailed security information, see SECURITY.md.
We're here to help! Here are the best ways to get support:
- π Check Documentation: Start with this README and SUPPORT.md
- π Search Issues: Check existing GitHub issues for solutions
- π Report Bugs: Create a new issue with detailed information
- π‘ Request Features: Suggest new features through GitHub issues
- π§ Contact Us: Reach out for direct support
- SUPPORT.md - Comprehensive support guide
- GitHub Issues - Bug reports and feature requests
- GitHub Discussions - Community discussions
- Wiki - Additional documentation
- Extension not loading: Check developer mode and file permissions
- API key issues: Verify GROQ API key and credits
- Modal not appearing: Ensure you're on a LeetCode problem page
- Copy function not working: Check browser clipboard permissions
For detailed troubleshooting, see SUPPORT.md.
This project is licensed under the Advanced Non-Commercial License - see the LICENSE file for details.
β Permitted:
- Personal and educational use
- Contributing to the project
- Forking for personal use
- Modifying for personal use
β Prohibited:
- Commercial use or distribution
- Selling the software or derivatives
- Using in commercial products
- Removing license terms
For complete license terms, see LICENSE.
- GROQ for providing the AI API and Llama 4 Scout 17B model
- LeetCode for the problem platform and community
- Chrome Extensions Team for the extension framework
- Open Source Community for inspiration, tools, and contributions
- All Contributors who help improve this project
- π Documentation
- π Report Bug
- π‘ Request Feature
- π€ Contribute
- π Security
- π Support
- π License
- π Changelog