An AI-Powered LeetCode Buddy for Smart Code Testing
LeetBud is your intelligent assistant for LeetCode-style coding. Itβs an AI-driven single-page application (SPA) that helps you parse, test, and auto-generate test cases for your solutions in Python and C++. Built with React (TypeScript), FastAPI, and powered by Groq's Generative AI, LeetBud takes the manual work out of debugging and testing your code.
-
Generate 5 intelligent test cases at a time using Groq:
- Includes boundary conditions and edge cases
- Saves time and ensures deeper testing coverage
-
Works with both Python and C++ code
- Parses your
Solutionclass and identifies the last function - Automatically extracts input parameters for test case setup
-
Add and edit test cases easily:
- Rename (default:
New TestCase) - Customize inputs and expected outputs
- Rename (default:
-
Add as many test cases as needed
- Backend adds necessary headers and wraps your code in a
mainfunction - Automatically runs all test cases and displays results
- Consistent handling for both supported languages
- Frontend: React + TypeScript
- Backend: FastAPI (Python)
- AI Integration: Groq (Generative Test Case Logic)
- Languages Supported: Python & C++
- Paste Your Code: A valid LeetCode-style
Solutionclass. - AI Parses It: The last method is detected, and parameters are extracted.
- Add Test Cases: Manually or with AI-generated cases via Groq.
- Click "Run": Backend wraps your code with boilerplate and runs the tests.
git clone https://github.com/DebdipWritesCode/LeetBud.git
cd LeetBudcd frontend
npm install
npm run devcd ../backend
python -m venv venv
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activate
pip install -r requirements.txt
uvicorn app:app --reloadJDOODLE_CLIENT_ID=your_jdoodle_client_id
JDOODLE_CLIENT_SECRET=your_jdoodle_client_secret
GROQ_API_KEY=your_groq_api_keyVITE_BACKEND_URL=http://localhost:8000
β οΈ Make sure your.envfiles are not committed to version control.
We welcome contributions! You can:
- Add support for more languages
- Improve UI/UX
- Enhance Groq prompt engineering for even better test cases
Fork, branch, and submit a PR β weβd love your help.
