agora-go-backend-middleware

A backend service composed of various micro-services that exposes a RESTful API designed to simplify interactions with @agoraio RESTful APIs.

MIT License

Stars
2
Committers
3

Agora Go Backend Middleware Β Β go test workflow

The Agora Go Backend Middleware is a microservice that exposes a RESTful API designed to simplify interactions with Agora.io. Written in Golang and powered by the Gin framework, this project serves as a middleware to bridge front-end applications using Agora's Real-Time Voice or Video SDKs with Agora's RESTful APIs.

This middleware streamlines the activation of Agora's extension services, such as Cloud Recording, Real-Time Transcription, and Media Services. To enhance security, the project includes a built-in Token Server with public endpoints, based on the AgoraIO Community Token Service, ensuring seamless token generation for services requiring Token Security.

How to Run

Create a .env and set the environment variables.

cp .env.example .env
go run cmd/main.go

Health Check

  • GET /ping
    • Response: {"message": "pong"}

Micro-Services & Endpoints

flowchart LR
    subgraph Client
        A[HTTP Client]
    end

    subgraph "Gin Web Server"
        B[Router]
    end

    subgraph "Core Services"
        direction TB
        C[Token Service]
        D[Cloud Recording Service]
        E[Real-Time Transcription Service]
        F[RTMP Service]
    end

    subgraph "External"
        K[Agora RESTful API]
    end

    A <-->|Request/Response| B
    B <-->|/token| C
    B <-->|/cloud_recording| D
    B <-->|/rtt| E
    B <-->|/rtmp| F
    D & E & F <-.->|API Calls| K

    classDef request fill:#f9f,stroke:#333,stroke-width:2px;
    classDef response fill:#bbf,stroke:#333,stroke-width:2px;

For detailed API specifications, and curl command examples to test the API endpoints locally, please refer to the following pages:

Token Service

TokenService holds the necessary configurations and dependencies for managing tokens.

Cloud Recording

CloudRecordingService holds the necessary configurations and dependencies for managing cloud recording requests. This includes Cloud Storage for RTT Service

Real Time Transcription (RTT)

RTTService holds all the necessary configurations and dependencies required for managing real-time transcription requestsħ

RTMP (Media Push & Pull)

RTMPService holds all the necessary configurations and dependencies required for managing media push and cloud player requests.

Related Projects