Skip to main content
Normalized for Mintlify from knowledge-base/aiconnected-apps-and-modules/modules/aiConnected-voice/dev-env-setup-guide.mdx.

Voice by aiConnected — Development Environment Setup Guide \

Document Information \


Table of Contents \

Voice by aiConnected — Development Environment Setup Guide Document Information Table of Contents 1. Introduction 1.1 Purpose 1.2 Scope 1.3 Time Estimate 2. Prerequisites 2.1 Required Knowledge 2.2 Required Accounts 2.3 Required Software 3. System Requirements 3.1 Hardware Requirements Minimum Specifications Recommended Specifications 3.2 Network Requirements 3.3 Operating System Specific Notes macOS Ubuntu/Debian Windows (WSL2) 4. Development Tools Installation 4.1 Docker Installation macOS Ubuntu 4.2 Python Installation Install pyenv Install Python 4.3 Node.js Installation (Optional) 4.4 Additional Tools 4.5 Python Development Tools 5. Repository Setup 5.1 Clone the Repository 5.2 Repository Structure 5.3 Create Python Virtual Environment 5.4 Install Service Dependencies 6. Docker Compose Stack 6.1 Stack Overview 6.2 Docker Compose Configuration 6.3 LiveKit Configuration 6.4 PostgreSQL Initialization Scripts 6.5 Starting the Stack 7. Environment Variables 7.1 Environment File Setup 7.2 Complete Environment Variables Reference 7.3 Environment Variable Validation 8. API Credentials 8.1 Obtaining GoToConnect Credentials 8.2 Obtaining LiveKit Credentials Option A: Local Development (No credentials needed) Option B: LiveKit Cloud (For integration testing) 8.3 Obtaining Deepgram Credentials 8.4 Obtaining Anthropic Credentials 8.5 RunPod Setup (For Chatterbox TTS) 8.6 Using Mock Services 9. Database Setup 9.1 Verify Database Connection 9.2 Run Database Migrations 9.3 Seed Development Data 9.4 Verify Database Schema 9.5 Database Management UI 10. Service Configuration 10.1 API Gateway Configuration 10.2 WebRTC Bridge Configuration 10.3 Agent Service Configuration 10.4 Worker Service Configuration 11. Running the Development Stack 11.1 Start Infrastructure Services 11.2 Start Application Services 11.3 Using the Start Script 11.4 Verify Services Are Running 11.5 Stopping Services 12. Testing Your Setup 12.1 Run Unit Tests 12.2 Run Integration Tests 12.3 Test API Endpoints 12.4 Test WebRTC Connection 12.5 Test End-to-End Flow 12.6 Health Check Script 13. IDE Configuration 13.1 VS Code Setup Recommended Extensions Workspace Settings Launch Configuration 13.2 PyCharm Setup Project Interpreter Run Configurations 13.3 Git Configuration 14. Troubleshooting 14.1 Common Issues Docker Issues Database Issues Python Environment Issues Service Connection Issues WebRTC Issues 14.2 Debug Mode 14.3 Useful Debug Commands 14.4 Getting Help 15. Appendix 15.1 Quick Reference Card 15.2 Environment Variables Cheat Sheet 15.3 Port Reference 15.4 Useful Aliases Document Revision History

  1. Introduction \

1.1 Purpose \

This document provides step-by-step instructions for setting up a local development environment for Voice by aiConnected. A properly configured development environment enables developers to:
  • Run and test all platform services locally
  • Debug issues without affecting production systems
  • Develop new features with rapid iteration cycles
  • Execute the full test suite before committing changes

1.2 Scope \

This guide covers:
  • Installing required software and dependencies
  • Configuring the local Docker Compose stack
  • Setting up environment variables and credentials
  • Running and testing all services locally
  • IDE configuration for optimal development experience
This guide does not cover:
  • Production deployment (see Document #25: Deployment Runbook)
  • CI/CD pipeline setup (see Document #26: CI/CD Pipeline Specification)
  • Infrastructure provisioning (see Document #24: Infrastructure Architecture)

1.3 Time Estimate \

A complete setup from scratch typically takes 30-60 minutes, depending on internet speed and familiarity with the tools.

  1. Prerequisites \

2.1 Required Knowledge \

Before proceeding, you should be familiar with:
  • Basic command line operations (bash/zsh)
  • Git version control
  • Docker and containerization concepts
  • Python virtual environments
  • Basic understanding of WebRTC and real-time audio (helpful but not required)

2.2 Required Accounts \

You will need accounts for the following services: Note: For initial development, you can use mock services for most external APIs. Real credentials are only required for integration testing.

2.3 Required Software \


  1. System Requirements \

3.1 Hardware Requirements \

Minimum Specifications \

3.2 Network Requirements \

The development environment requires access to:

3.3 Operating System Specific Notes \

macOS \

Ubuntu/Debian \

Windows (WSL2) \


  1. Development Tools Installation \

4.1 Docker Installation \

macOS \

Ubuntu \

4.2 Python Installation \

We recommend using pyenv for Python version management.

Install pyenv \

Install Python \

4.3 Node.js Installation (Optional) \

Required only if working on the admin dashboard.

4.4 Additional Tools \

4.5 Python Development Tools \


  1. Repository Setup \

5.1 Clone the Repository \

5.2 Repository Structure \

After cloning, you should see the following structure:

5.3 Create Python Virtual Environment \

5.4 Install Service Dependencies \

Each service has its own dependencies. Install them all:

  1. Docker Compose Stack \

6.1 Stack Overview \

The local development stack includes the following services:

6.2 Docker Compose Configuration \

Create or verify infrastructure/docker-compose.yml:

6.3 LiveKit Configuration \

Create infrastructure/livekit/livekit.yaml:

6.4 PostgreSQL Initialization Scripts \

Create infrastructure/init-scripts/postgres/01-init.sql:

6.5 Starting the Stack \


  1. Environment Variables \

7.1 Environment File Setup \

Copy the example environment file and customize it:

7.2 Complete Environment Variables Reference \

7.3 Environment Variable Validation \

Create a validation script to ensure all required variables are set:
Run validation:

  1. API Credentials \

8.1 Obtaining GoToConnect Credentials \

  1. Create a Developer Account
  2. Create an Application
    • Navigate to “My Apps” in the developer portal
    • Click “Create New App”
    • Fill in application details:
      • App Name: Voice AI Development
      • App Type: Server Application
      • Redirect URI: http://localhost:8000/oauth/goto/callback
    • Select required scopes:
      • calls.v2.calls.manage
      • calls.v2.calls.read
      • messaging.v1.notifications.manage
      • webrtc.v1.devices.manage
      • webrtc.v1.calls.manage
  3. Copy Credentials
    • Note your Client ID and Client Secret
    • Add to .env:
  1. Enable Sandbox Mode
    • In the developer portal, enable sandbox/test mode
    • This allows testing without using real phone minutes

8.2 Obtaining LiveKit Credentials \

The Docker Compose stack includes a local LiveKit server. Use these values:
  1. Create Account
  2. Create a Project
    • Click “Create Project”
    • Name it “voice-ai-dev”
    • Select a region close to you
  3. Get Credentials
    • Navigate to Settings → API Keys
    • Create a new API key
    • Copy the API Key and Secret
    • Update .env:

8.3 Obtaining Deepgram Credentials \

  1. Create Account
  2. Create API Key
    • Navigate to API Keys
    • Click “Create Key”
    • Name: “Voice AI Development”
    • Permissions: Full Access (for development)
    • Copy the key
  3. Add to Environment

8.4 Obtaining Anthropic Credentials \

  1. Create Account
  2. Create API Key
    • Navigate to API Keys
    • Click “Create Key”
    • Name: “Voice AI Development”
    • Copy the key
  3. Add to Environment

8.5 RunPod Setup (For Chatterbox TTS) \

For full TTS functionality, you’ll need RunPod access. For initial development, you can use the mock TTS service.
  1. Create Account
  2. Deploy Chatterbox Pod
    • See Document #15 (Chatterbox TTS Integration Guide) for full instructions
    • For development, use the mock service instead:

8.6 Using Mock Services \

For rapid development without external dependencies, use mock services:
Mock services return canned responses and are useful for:
  • Initial development
  • Running unit tests
  • Offline development
  • CI pipelines without credentials

  1. Database Setup \

9.1 Verify Database Connection \

9.2 Run Database Migrations \

9.3 Seed Development Data \

9.4 Verify Database Schema \

9.5 Database Management UI \

Access Adminer for visual database management:
  1. Open http://localhost:8080
  2. Login with:
    • System: PostgreSQL
    • Server: postgres
    • Username: voiceai
    • Password: voiceai_dev_password
    • Database: voiceai

  1. Service Configuration \

10.1 API Gateway Configuration \

Create services/api-gateway/config.py:

10.2 WebRTC Bridge Configuration \

Create services/webrtc-bridge/config.py:

10.3 Agent Service Configuration \

Create services/agent-service/config.py:

10.4 Worker Service Configuration \

Create services/worker-service/config.py:

  1. Running the Development Stack \

11.1 Start Infrastructure Services \

11.2 Start Application Services \

Open four terminal windows/tabs and run each service: Terminal 1 - API Gateway:
Terminal 2 - WebRTC Bridge:
Terminal 3 - Agent Service:
Terminal 4 - Worker Service:

11.3 Using the Start Script \

Alternatively, use the all-in-one start script:

11.4 Verify Services Are Running \

11.5 Stopping Services \


  1. Testing Your Setup \

12.1 Run Unit Tests \

12.2 Run Integration Tests \

Integration tests require the Docker stack to be running:

12.3 Test API Endpoints \

12.4 Test WebRTC Connection \

12.5 Test End-to-End Flow \

12.6 Health Check Script \

Create a comprehensive health check:

  1. IDE Configuration \

13.1 VS Code Setup \

Create .vscode/extensions.json:

Workspace Settings \

Create .vscode/settings.json:

Launch Configuration \

Create .vscode/launch.json:

13.2 PyCharm Setup \

Project Interpreter \

  1. Open Settings (Cmd+, or Ctrl+,)
  2. Navigate to Project → Python Interpreter
  3. Click gear icon → Add
  4. Select “Existing Environment”
  5. Path: ~/.pyenv/versions/voice-ai/bin/python

Run Configurations \

Create run configurations for each service:
  1. Run → Edit Configurations
  2. Add New → Python
  3. Configure:
    • Name: API Gateway
    • Script path: (Module name) uvicorn
    • Parameters: app.main:app --reload --port 8000
    • Working directory: $ProjectDir$/services/api-gateway
    • Environment variables: From .env file

13.3 Git Configuration \

Set up Git hooks for code quality:
.pre-commit-config.yaml:

  1. Troubleshooting \

14.1 Common Issues \

Docker Issues \

Problem: Docker containers won’t start
Problem: Container shows “unhealthy”

Database Issues \

Problem: Connection refused to PostgreSQL
Problem: Migration fails

Python Environment Issues \

Problem: Module not found errors
Problem: Wrong Python version

Service Connection Issues \

Problem: Service can’t connect to Redis
Problem: Service can’t connect to another service

WebRTC Issues \

Problem: LiveKit connection fails
Problem: No audio in test calls

14.2 Debug Mode \

Enable verbose logging:

14.3 Useful Debug Commands \

14.4 Getting Help \

If you’re stuck:
  1. Check the logs - Most issues leave traces in service logs
  2. Search existing issues - Someone may have solved this before
  3. Ask in Slack - #voice-ai-dev channel
  4. Create an issue - With reproduction steps and logs

  1. Appendix \

15.1 Quick Reference Card \

15.2 Environment Variables Cheat Sheet \

15.3 Port Reference \

15.4 Useful Aliases \

Add to your ~/.bashrc or ~/.zshrc:

Document Revision History \


This document is part of the Voice by aiConnected technical documentation suite.