plugnmeet-server

repository·main·Indexed 19 days ago

https://github.com/mynaparrot/plugnmeet-server

The Go-based backend server for Plug-N-Meet, a scalable open-source web conferencing solution built on LiveKit. It manages API requests and business logic, supporting adaptive streaming, collaborative tools, and AI-driven insights via providers such as Azure, Google, and OpenAI for real-time transcription, translation, and summarization.

Tokens
3.6K
Snippets
16
Records
22
Agent score
68%

What's inside plugnmeet-server

  1. Overview of Plug-N-Meet

    main

    Plug-N-Meet is an open-source, scalable web conferencing system built on the LiveKit WebRTC infrastructure. It is designed to be integrated into existing websites or applications via APIs and SDKs.

    Key capabilities include:

    • Adaptive Streaming: Supports H264, VP8, VP9, and AV1 codecs with Simulcast and Dynacast.
    • Collaboration: Whiteboard (with office file support), shared notepad, polls, and breakout rooms.
    • AI Intelligence: Real-time transcription, spoken translations, and automated summaries via the Artifacts API.
    • Broadcasting: MP4 recording and RTMP/RTMPS/WHIP support.
    • Security: WebRTC encryption by default with optional End-to-End Encryption (E2EE).
  2. Core Components of Plug-N-Meet

    main

    The system is composed of three primary architectural pieces:

    1. plugNmeet-server: The Go-based backend responsible for all API requests and business logic.
    2. plugNmeet-client: The React and Redux-based frontend user interface.
    3. plugNmeet-recorder: A dedicated Go application used to manage MP4 recordings and RTMP broadcasting.
  3. Manual Installation Requirements

    main

    To install Plug-N-Meet manually, you must satisfy the following dependencies:

    • LiveKit: A properly configured instance.
    • Redis: Used for caching and messaging.
    • MariaDB or MySQL: For persistent data storage.
    • Optional: libreoffice and mupdf-tools if you require office file support (PDF, DOCX, PPTX) within the collaborative whiteboard.
  4. Install Plug-N-Meet via Docker

    main

    You can run the server using Docker by providing a config.yaml file. Ensure you have created your config.yaml from the config_sample.yaml provided in the repository before running the command.

    For a multi-container setup, refer to the docker-compose_sample.yaml file in the repository.

    docker run --rm -p 8080:8080 \
        -v $PWD/config.yaml:/config.yaml \
        mynaparrot/plugnmeet-server \
        --config /config.yaml
  5. Available SDKs and Integrations

    main

    Plug-N-Meet provides several ways to integrate conferencing into your ecosystem:

    Official SDKs

    • PHP SDK
    • JavaScript SDK (Supports NodeJS and Deno)

    Ready-to-Use Plugins

    • WordPress Plugin
    • Moodle Plugin
    • Joomla Component
    • LTI (Learning Tools Interoperability) for compatible LMS

    Mobile and Desktop

    • Native Mobile App Integration: A hybrid model that allows you to combine a native media layer with the full plugNmeet web client UI for iOS, Android, Flutter, React Native, or desktop applications.
  6. Create real-time transcription with OpenAIProvider

    main

    CreateTranscription initializes a real-time transcription stream using OpenAI's realtime API. It returns an insights.TranscriptionStream.

    Parameters:

    • ctx: The execution context.
    • roomId: The unique identifier for the meeting room.
    • userId: The unique identifier for the user.
    • options: A JSON-encoded byte slice containing insights.TranscriptionOptions.
    stream, err := provider.CreateTranscription(ctx, "room-123", "user-456", transcriptionOptionsJSON)
    if err != nil {
    	// handle error
    }
  7. Stream AI text chat with OpenAIProvider

    main

    AITextChatStream sends a prompt with conversation history and returns a channel that streams back the AI's response. This is useful for building interactive AI chat interfaces.

    Parameters:

    • ctx: The execution context.
    • chatModel: The name of the OpenAI model to use (e.g., gpt-4o).
    • history: A slice of *plugnmeet.InsightsAITextChatContent representing the conversation history.
    resultsChan, err := provider.AITextChatStream(ctx, "gpt-4o", history)
    if err != nil {
    	// handle error
    }
    for result := range resultsChan {
    	// Process each chunk of the streamed response
    	fmt.Print(result.Content)
    }
  8. Synthesize text to speech with OpenAIProvider

    main

    SynthesizeText performs stateless text-to-speech (TTS) synthesis. It returns an io.ReadCloser which can be read to obtain the audio data.

    Parameters:

    • options: A JSON-encoded byte slice containing insights.SynthesisTaskOptions. The options object must include:
      • Text: The string to synthesize.
      • Language: The target language.
      • Voice: The specific OpenAI voice to use.
    // options should be a JSON representation of insights.SynthesisTaskOptions
    audioStream, err := provider.SynthesizeText(ctx, synthesisOptionsJSON)
    if err != nil {
    	// handle error
    }
    defer audioStream.Close()
    // Read from audioStream to get the audio content
  9. Initialize the Azure AI Provider

    main

    To use Azure services for transcription, translation, and text synthesis within Plug-N-Meet, you must initialize an AzureProvider using the NewProvider function. This requires a config.ProviderAccount (containing credentials like API Key and Region) and a config.ServiceConfig (containing service-specific options like the model name).

    // Example initialization
    provider, err := azure.NewProvider(providerAccount, serviceConfig, logger)
    if err != nil {
        // handle error
    }
  10. Initialize an OpenAIProvider

    main

    Use NewProvider to create an instance of OpenAIProvider which implements the insights.Provider interface. This provider enables real-time transcription, text translation, text-to-speech synthesis, and AI-driven chat/summarization using OpenAI's services.

    Requirements:

    • A config.ProviderAccount containing a valid APIKey in its credentials.
    • An optional endpoint option in the provider account to override the default OpenAI base URL (https://api.openai.com/v1).

    Parameters:

    • ctx: The execution context.
    • providerAccount: Configuration containing the API key and optional endpoint.
    • serviceConfig: The service-level configuration.
    • log: A logrus.Entry for logging.
    • redis: A *redis.Client for state management.
    provider, err := openai.NewProvider(ctx, providerAccount, serviceConfig, logger, redisClient)
    if err != nil {
    	// handle error
    }