03-projects
no-bad-parts-collective
Build Plan

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)

ItemCommand / action
1.1 Docker DesktopInstall from docker.com → confirm docker run hello-world works.
1.2 Node 18 + pnpm / npmnvm install 18 && nvm use 18 or use Homebrew.
1.3 Vercel CLInpm i -g vercelvercel login
1.4 Fly CLIbrew install flyctl (mac) or choco install flyctl (Windows)
1.5 Git repogit 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 branchgit checkout -b video-poc

2 — LIVEKIT CLOUD (≈ 1 hour)

  1. Sign in at cloud.livekit.ioNew Project → choose EU region → name: ifs-demo.

  2. Rooms → Create Room → name ifs-demo (defaults are fine).

  3. Settings → API Keys → Generate (keep key/secret somewhere safe).

  4. Token Generator

    • identity partner, room ifs-demo → copy token A

    • identity facilitator, room ifs-demo → copy token B

  5. 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)

  1. .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>
  2. 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)

  1. Launch app

    fly launch --name ifs-agent \
               --image livekit/agent-audio-llm:latest \
               --region fra --noworkspace
  2. 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)"
  3. Deploy & lock cost

    fly deploy
    fly scale count 1
    fly scale memory 256
  4. Verify

    fly logs -a ifs-agent
    # look for "joined room ifs-demo"

6 — DAY-BY-DAY TIMELINE

SlotGoalDeliverable
Day 1 AMLiveKit room + JWTs; local Agent running.env.local, .agent.env complete
Day 1 Noonvideo-poc branch, deps installed, folder groups createdRepo pushed
Day 1 Early PM/partner route live on Vercel previewSelf-view video tile
Day 1 Late PMDemo milestone/facilitator route with placeholder HintStream (dummy text)Layout + video + scrolling text
Day 2 AMConnect real Agent data-channel locallySpoken sentence → hint appears
Day 2 Mid-PMDeploy Agent to Fly.ioAny browser → hints work (laptop can sleep)
Day 2 Late PMPolish UI, offline-toast, vercel --prod, record demo GIFFinished 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.