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 β
ββββββββββββββββ
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- 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