Skip to main content
This page explains the quickstart by backend/frontend steps and keeps each key file in copyable code blocks.

Run Quickstart First

Use the clone-and-run flow first, then come back here for implementation details.
1

Configure backend environment and dependencies

The backend uses two processes: token server and agent worker.
backend/.env
backend/pyproject.toml
2

Implement token endpoint and dispatch logic

token_server.py issues the browser token and dispatches the LiveKit agent.
backend/token_server.py
3

Implement agent worker + AvatarSession

agent.py runs the realtime LLM and starts SpatialReal avatar publishing in the same room.
backend/agent.py
4

Configure frontend env and Vite

Frontend reads token endpoint and room name from env and proxies /token locally.
frontend/.env
frontend/vite.config.ts
5

AvatarKit UI setup

This frontend uses AvatarKit UI components (SpatialRealAvatarProvider, SpatialRealAvatarCanvas, etc.).To set up the same UI stack:
  1. Complete shadcn base setup: shadcn manual installation
  2. Install dependencies and component files:
6

Implement AvatarKit UI frontend page

This frontend is implemented with AvatarKit UI. App.tsx requests token, mounts SpatialRealAvatarProvider, and controls microphone state.
frontend/src/App.tsx
7

Understand runtime sequence

Use this sequence to trace issues across backend, agent, and frontend.