Website β’ Chrome Extension β’ Report Bug β’ Request Feature
LeetBuddy is a free, open-source Chrome extension that provides AI-powered assistance for LeetCode problems. It helps developers improve their coding interview skills by offering contextual hints, explanations, edge case generation, and an interactive whiteboard - all without leaving the LeetCode page.
- Learn, Don't Cheat: Get hints and guidance without spoiling the solution
- Context-Aware: Automatically understands the problem, your code, and your progress
- 100% Free: No paywalls, subscriptions, or hidden costs
- Open Source: Transparent, community-driven development
- Privacy-Focused: No tracking or data collection
- Natural Language Chat: Ask questions in plain English
- Context Detection: Automatically reads problem statements, constraints, and your code
- Streaming Responses: Real-time AI responses for better UX
- Progressive Hints: Get just enough help without revealing the solution
- Edge Case Generator: Discover test cases you might have missed
- Complexity Analysis: Understand time/space complexity of your approach
- Visual Diagrams: Draw trees, graphs, arrays, and data structures
- Image Recognition: AI analyzes your drawings to provide explanations
- Persistent Sessions: Chat history saved per problem
- Multiple Modes: Chat and Whiteboard interfaces
- Syntax Highlighting: Beautiful code rendering with Prism.js
- Markdown Support: Rich text formatting in responses
- Session Management: Conversations persist across page refreshes
LeetBuddy uses a microservices architecture with Docker containerization:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β NGINX (Port 80) β
β ββββββββββββββ¬βββββββββββββββββββ¬ββββββββββββββββββββββββ β
β β Static β /health β /api/LLM β β
β β Files β (Health Check) β (Extension API) β β
β ββββββββββββββ΄βββββββββββββββββββ΄ββββββββββββββββββββββββ β
ββββββββ¬ββββββββββββββββ¬βββββββββββββββββββββ¬ββββββββββββββββββ
β β β
βΌ βΌ βΌ
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Website β β Website β β Extension β
β Frontend β β Backend β β Backend β
β β β β β β
β React + Vite β β Express.js β β Express.js β
β TailwindCSS β β (Port 3001) β β (Port 3002) β
ββββββββββββββββ ββββββββββββββββ ββββββββ¬ββββββββ
β
βΌ
ββββββββββββββββ
β Redis β
β (Upstash) β
β β
β Chat Session β
β Management β
ββββββββββββββββ
β
βΌ
ββββββββββββββββ
β Google Geminiβ
β API β
β β
β AI Model β
ββββββββββββββββ
- Website Frontend: Marketing website built with React, Vite, and TailwindCSS
- Website Backend: Health checks and basic routing (Express.js)
- Extension Backend: LLM API endpoints with streaming support (Express.js)
- Chrome Extension: React-based extension with Chat and Whiteboard modes
- Redis: Session management for chat history (external via Upstash)
- NGINX: Reverse proxy and static file serving
Before you begin, ensure you have the following installed:
- Node.js 22.0.0 or higher (Download)
- Docker Desktop (Download)
- Google Chrome (Download)
- Git (Download)
-
Clone the repository
git clone https://github.com/LeetBuddyAI/LeetBuddy.git cd LeetBuddy -
Install dependencies
npm run install:all
This installs dependencies for:
- Root project
- Backend (
backend/) - Website frontend (
frontend/website/) - Extension frontend (
frontend/extension/)
-
Copy the environment template
cp .env.example .env
-
Configure environment variables
Edit
.envwith your settings:# Application Environment NODE_ENV=development PORT=10000 # Website Backend CHROME_EXTENSION_ORIGIN=chrome-extension://your-extension-id # Extension Backend GEMINI_API_KEY=your-gemini-api-key MODEL=gemini-2.5-flash INSTRUCTIONS="You are a helpful coding assistant for LeetCode problems." # Backend Ports (internal to container) WEBSITE_PORT=3001 EXTENSION_PORT=3002 # Redis Configuration (for extension chat sessions) REDIS_URL=your-redis-url # Frontend Environment Variables VITE_SITE_URL=https://leetbuddy.app VITE_VIDEO_URL=https://example.com/demo-video.mp4 VITE_CHROME_STORE_URL=https://chromewebstore.google.com/detail/nlemdecocfoaimdbfgpilfgdmcllhphn # Development NGINX Port NGINX_PORT=80
Required API Keys:
- GEMINI_API_KEY: Get your free API key from Google AI Studio
- REDIS_URL: Create a free Redis database at Upstash
npm run freshThis command will:
- Clean all dependencies and caches
- Reinstall all packages
- Rebuild Docker images from scratch
- Start all services
Access the application:
- Website: http://localhost
- Health Check: http://localhost/health
- Extension Backend: http://localhost/api/LLM
# Build and start services
docker-compose up --build
# Or run in detached mode
docker-compose up -d --build# Terminal 1 - Backend
npm run dev
# Terminal 2 - Website Frontend
npm run dev:website
# Terminal 3 - Extension Frontend
npm run dev:extension-
Build the extension:
npm run build:extension
-
Open Chrome and navigate to:
chrome://extensions/ -
Enable Developer mode (toggle in top right)
-
Click "Load unpacked"
-
Select the directory:
frontend/extension/dist/ -
The extension should now appear in your Chrome toolbar!
-
Navigate to any LeetCode problem and click the LeetBuddy icon
LeetBuddy/
βββ backend/
β βββ extension/ # Extension backend service
β β βββ controllers/ # Request handlers
β β βββ routes/ # API routes
β β βββ services/ # Business logic (LLM, Redis)
β βββ website/ # Website backend service
β β βββ controllers/ # Health check controllers
β β βββ routes/ # Health routes
β βββ shared/ # Shared utilities
β β βββ cors.js # CORS configuration
β β βββ errorHandlers.js # Error handling middleware
β β βββ logger.js # Logging utilities
β β βββ rateLimiter.js # Rate limiting
β β βββ redis.js # Redis client wrapper
β β βββ security.js # Helmet security config
β βββ index.js # Backend entry point
βββ frontend/
β βββ extension/ # Chrome extension
β β βββ public/ # Extension manifest & assets
β β βββ src/
β β βββ background/ # Background script
β β βββ components/ # React components
β β βββ tabs/ # Chat & Whiteboard tabs
β β βββ utils/ # Helper functions
β βββ website/ # Marketing website
β βββ src/
β βββ components/ # React components
β βββ pages/ # Page components
β βββ hooks/ # Custom React hooks
β βββ data/ # Static data & SEO
βββ nginx/
β βββ default.conf # Production nginx config
β βββ default.conf.dev # Development nginx config
βββ docker-compose.yml # Docker orchestration
βββ Dockerfile # Production Docker image
βββ Dockerfile.dev # Development Docker image
βββ render.yaml # Render.com deployment config
βββ .env # Environment variables
# Development
npm run dev # Start backend in development mode
npm run dev:website # Start website frontend dev server
npm run dev:extension # Start extension frontend dev server
# Building
npm run build # Build website frontend
npm run build:website # Build website frontend
npm run build:extension # Build extension frontend
npm run build:all # Build both frontends
# Installation
npm run install:all # Install all dependencies
npm run install:backend # Install backend dependencies only
npm run install:website # Install website frontend dependencies
npm run install:extension # Install extension frontend dependencies
# Cleaning
npm run clean # Remove node_modules, dist, lock files
npm run clean:modules # Remove all node_modules
npm run clean:dist # Remove all dist directories
npm run clean:locks # Remove all package-lock files
# Reset & Rebuild
npm run reset # Clean, reinstall, rebuild everything
npm run reset:hard # Hard reset with cache clean
npm run fresh # Hard reset + Docker rebuild (recommended)
npm run nuke # Nuclear option: delete everything
# Docker
npm run docker:clean # Remove Docker containers, volumes, images
npm run docker:reset # Clean Docker and rebuild from scratch
# Testing
npm test # Run tests (placeholder)cd backend
npm start # Start production server
npm run dev # Start with nodemon (auto-reload)
npm test # Run backend testscd frontend/website
npm run dev # Start Vite dev server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLintcd frontend/extension
npm run dev # Start Vite dev server with HMR
npm run build # Build for production (creates dist/)
npm run preview # Preview production build
npm run lint # Run ESLint- Framework: React 19
- Build Tool: Vite 6
- Styling: TailwindCSS 4
- Routing: React Router 7
- Icons: Lucide React
- SEO: Custom meta tags + JSON-LD structured data
- Framework: React 19
- Build Tool: Vite 6
- Styling: TailwindCSS 4
- Whiteboard: tldraw
- Markdown: react-markdown + remark-gfm
- Syntax Highlighting: Prism.js + prism-react-renderer
- Icons: React Icons
- State Management: React Context API
- UUID: uuid v11
- Runtime: Node.js 22+
- Framework: Express.js 5
- AI Model: Google Gemini 2.5 Flash (@google/genai)
- Database: Redis (ioredis) via Upstash
- Security:
- Helmet (security headers)
- CORS with origin validation
- Rate limiting (express-rate-limit)
- Utilities:
- Compression
- dotenv (environment variables)
- Custom error handlers
- Structured logging
- Containerization: Docker + Docker Compose
- Reverse Proxy: NGINX
- Deployment: Render.com
- CDN: Cloudflare (for production)
- External Services:
- Upstash Redis (session management)
- Google Gemini API (AI responses)
- Linting: ESLint 9
- Hot Reload: Vite HMR, Nodemon
- Environment Management: dotenv
The website and backend are deployed on Render.com with automatic deployment from the main branch.
-
Push to main branch
git push origin main
-
Render.com automatically:
- Detects changes
- Builds Docker image using
Dockerfile - Runs database migrations (if any)
- Deploys to production
- Runs health checks
- Configure Render service using
render.yaml - Set environment variables in Render dashboard (not synced from repo)
- Deploy manually from Render dashboard if needed
Set these in Render.com dashboard:
NODE_ENV=production
PORT=10000
REDIS_URL=<your-upstash-redis-url>
GEMINI_API_KEY=<your-gemini-key>
CHROME_EXTENSION_ORIGIN=chrome-extension://nlemdecocfoaimdbfgpilfgdmcllhphn
MODEL=gemini-2.5-flash
INSTRUCTIONS="<your-custom-instructions>"
VITE_SITE_URL=https://leetbuddy.app
VITE_VIDEO_URL=<your-cdn-video-url>
VITE_CHROME_STORE_URL=https://chromewebstore.google.com/detail/nlemdecocfoaimdbfgpilfgdmcllhphn-
Build the extension
npm run build:extension
-
Create distribution package
cd frontend/extension/dist zip -r ../extension.zip . cd ..
This creates
frontend/extension/extension.zip
Key settings in frontend/extension/public/manifest.json:
{
"manifest_version": 3,
"name": "LeetBuddy",
"version": "1.1.1",
"permissions": ["activeTab", "storage"],
"host_permissions": ["https://leetcode.com/*"],
"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self'"
}
}We welcome contributions from the community! Here's how you can help:
-
Fork the repository
git clone https://github.com/YOUR_USERNAME/LeetBuddy.git
-
Create a feature branch
git checkout -b feature/amazing-feature
-
Make your changes
- Follow existing code style
- Write meaningful commit messages
- Add comments for complex logic
- Update documentation if needed
-
Test your changes
npm run fresh # Full rebuild and test -
Commit your changes
git add . git commit -m "Add amazing feature"
-
Push to your fork
git push origin feature/amazing-feature
-
Open a Pull Request
- Go to the original repository
- Click "New Pull Request"
- Select your fork and branch
- Describe your changes in detail
- Code Quality: Write clean, maintainable code
- Documentation: Update README and code comments
- Testing: Test thoroughly before submitting
- Commits: Use clear, descriptive commit messages
- Issues: Check existing issues before creating new ones
- Respect: Be respectful and constructive in discussions
- π Bug Fixes: Fix bugs listed in Issues
- β¨ Features: Implement new features or improve existing ones
- π Documentation: Improve README, code comments, or guides
- π¨ UI/UX: Enhance design and user experience
- π§ͺ Testing: Add unit tests, integration tests, or E2E tests
- π Translations: Add support for multiple languages
- βΏ Accessibility: Improve accessibility features
- Use
npm run freshfor a clean rebuild when switching branches - Test the extension in Chrome before submitting PRs
- Check browser console for errors during development
- Use
npm run lintto catch style issues early
This project is licensed under the MIT License - see the LICENSE file for details.
β You can:
- Use this code commercially
- Modify the code
- Distribute the code
- Use it privately
- Sublicense the code
β You must:
- Include the original copyright notice
- Include a copy of the MIT License
β Limitations:
- The software is provided "as is", without warranty
- Authors are not liable for any damages
- Documentation: Start with this README
- Issues: GitHub Issues
- Email: leetbuddyrsfn@gmail.com
- Website: leetbuddy.app
When reporting bugs, please include:
- Description: What happened vs. what you expected
- Steps to Reproduce: Detailed steps to recreate the issue
- Environment:
- OS (Windows/macOS/Linux)
- Node.js version (
node --version) - Chrome version
- Extension version
- Screenshots: If applicable
- Error Messages: Console logs or error messages
We love hearing your ideas! When requesting features:
- Search existing requests to avoid duplicates
- Describe the feature in detail
- Explain the use case - why is this needed?
- Provide examples - how would it work?
- Google Gemini - AI model powering intelligent responses
- Upstash - Redis database for session management
- Render - Cloud hosting platform
- React - UI framework
- Vite - Build tool
- TailwindCSS - CSS framework
- tldraw - Whiteboard library
- Express.js - Backend framework
- Brian Manomaisupat - Frontend, Session management
- Lucian Cheng - Frontend, API use, Hosting
- Nicholas Jano - Backend, API use, Redis/Docker setup
- Nathan Chan - Frontend, Input forms
- Jay Liang - Marketing, Growth, QA
- The LeetCode community for inspiration
- All users who provide feedback and bug reports
- Open source contributors who make projects like this possible
Star this repo if you find it helpful! β
Website β’ Chrome Extension β’ GitHub