A modern web-based IDE and code review tool with Docker-powered sandboxing, AI assistance, and real-time collaboration features.
- Frontend: React 18, Vite, Monaco Editor, Socket.IO Client
- Backend: Node.js, Express.js, Socket.IO
- Containerization: Docker (isolated sandbox environments)
- AI Integration: Groq API (Llama 3.1)
- Code Execution: PISTON API
- Styling: CSS3
Before you begin, ensure you have the following installed:
- Node.js (version 16 or higher)
- npm (comes with Node.js)
- Docker Desktop (required for sandboxing)
- Git
- VS Code (recommended)
- Fork this repository by clicking the "Fork" button at the top right
- Clone your forked repository:
git clone https://github.com/YOUR_USERNAME/codeReviewBuddy.git cd codeReviewBuddy
cd codeReviewBuddyInstall frontend dependencies:
npm installInstall backend dependencies:
cd backend
npm install
cd ..Start Docker Desktop and ensure it's running
Build the sandbox image:
cd backend docker build -t code-sandbox:latest .
Get your Groq API key (optional - mock AI works without it):
- Visit Groq Console
- Sign up/Login and create a new API key
Create environment file:
cd backend touch .envAdd your API key to
backend/.env:# For real AI (optional)GROQ_API_KEY=your_actual_api_key_hereUSE_MOCK_AI=false# For mock AI (works without API key)USE_MOCK_AI=true
From the root directory:
npm startThis will start both frontend (http://localhost:5173) and backend (http://localhost:3001) servers.
npm run devnpm run server# Terminal 1 - Frontend
npm run dev
# Terminal 2 - Backendcd backend
npm run dev- Each user session gets a dedicated Docker container
- Complete isolation from host system
- Pre-installed with Python, Node.js, Java, C++, and development tools
- Automatic cleanup when session ends
- Process Isolation: Container processes can't affect host
- Filesystem Isolation: No access to host files
- Network Isolation: Controlled network access
- Resource Limits: CPU and memory quotas enforced
- User Isolation: Runs as non-root user in container
codeReviewBuddy/
├── codeReviewBuddy/
│ ├── src/ # React frontend source
│ │ ├── components/ # React components
│ │ ├── assets/ # Static assets
│ │ └── ...
│ ├── backend/ # Node.js backend
│ │ ├── controllers/ # API controllers
│ │ ├── routes/ # API routes
│ │ ├── .env # Environment variables (not in git)
│ │ └── server.js # Main server file
│ ├── public/ # Public assets
│ └── package.json # Frontend dependencies
└── README.md
| Command | Description |
|---|---|
npm start | Start both frontend and backend |
npm run dev | Start frontend development server |
npm run server | Start backend development server |
npm run build | Build frontend for production |
npm run lint | Run ESLint |
Install recommended extensions:
- ES7+ React/Redux/React-Native snippets
- Prettier - Code formatter
- ESLint
Open project in VS Code:
code .
- Docker-powered sandboxing - Complete isolation from host system
- Multi-language support - Python, JavaScript, Java, C++, C, HTML, CSS
- Real-time file synchronization - Changes in terminal instantly appear in file explorer
- Integrated terminal - Full bash/PowerShell access within container
- Intelligent code review - Groq API with Llama 3.1 model
- Interactive AI chat - Context-aware conversations about your code
- Code suggestions - Real-time improvement recommendations
- Mock AI fallback - Works without API key for testing
- Monaco Editor - VS Code-like editing experience
- Multi-file support - Tabbed interface with file explorer
- Syntax highlighting - Support for multiple programming languages
- Code execution - Run code safely via PISTON API
- Real-time collaboration - Socket.IO powered live updates
- VS Code-inspired design - Familiar interface for developers
- Responsive layout - Works on desktop and tablet devices
- Dark theme - Easy on the eyes for long coding sessions
- Status bar - Real-time information about active file and system status
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is open source and available under the MIT License.
Port already in use:
# Kill process on port 3001 (backend)
npx kill-port 3001
# Kill process on port 5173 (frontend)
npx kill-port 5173Dependencies issues:
# Clear npm cache
npm cache clean --force
# Delete node_modules and reinstall
rm -rf node_modules package-lock.json
npm installEnvironment variables not loading:
- Ensure
.envfile is in thebackend/directory - Check that your API key is valid
- Restart the backend server after changing
.env
Docker not running:
# Check Docker status
docker --version
docker psContainer build fails:
# Clean Docker cache and rebuild
docker system prune -f
cd backend
docker build -t code-sandbox:latest .Permission issues (Linux/Mac):
# Add user to docker group
sudo usermod -aG docker $USER# Logout and login againContainer cleanup:
# Remove all containers
docker container prune -f
# Remove sandbox image
docker rmi code-sandbox:latest# Production settingsNODE_ENV=productionPORT=3000GROQ_API_KEY=your_production_api_keyUSE_MOCK_AI=false# Docker settingsDOCKER_HOST=unix:///var/run/docker.sockCONTAINER_MEMORY_LIMIT=512mCONTAINER_CPU_LIMIT=0.5- Run Docker daemon in rootless mode
- Use container resource limits
- Implement session timeouts
- Monitor container usage
- Regular security updates
If you encounter any issues:
- Check Docker Desktop is running
- Verify all dependencies are installed
- Check the Issues page
- Create a new issue with:
- Error messages
- Docker version (
docker --version) - Node.js version (
node --version) - Steps to reproduce
Built with ❤️ for developers who value security and productivity
Happy coding in your secure sandbox! 🎉🐳