Skip to main content

Prerequisites

  • Docker 20.10+
  • Python 3.11+
  • Redis (optional, for production)
# Clone the repository
git clone https://github.com/nadoo-ai/sandbox.git
cd sandbox

# Copy environment file
cp .env.example .env

# Edit .env and set your API key
nano .env

# Start services
docker-compose up -d
Access the service:

Using Python Directly

# Install Poetry
curl -sSL https://install.python-poetry.org | python3 -

# Install dependencies
poetry install

# Set environment variables
export NADOO_SANDBOX_API_KEY="your-secure-api-key"
export NADOO_SANDBOX_REDIS_URL="redis://localhost:6379/2"

# Run the service
poetry run python -m src.main

Environment Variables

VariableRequiredDefaultDescription
NADOO_SANDBOX_API_KEYYes-API authentication key
NADOO_SANDBOX_SECRET_KEYYes-Secret key for encryption
NADOO_SANDBOX_REDIS_URLNo-Redis connection URL
NADOO_SANDBOX_PORTNo8002Service port
NADOO_SANDBOX_HOSTNo0.0.0.0Service host

Verify Installation

# Check health
curl http://localhost:8002/health

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

Next Steps

Quickstart

Run your first code execution