---
created: 2026-03-12
tags: [infrastructure, architecture, systems]
related: ["[[07-Command-Centre/Dashboard]]", "[[02-Fleet/Fleet Map]]", "[[08-Infrastructure/Database Schema]]", "[[08-Infrastructure/Voice Systems]]"]
---

# Infrastructure Map

> Complete technical map of RateRight. Source: CC deep pass + Rivet operational report (2026-03-12).

---

## Domains & Web Apps

| Domain | Purpose | Stack | Hosting | Status |
|---|---|---|---|---|
| **rateright.com.au** | The $50 App — construction hiring marketplace | Next.js 14 + Supabase + Stripe | VPS nginx → port 3000 (systemd: rateright-app) | LIVE |
| **cc.rateright.com.au** | Control Centre — fleet mission control | React 19 + Vite 7 + Tailwind 4 + Supabase realtime | VPS nginx → port 3100 | READY (needs nginx config) |
| **admin.rateright.com.au** | Admin CRM — leads, calls, SMS, scripts | React + Vite 7 + Tailwind + Twilio Voice SDK | VPS nginx | LIVE |
| **rivet.rateright.com.au** | Legacy app URL (V2 backup, /join landing) | Same as rateright.com.au | VPS nginx → port 3334 | LIVE (being phased out) |
| **app.rateright.com.au** | Legacy v1 site | Unknown | Unknown | Should redirect |
| **Growth Engine API** | Backend for everything — 46 routes | Node.js / Express | Railway (auto-deploy on main push) | LIVE |
| **rateright.com.au (Flask)** | Main marketing/company site | Flask | Fly.io ($189/mo) | LEGACY |
| **docs.rateright.com.au** | Documentation | Docusaurus | Vercel | LIVE |

### DNS & SSL
- **DNS:** GoDaddy (ns57/ns58.domaincontrol.com)
- **SSL:** Let's Encrypt (certbot auto-renew on VPS)
- **A Records:** rivet, cc → 134.199.153.159

---

## VPS — DigitalOcean Sydney

- **IP:** 134.199.153.159
- **Specs:** 4 vCPU, 8GB RAM
- **Region:** syd1
- **Cost:** ~$48/month
- **Runs:** Agent fleet, RateRight app, Control Centre, Admin, Voice AI, nginx

---

## Agent Fleet (8 agents)

| Agent | Role | Port | Model | Provider | Fallback | Service |
|---|---|---|---|---|---|---|
| [[02-Fleet/Rivet]] | Orchestrator | 18789 | DeepSeek-chat (temp) | DeepSeek | MiniMax M2.5 | clawdbot-gateway |
| [[02-Fleet/Builder]] | Code Engineer | 18790 | Claude Opus 4.6 | LocalCC → Max | Codex 5.3 (OpenRouter) | clawdbot-builder |
| [[02-Fleet/Susan]] | Sales Pipeline | 18792 | Kimi K2.5 | Moonshot | DeepSeek | clawdbot-susan |
| [[02-Fleet/Harper]] | Finance & Legal | 18796 | GPT-5.2 | OpenRouter | DeepSeek | clawdbot-harper |
| [[02-Fleet/Sentinel]] | DevSecOps | 18800 | DeepSeek-chat | DeepSeek | MiniMax | clawdbot-sentinel |
| [[02-Fleet/Radar]] | Research & Intel | 18804 | Grok-3 | OpenRouter/xAI | DeepSeek | clawdbot-radar |
| [[02-Fleet/Herald]] | Communications | 18808 | Gemini 3.1 Pro | Google (direct) | Moonshot | clawdbot-herald |
| [[02-Fleet/Cog]] | Operations | 18812 | MiniMax M2.5 | MiniMax | DeepSeek | clawdbot-cog |

**Design:** No two agents share the same primary + fallback provider.

> **Note:** [[02-Fleet/Rivet]] is temporarily on DeepSeek-chat. Target: GPT-5.4 (OpenAI direct) once rate limits clear.

**Gateway config:** /root/.openclaw/clawdbot.json (openclaw.json symlinked)
**Agent configs:** /root/.openclaw-{agent}/clawdbot.json
**Manage:** `systemctl {status|restart} clawdbot-{agent}` / `journalctl -u clawdbot-{agent} -f`

---

## CC VPS — Process-Controlled Coding Agent

Not just "Claude on a server" — a distinct entity with its own communication protocol.

- **Launch:** Rivet calls `claude -p` with direct task prompt
- **Completion:** Notifies Rivet via `clawdbot gateway wake --text "Done: [summary]" --mode now`
- **Comms in:** rivet/RIVET-TO-CCVPS.md (Rivet → CC VPS)
- **Comms out:** rivet/CC-VPS-INBOX.md (CC VPS → Rivet)
- **No polling** — direct process control

---

## Voice AI Systems

See [[08-Infrastructure/Voice Systems]] for full details.

### System 1: VAPI (Inbound Phone Receptionist)
- Model: GPT Realtime API | Voice: OpenAI alloy
- Flow: Inbound call → conversation → transcript → vapi_tasks → taskExecutor
- Webhook: Growth Engine /api/vapi/webhook

### System 2: Pipecat + Twilio (Rivet Personal Assistant)
- STT: Deepgram (AU English, nova-2) | LLM: Claude Opus 4.5 | TTS: ElevenLabs "Charlie"
- Phone: +61238205443 | WebSocket: port 8765
- Calls: Morning 6:30 AM (brief), Evening 5:30 PM (debrief), Sunday (weekly)

---

## LocalCC Bridge

Exposes local Claude Code (Max plan) as HTTP API for [[02-Fleet/Builder]].

- **Script:** scripts/localcc-bridge.js
- **Port:** 18950
- **Endpoints:** GET /status, POST /run, GET /logs
- **Expose:** cloudflared tunnel → remote access
- **Start:** `LOCALCC_TOKEN=xxx npm run localcc:serve`

---

## Council Router (Multi-Agent Fan-Out)

3-phase dispatch engine for multi-agent problem-solving.

- Fan-out → Discussion → Consolidation
- Backend: councilRouter.js + agentBridge.js
- DB: cc_council_rounds, cc_council_dispatches, cc_council_messages
- Frontend: Council.jsx in Control Centre

---

## Growth Engine API — Route Map (46 routes)

| Category | Routes | Purpose |
|---|---|---|
| Leads | leads, import, export, enrichment, tags, dossier | Lead CRUD, Apollo enrichment |
| Communication | sms, calls, voice, voicemail, vapi, notifications | SMS campaigns, voice, VAPI |
| Sales Tools | callList, callAnalytics, callScoring, scripts, sequences | AI scoring, playbooks, automation |
| Analytics | dashboard, analytics, intelligence, activation, frontendTracking | Metrics, BI, funnel tracking |
| Fleet | fleet, council, notion, jobs | Agent control, multi-agent dispatch |
| Gamification | battleground, battlegroundV2, achievements, xp | Leaderboards, badges, XP |
| Users | users, team, manager | User/team management |
| System | health, webhooks, bugReport, dev, sync | Health, inbound webhooks |

**Middleware:** Compression → Helmet → CORS → Raw body → JSON → Pino logger → 7 rate limiters → Auth (Supabase JWT + API key)
**WebSockets:** /api/transcribe/ws (Deepgram proxy), /api/twilio-media (call audio)

---

## Integrations & Monthly Costs

| Service | Purpose | Cost |
|---|---|---|
| Claude Max | Builder via LocalCC | $340 |
| Fly.io | Legacy Flask site | $189 |
| Apollo.io | Lead enrichment | $85 |
| Twilio | SMS + voice (phone: +61468087171) | $76 |
| DigitalOcean | VPS | ~$48 |
| ElevenLabs | TTS for Rivet voice | $22 |
| Xero | Accounting | $10 |
| Google Workspace | Email/docs | $5 |
| **Total** | | **~$775/mo** |

Plus usage-based: Railway, VAPI, Deepgram, S3, Stripe fees, OpenRouter, OpenAI, DeepSeek, Moonshot, Google AI, MiniMax

---

## Repos

| Repo | VPS Path | Purpose |
|---|---|---|
| rateright-growth-deploy | /home/ccuser/rateright-growth | Growth Engine + Rivet + CC + Admin + voice + **this vault** |
| the-50-dollar-app | /home/ccuser/the-50-dollar-app | RateRight v2 marketplace |
| rateright-main-site | /home/ccuser/rateright-main-site | Flask main site |

---

## Security

- **Secrets:** Doppler (primary), .env (local, gitignored), /root/.openclaw/ (VPS)
- **API security:** Helmet, CORS whitelist, 7 rate limit tiers, input validation (express-validator, xss, hpp, mongo-sanitize)
- **Auth:** Supabase JWT + API key fallback (requireApiKeyOrAuth())
- **Webhook validation:** Twilio + VAPI signature verification
- **Monitoring:** [[02-Fleet/Sentinel]] — 36+ attacks blocked
