AI-Powered Competitive Programming Environment
Generate intelligent test cases, execute code securely, and evaluate solutions—all in a stunning holographic interface.
Powered by Google Gemini 2.5 Flash/Pro with thinking mode:
- Model Selection: Choose between Flash (fast & reliable) or Pro (more capable)
- Basic test cases for common scenarios (likely to pass with correct logic)
- Comprehensive test cases with all major edge cases
- Custom question naming for organized sessions
- Automatic time/memory limit recommendations
- Smart error handling with model switching suggestions
Get help without leaving the editor:
- Model Selection: Choose between Gemini 2.5 Flash (fast) or 2.5 Pro (more capable)
- Syntax-Highlighted Code Blocks: AI responses with code are beautifully formatted
- Interactive Code Actions: Hover over code blocks to Copy or Replace your editor code
- Smart Error Handling: Automatic suggestions to switch models if quota exceeded
- Persistent chat history across sessions
- Full conversation context maintained
- Ask for hints, explanations, or solutions
- Quick action buttons: "Ask for Hint", "Get Solution", "Chat"
- Contextual awareness of your code and problem
Choose your execution environment:
- ☁️ Cloud Mode (Judge0 API): Works everywhere, no setup needed
- 🖥️ Local Mode: Run on your machine (requires gcc/g++/python3/java)
- Automatic fallback and error handling
- Seamless switching between modes
Comprehensive test case evaluation:
- Flexible output comparison (handles whitespace variations like C's scanf)
- Status tracking: Passed ✅, Wrong Answer ❌
- Total execution time tracking with optimization suggestions
- Interactive expandable test cards with diff views
- Filter by status (All/Passed/Failed)
- Circular progress visualization
Never lose your work:
- Automatic localStorage-based persistence
- Multiple sessions with quick switching
- Auto-save on every change
- Chat history saved per session
- Last active session restored on reload
- Works offline, no database needed
Track your practice time:
- Built-in timer with presets (5/15/30/60 min) or custom duration
- Stopwatch for open-ended practice
- Compact dropdown design
- State persists across page reloads
Immersive, distraction-free interface:
- Dynamic particle system with cursor spotlight
- Glassmorphism panels with neon accents (Cyan/Magenta/Lime)
- Monaco Editor (VS Code's editor)
- Smooth Framer Motion animations
- Responsive three-panel layout
- Node.js 18+
- Google Gemini API Key
- Judge0 API Key (via RapidAPI)
# Clone the repository
git clone https://github.com/yourusername/codecrush.git
cd codecrush
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env.localEdit .env.local:
GEMINI_API_KEY=your_gemini_api_key_here
JUDGE0_API_KEY=your_judge0_api_key_here
JUDGE0_API_HOST=judge0-ce.p.rapidapi.com# Run development server
npm run devOpen http://localhost:3000 in your browser.
- Framework: Next.js 14 (App Router) with TypeScript
- Styling: Tailwind CSS
- Animations: Framer Motion
- Code Editor: Monaco Editor (VS Code's editor)
- AI: Google Gemini 2.5 Flash/Pro (with thinking mode & chat)
- Code Execution:
- Cloud: Judge0 API (RapidAPI)
- Local: Native compilers (gcc/g++/python3/java)
- Storage: Browser localStorage (no database needed)
- Markdown Rendering: react-markdown with react-syntax-highlighter
- Code Highlighting: Prism with VS Code Dark Plus theme
- Clone and install (see Quick Start above)
- Add your API keys to
.env.local - Run
npm run dev - Your browser will automatically create a new session on first visit
- Select AI Model → Choose Flash (fast) or Pro (powerful) from top-right dropdown
- Name Your Problem → Enter problem description, name it when generating test cases
- Generate Test Cases → Choose Basic or Comprehensive complexity
- Write Code → Use Monaco editor with C/C++/Python/Java support
- Execute → Toggle Cloud ☁️ or Local 🖥️ mode, then Run or Evaluate
- Get Help → Click Help tab or any chat button to open AI assistant
- Hover over AI code responses to Copy or Replace your code
- Track Time → Use timer/stopwatch to monitor your practice
- Click hamburger menu (☰) to view all sessions
- Click "+ New Problem" to start fresh
- Sessions auto-save every change
- Switch between sessions anytime
- Delete old sessions with 🗑️ button
When the AI generates code in chat:
- Syntax Highlighting: Automatic language detection with line numbers
- Copy Button: Click to copy code to clipboard (shows ✓ confirmation)
- Replace Button: Directly replace your editor code with AI's suggestion
- Language Badge: Shows detected language in top-left corner
- Buttons appear on hover at top-right of code block
- Black background with neon cyan borders for clarity
- Everything is stored locally in your browser (localStorage)
- No server-side database needed
- Works offline once loaded
- Data persists across browser restarts
- Each browser/device has its own separate data
- Push your code to GitHub
- Visit vercel.com and import your repository
- Add environment variables:
GEMINI_API_KEYJUDGE0_API_KEYJUDGE0_API_HOST
- Deploy!
Vercel will automatically detect Next.js and configure the build settings.
MIT License - feel free to use this project for learning or personal use.
Made with 💙 by Yash
Crush your coding challenges, one test case at a time.