This guide will take you from zero to a working multi-agent system. Follow the steps in order.
- Prerequisites
- Environment Setup
- Google Cloud Setup
- GitHub Configuration
- Database Setup
- Running the Application
- Troubleshooting
- macOS, Linux, or Windows (macOS darwin 24.6.0 confirmed working)
- Node.js 20+ - Download
- Python 3.11+ - For Google ADK agents
- PostgreSQL 15+ - For database
- Git - For version control
- Google Cloud Account with billing enabled
- GitHub Account with admin access to repositories
# Check Node.js version
node --version # Should be >= 20.0.0
# Check Python version
python3 --version # Should be >= 3.11
# Check PostgreSQL
psql --version # Should be >= 15
# Check git
git --versioncd /Users/muratcankoylan/ActualCode/actualy_code# Install all Node.js packages
npm install
# Verify installation
npm list --depth=0# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate # On macOS/Linux
# OR
venv\Scripts\activate # On Windows
# Verify activation
which python # Should point to venv/bin/python# Upgrade pip
pip install --upgrade pip
# Install Google ADK and dependencies
pip install google-adk
# Install Google Cloud libraries
pip install google-cloud-aiplatform google-auth google-cloud-logging google-cloud-storage
# Install utility libraries
pip install python-dotenv pydantic tenacity asyncio
# Install testing libraries
pip install pytest pytest-asyncio
# Create requirements.txt
pip freeze > requirements.txt# Create .env file
cat > .env << 'EOF'
# Google Cloud
GOOGLE_CLOUD_PROJECT=ActualCode
GOOGLE_GENAI_USE_VERTEXAI="True"
GOOGLE_CLOUD_REGION=us-central1
# GitHub
GITHUB_TOKEN=ghp_your_token_here
GITHUB_CLIENT_ID=your_github_oauth_client_id
GITHUB_CLIENT_SECRET=your_github_oauth_client_secret
# Database
DATABASE_URL=postgresql://username:password@localhost:5432/assessment_platform
# Next.js Authentication
NEXTAUTH_SECRET=your-secret-key-change-this
NEXTAUTH_URL=http://localhost:3000
# Agent Engine (will be updated after deployment)
AGENT_ENGINE_URL=
# Environment
NODE_ENV=development
EOF
# Add to .gitignore
echo ".env" >> .gitignore
echo "venv/" >> .gitignore
echo "*.pyc" >> .gitignore
echo "__pycache__/" >> .gitignore# Install gcloud CLI (if not already installed)
curl https://sdk.cloud.google.com | bash
exec -l $SHELL
# Initialize gcloud
gcloud init
# Authenticate
gcloud auth login
gcloud auth application-default login# Set project variables
export PROJECT_ID="actualcode-hackathon"
export PROJECT_NAME="ActualCode Hackathon"
export REGION="us-central1"
# Create project
gcloud projects create $PROJECT_ID --name="$PROJECT_NAME"
# Set as current project
gcloud config set project $PROJECT_ID# List billing accounts
gcloud billing accounts list
# Link billing (replace with your billing account ID)
export BILLING_ACCOUNT_ID="your-billing-account-id"
gcloud billing projects link $PROJECT_ID --billing-account=$BILLING_ACCOUNT_ID# Enable all required Google Cloud APIs
gcloud services enable \
aiplatform.googleapis.com \
run.googleapis.com \
sqladmin.googleapis.com \
storage.googleapis.com \
secretmanager.googleapis.com \
logging.googleapis.com \
monitoring.googleapis.com \
cloudtrace.googleapis.com \
cloudbuild.googleapis.com
# Verify enabled APIs
gcloud services list --enabled# Create service account
gcloud iam service-accounts create actualcode-sa \
--display-name="ActualCode Service Account"
# Grant necessary roles
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member="serviceAccount:actualcode-sa@$PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/aiplatform.user"
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member="serviceAccount:actualcode-sa@$PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/cloudsql.client"
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member="serviceAccount:actualcode-sa@$PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/storage.objectAdmin"
# Create and download key
gcloud iam service-accounts keys create \
~/actualcode-sa-key.json \
--iam-account=actualcode-sa@$PROJECT_ID.iam.gserviceaccount.com
# Set environment variable
export GOOGLE_APPLICATION_CREDENTIALS="$HOME/actualcode-sa-key.json"
# Update .env file with the path
echo "GOOGLE_APPLICATION_CREDENTIALS=$HOME/actualcode-sa-key.json" >> .envManual Steps:
- Go to https://github.com/settings/tokens
- Click "Generate new token (classic)"
- Name:
ActualCode Hackathon - Select scopes:
- ✅
repo(Full control of private repositories) - ✅
read:org(Read org and team membership) - ✅
read:user(Read user profile data)
- ✅
- Click "Generate token"
- Copy the token immediately (it won't be shown again)
# Add to .env file
# Replace ghp_your_token_here with your actual tokenManual Steps:
- Go to https://github.com/settings/developers
- Click "OAuth Apps" → "New OAuth App"
- Fill in the details:
- Application name:
Assessment Platform - Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:3000/api/auth/callback/github
- Application name:
- Click "Register application"
- Copy Client ID
- Click "Generate a new client secret" and copy Client Secret
# Update .env file with OAuth credentials
# GITHUB_CLIENT_ID=your_client_id
# GITHUB_CLIENT_SECRET=your_client_secret# Generate a secure secret for NextAuth
openssl rand -base64 32
# Add to .env file as NEXTAUTH_SECRET# On macOS (with Homebrew)
brew services start postgresql@15
# On Ubuntu/Debian
sudo systemctl start postgresql
# On Windows
# Start PostgreSQL from Services or pg_ctl# Create database
createdb assessment_platform
# Test connection
psql -d assessment_platform -c "SELECT 1;"# Update .env with your database credentials
# DATABASE_URL="postgresql://username:password@localhost:5432/assessment_platform"
# For local development, username is often your system username
# DATABASE_URL="postgresql://$(whoami)@localhost:5432/assessment_platform"# Generate Prisma client
npx prisma generate
# Push schema to database
npx prisma db push
# (Optional) Open Prisma Studio to view database
npx prisma studio# Activate Python virtual environment (if not already active)
source venv/bin/activate
# Start Next.js development server
npm run dev
# Application will be available at:
# - Local: http://localhost:3000
# - Network: http://YOUR_IP:3000# Test individual agent (after implementing)
python agents/scanner_agent.py
# Test orchestrator
python orchestrator.py
# Run Python tests
pytest tests/ -v# Install Node.js 20 using nvm
nvm install 20
nvm use 20
# Verify version
node --version# Make sure you're in the right directory
cd /Users/muratcankoylan/ActualCode/actualy_code
# Deactivate if active
deactivate 2>/dev/null || true
# Remove old venv
rm -rf venv
# Create fresh virtual environment
python3 -m venv venv
source venv/bin/activate
# Verify
which python # Should show venv path# Update pip first
pip install --upgrade pip
# Try with verbose output
pip install google-adk -v
# If fails, check Python version
python --version # Should be 3.11+# Test PostgreSQL is running
pg_isready
# Test connection
psql -d assessment_platform -c "SELECT 1;"
# Reset database (WARNING: deletes all data)
npx prisma db push --force-reset- Make sure callback URL is exactly:
http://localhost:3000/api/auth/callback/github - Check for typos in GitHub OAuth App settings
- Ensure no trailing slashes
- Regenerate client secret in GitHub OAuth App settings
- Update
.envfile with new secret - Restart development server
# Verify service account has correct roles
gcloud projects get-iam-policy $PROJECT_ID \
--flatten="bindings[].members" \
--filter="bindings.members:serviceAccount:actualcode-sa@*"
# Re-authenticate if needed
gcloud auth application-default login# Find process using port 3000
lsof -i :3000
# Kill the process
kill -9 <PID>
# Or use a different port
PORT=3001 npm run devBefore proceeding to implementation, verify:
- Node.js 20+ installed and verified
- Python 3.11+ virtual environment created and active
- All Python dependencies installed (google-adk, etc.)
- All Node.js dependencies installed
- Google Cloud project created
- All Google Cloud APIs enabled
- Service account created with key downloaded
- GitHub Personal Access Token created
- GitHub OAuth App created (Client ID & Secret)
- PostgreSQL installed and running
- Database created and Prisma schema pushed
-
.envfile created with all credentials - Development server starts without errors
Once setup is complete:
- Test the Application: Visit http://localhost:3000
- Read Architecture: See ARCHITECTURE.md to understand the system
- Start Implementation: Follow IMPLEMENTATION.md step-by-step
- Use Quick Reference: Keep REFERENCE.md handy for code snippets
Complete .env file template:
# Google Cloud
GOOGLE_CLOUD_PROJECT=actualcode-hackathon
GOOGLE_APPLICATION_CREDENTIALS=/path/to/actualcode-sa-key.json
GOOGLE_CLOUD_REGION=us-central1
# GitHub
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
GITHUB_CLIENT_ID=1234567890abcdef1234
GITHUB_CLIENT_SECRET=abcdef1234567890abcdef1234567890abcdef12
# Database
DATABASE_URL=postgresql://username:password@localhost:5432/assessment_platform
# Next.js
NEXTAUTH_SECRET=your-generated-secret-from-openssl
NEXTAUTH_URL=http://localhost:3000
# Agent Engine (populated after deployment)
AGENT_ENGINE_URL=
# Environment
NODE_ENV=developmentIf you encounter issues not covered here:
- Check the Troubleshooting section above
- Review REFERENCE.md for common solutions
- Check Google Cloud Console for service status
- Verify all environment variables are set correctly
- Ensure all services (PostgreSQL, Google Cloud APIs) are running
Setup Complete! 🎉
You're now ready to start implementing the multi-agent system. Head to IMPLEMENTATION.md for step-by-step instructions.