# cuemeet/meeting-bots-control-panel architecture

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

- Interactive diagram: https://gitdiagram.com/cuemeet/meeting-bots-control-panel
- Repository: https://github.com/cuemeet/meeting-bots-control-panel

## Overview

##### Project Type and Purpose
- The project is a full-stack backend system that serves as a centralized management tool for meeting bots. It is designed to control and monitor multiple meeting bot integrations (for Google Meet, MS Teams, Zoom, etc.) via a control panel.
- The README confirms that its main functions include real-time monitoring, bot configuration, secure access, and comprehensive logging.

##### Core Components from the File Structure
- Two Distinct Backend Services:
– api-backend: A Node.js service built using NestJS. It includes components like authentication (auth), AWS integrations (ecs, aws service), cron jobs, database models, GRPC support, and a dedicated DTO layer.
– worker-backend: A Python-based service (using Django – as evidenced by the manage.py file, migrations, and Django-style project layout) that manages API interactions, transcript management, asynchronous tasks (likely using Celery as seen in the celery.py file), and GRPC endpoints.

- Database (pg-db):
– A Postgres database is indicated by the "pg-db" folder. It includes environment and SQL initialization files that set up multiple databases. This is likely the central data store used by both backend services.

- Shared Protocol Definitions (protos):
– The protos directory contains protocol buffer files (e.g., transcript_management.proto) used for GRPC communication between components.

##### Relationships & Interactions
- The API Backend (NestJS) likely acts as the primary interface for client requests (e.g., from the Control Panel UI, possibly hosted elsewhere or integrated into the same system).
- It interfaces with the PostgreSQL database for CRUD operations, authentication, configuration data, and logging.
- There is integration with AWS services (such as ECS for container management) as seen from the AWS modules, where the API service may deploy or control meeting bots.
- Both services have GRPC modules – indicating cross-service communication. The shared protos also suggest a common data-contract is used for interactions between the API backend and worker processes.
- Worker Backend handles asynchronous, heavy-lift tasks (like transcript management) and may interact with external systems (e.g., meeting platforms) or handle background processes triggered by API Backend events.

##### Essential Architectural Patterns and Technologies
- Use of modular architecture: Both backends are divided into clearly defined modules (auth, AWS, bot, cron-job, database for API backend; and similarly structured modules in worker-backend).
- Separation of concerns: API layer (handling user requests, authentication, configuration) is separated from background job processing (handled by worker-backend).
- Microservices/multi-service interaction: While this might be a single repository, the existence of two service directories and a shared protos contract hint at a distributed architecture.
- Utilization of containerization: Each service has its own Dockerfile, which means they are designed to be deployed separately in containers.
- Use of asynchronous processing: The cron jobs, celery (in worker-backend), and GRPC communications emphasize asynchronous event-driven processing.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Entities
    Client["Control Panel Client"]:::client

    %% API Backend (NestJS Service)
    subgraph "API Backend (NestJS Service)"
        A1["Authentication Module"]:::node1
        A2["AWS Integration"]:::node1
        A3["Bot Management"]:::node1
        A4["Database Access"]:::node1
        A5["GRPC Gateway"]:::node1
        A6["Cron Jobs"]:::node1
        A7["DTO Layer"]:::node1
    end

    %% Worker Backend (Python/Django Service)
    subgraph "Worker Backend (Python/Django Service)"
        W1["Transcript Management Module"]:::node2
        W2["GRPC Endpoints"]:::node2
        W3["Asynchronous Task Handling (Celery)"]:::node2
        W4["Admin/API Interfaces"]:::node2
    end

    %% Database
    subgraph "Database"
        DB["PostgreSQL (pg-db)"]:::db
    end

    %% Shared Communication Layer
    subgraph "Shared Communication"
        P["Protocol Buffers"]:::proto
    end

    %% Connections and Data Flow
    Client -->|"requests"| A5
    A5 -->|"auth"| A1
    A5 -->|"bot-commands"| A3
    A5 -->|"grpc-calls"| W2
    A2 -->|"aws-commands"| A5
    A6 -->|"scheduled"| A3
    A7 -->|"data-transfer"| A4
    A4 -->|"CRUD"| DB
    W2 -->|"async-responses"| W1
    W1 -->|"tasks-update"| W3
    W4 -->|"admin-trigger"| W1
    W1 -->|"logs-data"| DB
    A5 -->|"protocol-use"| P
    W2 -->|"protocol-use"| P

    %% Click Events - API Backend (NestJS Service)
    click A1 "https://github.com/cuemeet/meeting-bots-control-panel/tree/main/api-backend/src/auth"
    click A2 "https://github.com/cuemeet/meeting-bots-control-panel/tree/main/api-backend/src/aws"
    click A3 "https://github.com/cuemeet/meeting-bots-control-panel/tree/main/api-backend/src/bot"
    click A4 "https://github.com/cuemeet/meeting-bots-control-panel/tree/main/api-backend/src/database"
    click A5 "https://github.com/cuemeet/meeting-bots-control-panel/tree/main/api-backend/src/grpc"
    click A6 "https://github.com/cuemeet/meeting-bots-control-panel/tree/main/api-backend/src/cron-job"
    click A7 "https://github.com/cuemeet/meeting-bots-control-panel/tree/main/api-backend/src/dto"

    %% Click Events - Worker Backend (Python/Django Service)
    click W1 "https://github.com/cuemeet/meeting-bots-control-panel/tree/main/worker-backend/api/transcript_management"
    click W2 "https://github.com/cuemeet/meeting-bots-control-panel/tree/main/worker-backend/api/transcript_management/grpc"
    click W3 "https://github.com/cuemeet/meeting-bots-control-panel/tree/main/worker-backend/worker_backend/celery"
    click W4 "https://github.com/cuemeet/meeting-bots-control-panel/tree/main/worker-backend/api"

    %% Click Events - Database
    click DB "https://github.com/cuemeet/meeting-bots-control-panel/tree/main/pg-db"

    %% Click Events - Shared Protocol Definitions
    click P "https://github.com/cuemeet/meeting-bots-control-panel/blob/main/protos/worker_backend.transcript_management/transcript_management.proto"

    %% Styles
    classDef client fill:#f9c74f,stroke:#333,stroke-width:2px;
    classDef node1 fill:#90be6d,stroke:#333,stroke-width:2px;
    classDef node2 fill:#f8961e,stroke:#333,stroke-width:2px;
    classDef db fill:#f94144,stroke:#333,stroke-width:2px,stroke-dasharray: 5 5;
    classDef proto fill:#277da1,stroke:#333,stroke-width:2px;
```
