Build Plan
0 — POC OVERVIEW
Create a two‑URL proof‑of‑concept that streams AI coaching hints to a facilitator during a 1‑to‑1 Internal Family Systems session.
/partner
– full-screen video/facilitator
– video + scrolling Coach Panel that prints live AI hints- A silent Agent joins the room, listens only to the Partner, streams hints to the Facilitator
Partner ─▶ LiveKit Room ◀─ Facilitator
▲
│ audio
Silent Agent ─┘ (Whisper → GPT-4o-mini → text stream)
1 — SET-UP (local workstation, once)
Item | Command / action |
---|---|
1.1 Docker Desktop | Install from docker.com → confirm docker run hello-world works. |
1.2 Node 18 + pnpm / npm | nvm install 18 && nvm use 18 or use Homebrew. |
1.3 Vercel CLI | npm i -g vercel → vercel login |
1.4 Fly CLI | brew install flyctl (mac) or choco install flyctl (Windows) |
1.5 Git repo | git clone git@github.com:charlieellington/no-bad-parts.git (skip if already cloned) git remote set-url origin git@github.com:<PRIVATE-ORG>/no-bad-parts.git (make it private) |
1.6 Create new branch | git checkout -b video-poc |
2 — LIVEKIT CLOUD (≈ 1 hour)
-
Sign in at cloud.livekit.io → New Project → choose EU region → name:
ifs-demo
. -
Rooms → Create Room → name
ifs-demo
(defaults are fine). -
Settings → API Keys → Generate (keep key/secret somewhere safe).
-
Token Generator →
-
identity
partner
, roomifs-demo
→ copy token A -
identity
facilitator
, roomifs-demo
→ copy token B
-
-
Create
.env.local
in your repo root:NEXT_PUBLIC_LK_URL=wss://ifs-demo.eu.livekit.cloud NEXT_PUBLIC_PARTNER_TOKEN=<token A> NEXT_PUBLIC_FACILITATOR_TOKEN=<token B>
⏰ Token Expiry Note: For longer development sessions, use TTL of 604800 seconds (1 week) when generating tokens. Current tokens expire June 13, 2025.
3 — AGENT (local run first, ≈ 2 hours)
-
.agent.env
file:LIVEKIT_URL=wss://ifs-demo.eu.livekit.cloud PARTNER_ID=partner OPENAI_API_KEY=sk-… SYSTEM_PROMPT=<paste entire IFS prompt v0.1 here>
-
Pull and run container:
docker run --env-file .agent.env livekit/agent-audio-llm:latest
If you need a remote tester while still local:
ngrok http 3000
4 — FRONT-END (inside existing repo, ≈ 1 day)
4.1 Install deps
npm i @livekit/components-react @livekit/client
4.2 Shared wrapper – app/livekit-wrapper.tsx
(as in previous snippet—unchanged)
4.3 Routes
-
app/(session)/partner/page.tsx
– displays<ParticipantTile isLocal />
-
app/(session)/facilitator/page.tsx
– grid layout +HintStream
hook
(both snippets unchanged from earlier plan)
4.4 Failure behaviour
If Agent drops, Coach Panel prints "AI offline – continue as normal."
5 — DEPLOY AGENT TO FLY.IO (puts POC fully online, ≈ 45 min)
-
Launch app
fly launch --name ifs-agent \ --image livekit/agent-audio-llm:latest \ --region fra --noworkspace
-
Set secrets
fly secrets set \ LIVEKIT_URL=wss://ifs-demo.eu.livekit.cloud \ PARTNER_ID=partner \ OPENAI_API_KEY=sk-… \ SYSTEM_PROMPT="$(cat path/to/ifs-prompt.txt)"
-
Deploy & lock cost
fly deploy fly scale count 1 fly scale memory 256
-
Verify
fly logs -a ifs-agent # look for "joined room ifs-demo"
6 — DAY-BY-DAY TIMELINE
Slot | Goal | Deliverable |
---|---|---|
Day 1 AM | LiveKit room + JWTs; local Agent running | .env.local , .agent.env complete |
Day 1 Noon | video-poc branch, deps installed, folder groups created | Repo pushed |
Day 1 Early PM | /partner route live on Vercel preview | Self-view video tile |
Day 1 Late PM | Demo milestone – /facilitator route with placeholder HintStream (dummy text) | Layout + video + scrolling text |
Day 2 AM | Connect real Agent data-channel locally | Spoken sentence → hint appears |
Day 2 Mid-PM | Deploy Agent to Fly.io | Any browser → hints work (laptop can sleep) |
Day 2 Late PM | Polish UI, offline-toast, vercel --prod , record demo GIF | Finished POC |
7 — NEXT EASY WINS
-
Consent banner (Tailwind modal, store click in Supabase)
-
Supabase auth + serverless LiveKit JWT signer
-
Fly.io autoscaling or Railway alternative
-
Post-session summary generator
Follow the list top-to-bottom; you'll have a totally cloud-hosted proof-of-concept by the end of Day 2.