How human-bee/present works
Main Components
• Frontend Application: Representing the Next.js app which handles the UI, routing, and rendering.
• API Layer: The API routes under src/app/api (e.g., create-agent, get-token, livekit-diagnostics, livekit, refresh-token) that handle authentication and token management.
• Whiteboard Module: A dedicated component (e.g., TLDraw integration found in src/app/whiteboard and related components) for collaborative drawing.
• Video Conferencing Module: Components and API integration for video (located in src/app/videoconference and src/components/videoconference) that interface with LiveKit.
• Transcription/ Speech-to-Text Module: Components for transcription (e.g., src/app/transcription-board, src/components/transcription) and corresponding contexts.
• Context Providers: Global state management (e.g., TranscriptionContext, VideoConferenceContext) for sharing state across components.
• External Services: LiveKit’s external service for video and possibly any third-party speech-to-text service if applicable.
Relationships & Interactions
• The Frontend (Next.js) interacts with API routes (backend) to manage authentication and to retrieve/generate LiveKit tokens.
• The Whiteboard and Video Conferencing modules, although presented side by side in the UI, are integrated by sharing room/participant information (joined through URL parameters such as roomId).
• The speech-to-text transcription module feeds data (notes/annotations) back to the whiteboard.
• Context providers ensure that state (e.g., transcription data or video room status) is shared consistently across the UI components.
• External communication flows out to LiveKit, with directional data flows for video calls and token validation.
Architectural Patterns and Design Principles
• Modularized UI: Separation of concerns between components (whiteboard, videoconference, transcription) and API endpoints.
• Client-Server Interaction: Clear distinction between frontend and backend API routes makes for an edge-based, token-secure architecture.
• Use of Contexts: For state management in React, ensuring components remain loosely coupled.
• Layered Design: Present API endpoints in one layer and UI components in another, with a clear gateway for external LiveKit services.
Relevant Technologies and Frameworks
• Next.js as the frontend framework with React.
• TLDraw for the collaborative whiteboard.
• LiveKit for WebRTC–based video conferencing.
• Node.js for server-side operations.
• Testing libraries (Jest) are present and may be represented as a supporting quality assurance layer.
• ESLint and Prettier configurations indicate adherence to coding standards.
Specific Elements
• Use clear labels for:
• Frontend Application (Next.js + React)
• API Endpoints (create-agent, get-token, livekit, etc.)
• Whiteboard Module (TLDraw integration)
• Video Conferencing Module (LiveKit integration)
• Transcription Module (speech recognition and transcription board)
• Context Providers (for state management)
• External Services (LiveKit Cloud)
• From the Frontend to the API endpoints (authentication and token requests).
• From the API to the External LiveKit services.
• Between the Whiteboard, Video Conferencing, and Transcription components (indicating shared room state and real-time updates).
• Interdependencies such as the requirement of LiveKit tokens as a dependency for secure room access.
• Within the Frontend cluster, further subdivide areas into the whiteboard, video conferencing, and transcription modules, each connected by context or direct interactions.