Skip to main content

Local Development

Running Services Locally

Marketing Site

cd agentstack-marketing
npm install
npm run dev # → http://localhost:5173

HITL Frontend

cd hitl-frontend
npm install
npm run dev # → http://localhost:5173

Configure the backend URL in .env.local:

VITE_API_URL=https://cerebro-stg-apim.azure-api.net
VITE_KEYCLOAK_URL=https://keycloak.icydesert-76825898.southindia.azurecontainerapps.io

Assistant Agent (Python/FastAPI)

cd assistant-agent
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # fill in secrets
uvicorn main:app --reload --port 8000

AI Marketer Backend (Flask)

cd ai-marketer-backend
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # fill in secrets
python app.py # → http://localhost:5001

Connecting to Cloud Services from Local

You can point your local app at the cloud APIM, Keycloak, and databases:

# Use cloud Keycloak
KEYCLOAK_URL=https://keycloak.icydesert-76825898.southindia.azurecontainerapps.io

# Use cloud APIM
API_BASE_URL=https://cerebro-stg-apim.azure-api.net

For PostgreSQL: since the auth DB is inside a private VNet, you need to exec into the toolbox or set up a VPN. The assistant agent DB may have public access — check its firewall rules:

az postgres flexible-server firewall-rule list \
--resource-group assistant-agent-rg \
--name assistant-agent-pg-62be6d5f \
--output table

To temporarily allow your IP:

MY_IP=$(curl -s ifconfig.me)
az postgres flexible-server firewall-rule create \
--resource-group assistant-agent-rg \
--name assistant-agent-pg-62be6d5f \
--rule-name allow-my-ip \
--start-ip-address $MY_IP \
--end-ip-address $MY_IP

Environment File Template

# === Claude / Anthropic ===
ANTHROPIC_API_KEY=sk-ant-...

# === Database ===
DATABASE_URL=postgresql://user:password@host:5432/dbname

# === Auth ===
KEYCLOAK_URL=https://keycloak.icydesert-76825898.southindia.azurecontainerapps.io
KEYCLOAK_REALM=master
KEYCLOAK_CLIENT_ID=your-client-id
KEYCLOAK_CLIENT_SECRET=your-client-secret

# === Messaging ===
SENDGRID_API_KEY=SG....
TWILIO_ACCOUNT_SID=AC...
TWILIO_AUTH_TOKEN=...

# === Storage ===
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;...

# === Event Hub ===
EVENT_HUB_CONNECTION_STRING=Endpoint=sb://...