# recallai/meeting-direct-connect architecture

> Architecture diagram of the GitHub repository recallai/meeting-direct-connect, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/recallai/meeting-direct-connect
- Repository: https://github.com/recallai/meeting-direct-connect

## Overview

##### Project type and purpose
- This is a full-stack sample app demonstrating “botless” direct connect to Recall.ai for real-time media and event streaming from Zoom RTMS and Google Meet.
- The user interacts with a simple web UI; the backend manages OAuth, webhook endpoints, and a WebSocket bridge to Recall.ai.

##### File structure
- Top level: configuration files (`.env.example`, `package.json`, `tsconfig.json`), frontend assets (`public/`), and backend source (`src/`).
- `public/index.html` + `public/style.css`: single-page UI.
- `src/index.ts`: HTTP server + WebSocket server + webhook handlers.
- `src/types.ts`: shared type definitions.
- No separate “frontend” or “backend” repo—both live in one codebase.

##### README insights
- The app:
- Hosts a web UI at `localhost:<PORT>` (or via Ngrok).
- Exposes webhook endpoints (`/zoom-webhook`, `/oauth-callback/zoom`, etc.).
- Opens a WebSocket to Recall.ai’s Bot API to receive real-time events.
- Bridges those events over WebSocket to the browser.
- External integrations: Zoom RTMS app (OAuth + webhook), Google Meet Media API (OAuth + REST), Ngrok for public tunneling.

##### Main components and their interactions
a. Frontend UI (Browser)
- HTTP GET for HTML/CSS/JS
- WebSocket client to backend for real-time logs
- HTTP POST (or form submissions) to backend to initiate connections
b. Backend Node.js/TypeScript Server
- Serves static assets
- Offers REST endpoints for OAuth callbacks and meeting-connect requests
- Receives Zoom RTMS webhooks
- Manages a WebSocket client connection to Recall.ai Bot API
- Broadcasts Recall.ai events via its WebSocket server to the browser
c. External Services
- Recall.ai Bot API (WebSocket-based streaming)
- Zoom RTMS (OAuth v2, webhook event delivery)
- Google Meet Media API (OAuth v2, REST)
- Ngrok (tunneling local ports to a public URL)
d. Configuration & Environment
- `.env` holds `RECALL_API_KEY`, Zoom credentials, port, etc.
- `eslint.config.mjs`, `tsconfig.json` for code quality and compilation

##### Architectural patterns & principles
- Separation of concerns: UI layer vs. real-time event broker layer
- Event-driven webhook handling for Zoom
- WebSocket duplex channels for real-time streaming to Recall.ai and the browser
- Single codebase for ease of small-scale samples; can evolve into microservices if needed

## Diagram (Mermaid)

```mermaid
graph TB
    %% Nodes
    Browser["Frontend UI (Browser)"]:::frontend
    Ngrok["Ngrok Tunnel"]:::external
    subgraph "Backend Server"
        direction TB
        BackendStatic["Static Server\n(public/)"]:::backend
        BackendAPI["REST API & WebSocket Server\n(src/index.ts)"]:::backend
        Types["Shared Types\n(src/types.ts)"]:::backend
        Env["Env & Config\n(.env.example, tsconfig.json,\neslint.config.mjs,\npackage.json, package-lock.json)"]:::config
    end
    RecallAI["Recall.ai Bot API\n(WebSocket)"]:::external
    Zoom["Zoom RTMS\n(OAuth & Webhook)"]:::external
    Google["Google Meet Media API\n(OAuth & REST)"]:::external

    %% Flows
    Browser -->|HTTP GET / Static Assets| Ngrok --> BackendStatic
    Browser -->|WS Connect /logs| Ngrok --> BackendAPI
    Browser -->|HTTP POST /connect| Ngrok --> BackendAPI

    BackendAPI -->|WS Client: subscribe & receive events| RecallAI
    BackendAPI -->|OAuth & Token Exchange| Zoom
    BackendAPI -->|Webhook POST /zoom-webhook| Zoom
    BackendAPI -->|OAuth & Token Exchange| Google

    Env --- BackendStatic
    Env --- BackendAPI
    Env --- Types

    %% Click Events
    click Browser "https://github.com/recallai/meeting-direct-connect/blob/master/public/index.html"
    click Browser "https://github.com/recallai/meeting-direct-connect/blob/master/public/style.css"
    click BackendAPI "https://github.com/recallai/meeting-direct-connect/blob/master/src/index.ts"
    click Types "https://github.com/recallai/meeting-direct-connect/blob/master/src/types.ts"
    click Env "https://github.com/recallai/meeting-direct-connect/blob/master/.env.example"
    click Env "https://github.com/recallai/meeting-direct-connect/blob/master/tsconfig.json"
    click Env "https://github.com/recallai/meeting-direct-connect/blob/master/eslint.config.mjs"
    click Env "https://github.com/recallai/meeting-direct-connect/blob/master/package.json"
    click Env "https://github.com/recallai/meeting-direct-connect/blob/master/package-lock.json"
    click BackendStatic "https://github.com/recallai/meeting-direct-connect/tree/master/public/"

    %% Styles
    classDef frontend fill:#D0E6A5,stroke:#4F8A10,color:#333,stroke-width:2px;
    classDef backend fill:#A0C4FF,stroke:#26547C,color:#333,stroke-width:2px;
    classDef external fill:#FFADAD,stroke:#D00000,color:#333,stroke-width:2px,stroke-dasharray: 5 5;
    classDef config fill:#FFD6A5,stroke:#E85D04,color:#333,stroke-width:2px;
```
