Skip to main content

Overview

Nadoo Sandbox is a secure code execution service that runs user code in isolated Docker containers. It supports 12+ programming languages with built-in resource limits and security controls.

Key Features

Multi-Language Support

Execute code in Python, JavaScript, TypeScript, Java, Go, Rust, C++, C#, Ruby, PHP, SQL, and Bash

Secure Isolation

All code runs in isolated Docker containers with resource limits

Async Execution

Support for both synchronous and asynchronous code execution

Rate Limiting

Built-in rate limiting to prevent abuse

Architecture

┌─────────────────┐
│   API Gateway   │
└────────┬────────┘

┌────────▼────────┐
│  FastAPI App    │
├─────────────────┤
│ - Execute API   │
│ - Health Check  │
│ - Metrics       │
└────────┬────────┘

┌────────▼────────┐
│ Docker Manager  │
├─────────────────┤
│ - Container     │
│   Creation      │
│ - Code Exec     │
│ - Cleanup       │
└────────┬────────┘

┌────────▼────────┐
│ Docker Daemon   │
└─────────────────┘

Use Cases

  • Online Code Editors: Run user code safely
  • Automated Testing: Execute test suites in isolated environments
  • Educational Platforms: Provide safe coding environments for students
  • AI Coding Assistants: Execute AI-generated code securely

Quick Example

curl -X POST http://localhost:8002/api/v1/execute \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "print(\"Hello, Sandbox!\")",
    "language": "python"
  }'

Next Steps