Skip to content

Repository files navigation

DebugVerse

AI-powered code debugger & sandboxed executor — built for developers, by developers.

Python FastAPI React Docker Gemini AI License

Live Demo · Report Bug · Request Feature


What is DebugVerse?

DebugVerse is a full-stack AI debugging platform where you paste your code, and it instantly:

  • Analyzes it using Google Gemini 2.0 Flash for errors, anti-patterns, and best practices
  • Executes it inside an isolated Docker sandbox — safely, with no network access and a 10-second timeout

Supports Python, JavaScript, Java, C++, and C.


Features

Feature Description
🤖 AI Debugging Powered by Gemini 2.0 Flash — finds bugs and suggests fixes
▶ Code Execution Runs code in a Docker sandbox with zero network access
🛡️ Secure Sandbox Non-root user, isolated container, execution timeout
📝 Monaco Editor VS Code-quality editor with syntax highlighting
🕒 Session History Remembers your last 10 debug sessions per browser tab
📱 Responsive UI Works on desktop, tablet, and mobile

Architecture

Browser (React + Monaco Editor)
        │
        │  HTTP (axios)
        ▼
FastAPI Backend (Python)
   ├── /debug  ──► Google Gemini API  ──► AI debug response
   └── /execute ──► Docker Sandbox
                        └── ubuntu:22.04 (gcc, g++, python3, node, java)
                             runs code with --network none, 10s timeout

Tech Stack

Backend

Frontend

  • React 19 with React Router
  • Monaco Editor — the engine behind VS Code
  • Axios
  • Vanilla CSS with CSS custom properties (glassmorphism design)

Getting Started

Prerequisites

  • Node.js 18+ and npm
  • Python 3.10+
  • Docker (for code execution)

1. Clone the repository

git clone https://github.com/bhola-dev58/DebugVerse.git
cd DebugVerse

2. Set up environment variables

Create a .env file inside the backend/ directory:

# backend/.env
GEMINI_API_KEY=your_api_key_here

Get your free API key at aistudio.google.com.

3. Build the Docker sandbox

The code execution feature requires a local Docker image:

cd backend/sandbox
chmod +x build.sh
./build.sh
cd ../..

4. Install dependencies & run

chmod +x setup.sh run.sh
./setup.sh   # installs Python venv + frontend node_modules
./run.sh     # starts both servers concurrently
Service URL
Frontend http://localhost:3000
Backend API http://localhost:8000
API Docs http://localhost:8000/docs

Stopping the servers

chmod +x kill_ports.sh
./kill_ports.sh

Project Structure

DebugVerse/
├── backend/
│   ├── sandbox/
│   │   ├── Dockerfile      # Ubuntu sandbox with gcc, g++, python3, node, java
│   │   └── build.sh        # Builds the debugverse-sandbox Docker image
│   ├── .env                # API keys (not committed to git)
│   └── main.py             # FastAPI app — /debug and /execute endpoints
├── frontend/
│   └── src/
│       ├── components/
│       │   └── CodeEditor.js   # Monaco editor + debug/run UI
│       ├── pages/
│       │   └── AboutUs.js      # About page
│       ├── App.js              # Router + landing page
│       ├── App.css             # Component styles
│       └── index.css           # Global design tokens + theme
├── setup.sh                # One-command dependency installer
├── run.sh                  # Starts backend + frontend concurrently
├── kill_ports.sh           # Stops servers and cleans logs
└── requirements.txt        # Python dependencies

API Reference

POST /debug

Analyze code for bugs and best practices using Gemini AI.

Request:  { "code": "string", "language": "python" }
Response: { "debug_response": "<html>...", "status": "success" }

POST /execute

Execute code inside the Docker sandbox.

Request:  { "code": "string", "language": "python" }
Response: { "output": "Hello World\n", "status": "success" }

Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you'd like to change.


📄 License

This project is licensed under the MIT License.


About

DebugVerse is a full-stack AI-based code debugger that detects, analyzes, and suggests fixes for code errors in real-time using intelligent algorithms. [AI-Based AI Code Debugger – Suggests fixes for coding errors.]

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages