How zoan37/chatvrm works
Main Components
Frontend Layer:
• React/Next.js Application (src/pages)
• VRM Viewer Components (src/components/vrmViewer.tsx)
• Chat Interface Components (src/components/chatLog.tsx, messageInput.tsx)
• Settings Interface (src/components/settings.tsx)
Core Features Layer:
• VRM Animation System (src/lib/VRMAnimation)
• Emote Controller (src/features/emoteController)
• Lip Sync System (src/features/lipSync)
• Message Processing System (src/features/messages)
External Services Layer:
• OpenRouter API (AI Chat)
• ElevenLabs API (Text-to-Speech)
• Web Speech API (Speech Recognition)
• Restream API (Livestream Integration)
• Vercel (Deployment Platform)
Component Relationships
User Input → Frontend Components → Message Processing → External APIs → Character Response
• ↓
• VRM Animation/Lip Sync/Emote Control
Specific Implementation Details
a) Frontend System (Blue):
• Next.js Pages
• React Components
• WebGL Viewer
b) Character Control System (Green):
• VRM Animation Controller
• Expression Controller
• Lip Sync Controller
• Auto Blink/Look At
c) Communication System (Yellow):
• WebSocket Service
• Token Refresh Service
• Message Processing
• API Routes
d) External Services (Purple):
• OpenRouter
• ElevenLabs
• Web Speech API
• Restream
• User Input → Speech Recognition → Text Processing
• Text → OpenRouter → Response Generation
• Response → ElevenLabs → Audio Generation
• Audio → Lip Sync → Character Animation
• Restream → WebSocket → Message Processing
Architecture Patterns
• Feature-based architecture (src/features)
• Service-based communication (src/services)
• Component-based UI (src/components)
• API Routes for backend functionality
The modular architecture allowing for easy extension
Keep the abstraction level high enough to understand the system at a glance but detailed enough to show the unique aspects of the VRM character interaction and AI integration.