How tegnike/aituber-kit works
Main Components
• Frontend (Client) Layer:
• Built using Next.js (evident from next.config.js, src/pages/_app.tsx, etc.).
• Comprises interactive UI components (in src/components) for chat, Live2D/VRM viewer, settings, slides, and more.
• Handles localization (locales/ folder) and styling (Tailwind CSS, src/styles, etc.).
• Backend/API Layer:
• Next.js API routes (found in src/pages/api) serve as the backend endpoints for processing chat requests, audio synthesis (calls to VOICEVOX, ElevenLabs, etc.), VRM and Live2D asset management, and external linkages.
• Docker and docker-compose configurations indicate containerized deployment, which might involve a separate and secure API key handling server.
• External Service Integrations:
• Requests to various LLM services (OpenAI, Anthropic, Google Gemini, etc.) and TTS engines (VOICEVOX, Azure, ElevenLabs, and others).
• Realtime API integration and WebSocket support for lower latency messaging and external server connectivity.
• Real-Time and Communication Modules:
• WebSocket integration (such as src/components/websocketManager.tsx and src/features/stores/websocketStore.ts) for external linkage mode and real-time chat.
• YouTube-related functionality (in src/features/youtube) to fetch live chat and automate AI character responses.
• Assets and Multimedia:
• Localization of UI through JSON language files (in locales/).
Understand the Architectural Patterns
• Component-based UI architecture with React/Next.js:
• Separation between UI components, state management (stores in src/features/stores), and feature-specific logic (src/features/chat, src/features/slide, etc.).
• API gateway pattern through Next.js API routes:
• These API endpoints consolidate various external integrations while shielding API keys (as noted in security considerations).
• Modular and extensible design:
• Separate directories for “lib” functions (VRM animation libraries, i18n) to support various features.
• Documentation and website (under website/) indicating an extensible public documentation and developer guide architecture.
• Containerization:
• Dockerfile and docker-compose.yml indicate a deployment strategy that packages the app with its dependencies.