Next.js web application for testing voice-powered medical consultations with AI doctor simulation.
- Node.js 18+ and npm
- Supabase account for authentication
- LiveKit credentials (shared with backend)
- Install dependencies:
npm install- Configure environment variables:
Create
.env.localfile:
NEXT_PUBLIC_LIVEKIT_URL=wss://your-project.livekit.cloud
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
NEXT_PUBLIC_SITE_URL=http://localhost:3005
LIVEKIT_API_KEY=your-api-key
LIVEKIT_API_SECRET=your-api-secret- Run the development server:
npm run dev- Open the application: Navigate to http://localhost:3005 (Note: Port 3005 in Docker, 3000 locally)
frontend/
├── src/
│ ├── app/ # Next.js 14 App Router pages
│ ├── components/ # React components
│ │ ├── playground/ # LiveKit voice interface
│ │ └── ui/ # Reusable UI components
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utilities and helpers
│ └── styles/ # Global styles
├── public/ # Static assets
└── package.json # Dependencies and scripts
- Real-time Voice Chat: Powered by LiveKit WebRTC
- Live Transcriptions: See what you and the AI doctor are saying
- Visual Feedback: Audio visualizers and state indicators
- Connection Management: Easy connect/disconnect controls
- Appointment Overview: View scheduled appointments
- Client Management: Track patient information
- Staff Directory: Manage healthcare providers
- Calendar Integration: Visual appointment scheduling
- Supabase Auth: Secure user authentication
- Protected Routes: Role-based access control
- Session Management: Persistent login state
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLintThe main voice interface located in src/components/playground/:
- Handles LiveKit room connections
- Manages voice assistant state
- Displays real-time transcriptions
- Controls audio input/output
src/hooks/useConnection.tsx:
- Manages LiveKit connection state
- Handles authentication tokens
- Provides connection utilities
- Tailwind CSS: Utility-first styling
- Radix UI: Accessible component primitives
- Custom Theme: Configurable color schemes
- Dark Mode: Built-in dark theme support
The app auto-deploys via Vercel:
- Production: Push to
mainbranch - Staging: Push to
stagingbranch - Development: Push to
devbranch
Set these in Vercel dashboard:
- All
NEXT_PUBLIC_*variables LIVEKIT_API_KEYandLIVEKIT_API_SECRET
- Port Configuration: Runs on port 3005 in Docker, 3000 locally
- Mobile Support: Currently not optimized for mobile devices
- Browser Support: Best experience in Chrome/Edge
- WebRTC Requirements: Requires secure context (HTTPS/localhost)
- Verify LiveKit credentials match backend
- Check browser console for WebRTC errors
- Ensure microphone permissions are granted
- Verify Supabase URL and anon key
- Check network tab for auth errors
- Clear local storage and retry
rm -rf .next node_modules
npm install
npm run devSee parent repository for license information.