Sandbox

Sandbox

Local development workflow for the transcript service sandbox.

The sandbox emulates AWS services with LocalStack while still using real ElevenLabs and Bedrock APIs. Use non-production credentials and test audio only.

Prerequisites

  • Docker and Docker Compose.
  • Node.js 20+ and pnpm.
  • AWS credentials with Bedrock access.
  • ElevenLabs API key.

Configure Credentials

cp .sandbox/.env.example .sandbox/.env

Set at least:

AWS_PROFILE=ontopix-dev
ELEVENLABS_API_KEY=sk_...

Optional Bedrock model overrides are documented in .sandbox/.env.example.

Start the Sandbox

task sandbox:start

This builds Lambda bundles, starts LocalStack, provisions local AWS resources, and runs the local orchestrator in the background.

Run the orchestrator in the foreground when debugging state transitions:

task sandbox:orchestrator

Submit a Request

API_URL=$(cat .sandbox/.api-url)

curl "${API_URL}/v1/health"

curl -X POST "${API_URL}/v1/transcripts" \
  -H "Content-Type: application/json" \
  -d '{
    "callback": {
      "url": "https://webhook.site/your-id",
      "events": ["completed", "failed"]
    },
    "metadata": { "test": true },
    "idempotencyKey": "test-001",
    "payload": {
      "input": {
        "audio_url": "https://example.com/audio.mp3"
      },
      "config": {
        "language": "es"
      }
    }
  }'

Check status with the returned job id:

curl "${API_URL}/v1/transcripts/{jobId}"

Useful Tasks

TaskPurpose
task sandbox:startStart LocalStack, provision resources, and run the orchestrator.
task sandbox:stopStop the sandbox.
task sandbox:restartRestart the sandbox.
task sandbox:statusShow sandbox container state.
task sandbox:setupRecreate local AWS resources.
task sandbox:healthCheck local API health.
task sandbox:make-requestSubmit a transcript job using task defaults.
task sandbox:jobRead a job status by JOB_ID.
task sandbox:debug:logsTail LocalStack logs.
task sandbox:debug:artifactsDownload S3 artifacts for a job into .sandbox/debug/{jobId}/.
task sandbox:resetStop, clean volumes, and restart from a clean state.

Sandbox vs Production

AspectProductionSandbox
OrchestrationAWS Step FunctionsLocal polling orchestrator
AWS servicesReal AWSLocalStack
AuthenticationIAM SigV4None
External APIsReal ElevenLabs and BedrockReal ElevenLabs and Bedrock
ExecutionStep Functions state machineLocal sequential orchestration