# attendee-labs/attendee architecture

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

- Interactive diagram: https://gitdiagram.com/attendee-labs/attendee
- Repository: https://github.com/attendee-labs/attendee

## Overview

##### Project type and purpose
- Attendee is a full-stack Django monolith that exposes a REST API for launching and managing “meeting bots” on Zoom, Google Meet, and Teams. It includes a web UI (Django templates + static files), an API layer (Django REST Framework), background workers (Celery), and adapters to external services (video conferences, transcription providers, payment processing).

##### File structure
- Top-level:
- `attendee/` – Django project settings, URL routing, WSGI/ASGI entrypoints
- `accounts/` – standard Django Auth + signup/login/email confirmation
- `bots/` – core “bots” app
– adapters (Zoom, Google Meet, Teams, web hooks)
– controller (media pipelines, audio/video managers)
– bot pod creation logic (Kubernetes integration)
– tasks (Celery jobs for launching, running, transcription, webhooks)
– serializers, API views, templates for the project UI
- Docker & deployment files (`Dockerfile`, `dev.docker-compose.yaml`, `heroku.yml`, `Procfile`)
- Configuration (`pyproject.toml`, `requirements.txt`, `Makefile`, `.github/workflows/ci.yml`)
- Documentation (`docs/`, `README.md`)

##### README for additional insights
- Single Docker image, requires only Postgres and Redis
- Uses Zoom OAuth, Chrome-based Google Meet, Teams SDK
- Transcription providers like Deepgram, AssemblyAI, etc.
- Celery for async tasks, Stripe for billing, AWS for storage (via env vars)

##### Main components
a. Client Applications
– Developers calling the REST API (`/api/v1/bots`, `/bots/<id>/transcript`)
– Web UI (Django templates + JS) for managing API keys and credentials
b. Django Web App
– Gunicorn/Uvicorn serving both UI and JSON API
– Authentication layer (Token auth for API)
– `bots` app controllers & views
c. Database & Cache
– PostgreSQL (state, users, credentials, transcripts, billing)
– Redis (Celery broker + cache/webhook queue)
d. Background Workers
– Celery workers running tasks:
- Launching bot pods via Kubernetes API
- Managing streaming pipelines (gstreamer, Chrome drivers)
- Uploading media artifacts (to S3 or similar)
- Dispatching transcription jobs
- Sending webhooks on state changes
e. Bot Pod Infrastructure
– Kubernetes cluster (GKE) or Docker-Compose local pods
– Pod template containing the bot controller code + media pipeline
f. External Services
– Video Conference Providers (Zoom API, Google Meet via Chrome, Teams SDK)
– Transcription Providers (Deepgram, AssemblyAI, OpenAI Whisper, Google TTS)
– Payment/Billing (Stripe)
– Optional S3-compatible storage for recordings
g. Webhooks & Callbacks
– Outbound HTTP webhooks configured per project on state/transcription events

##### Relationships and interactions
1. Client → Django API (HTTP)
2. Django enqueues Celery task to launch a bot
3. Celery worker → Kubernetes API → new Bot Pod
4. Bot Pod connects to video service (Zoom/Meet/Teams)
5. Bot Pod streams audio/video through gstreamer pipeline
6. Bot Pod uploads media chunks to storage or relays them to transcription task queue
7. Celery worker picks up transcription tasks → calls external transcription API → stores transcript in DB
8. Celery worker sends webhook or updates DB state
9. Client polls or receives webhook and fetches transcript

##### Architectural patterns and design principles
- Monolithic Django codebase split into “apps” for modularity (accounts vs. bots)
- Asynchronous task queue (Celery + Redis) for long-running operations
- Adapter pattern for supporting multiple video and transcription providers
- Kubernetes as the execution environment for ephemeral, isolated bots
- Single Docker image for consistent deployment, with environment-specific settings

##### Detail
- Environment variables/config (e.g., Zoom client ID, Deepgram key)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Applications
    subgraph "Client Applications"
        direction TB
        API_Client["Developers (REST API)"]:::external
        Web_UI["Web UI (Django Templates + JS)"]:::frontend
    end

    %% Django Web App
    subgraph "Django Web App"
        direction TB
        Gunicorn["Gunicorn/Uvicorn"]:::internal
        Auth["Authentication Layer (Token Auth)"]:::internal
        API_Server["Django REST Framework API"]:::internal
        UI_Server["Django Templates UI"]:::internal
        Config["Django Config & Entrypoints"]:::internal
    end

    %% Database & Cache
    subgraph "Database & Cache"
        direction TB
        Postgres[(PostgreSQL)]:::db
        Redis[(Redis Broker & Cache)]:::infra
    end

    %% Background Workers
    subgraph "Background Workers"
        direction TB
        Celery_Workers["Celery Workers"]:::internal
    end

    %% Bot Pod Infrastructure
    subgraph "Bot Pod Infrastructure"
        direction TB
        Kubernetes["Kubernetes Cluster"]:::infra
        Bot_Pod["Bot Pod"]:::internal
    end

    %% External Services
    subgraph "External Services"
        direction TB
        Video["Video Providers"]:::external
        Transcription["Transcription Providers"]:::external
        Billing["Stripe Billing"]:::external
        Storage["S3 Storage"]:::external
    end

    %% Relationships
    API_Client -->|"POST /api/v1/bots"| API_Server
    Web_UI -->|"GET /bots/<id>/transcript"| UI_Server

    API_Server -->|Enqueue launch_bot_task| Celery_Workers
    Celery_Workers -->|"CALL Kubernetes API"| Kubernetes
    Kubernetes -->|Spawn Pod| Bot_Pod
    Bot_Pod -->|"CONNECT Zoom/Meet/Teams"| Video
    Bot_Pod -->|"Stream media chunks"| Celery_Workers
    Celery_Workers -->|"CALL Transcription API"| Transcription
    Transcription -->|Transcript JSON| Postgres
    Celery_Workers -->|"Update state & webhooks"| Postgres
    Celery_Workers -->|"Deliver webhook"| Billing
    Celery_Workers -->|"Upload recordings"| Storage

    API_Server -->|Read/Write| Postgres
    API_Server -->|Cache| Redis
    Celery_Workers -->|Broker| Redis

    API_Server -->|Auth config| Auth
    UI_Server -->|Auth config| Auth

    Config --> Gunicorn
    Config --> Auth
    Config --> API_Server
    Config --> UI_Server
    Config --> Celery_Workers

    %% Click Events
    click Config "https://github.com/attendee-labs/attendee/tree/main/attendee/"
    click Auth "https://github.com/attendee-labs/attendee/tree/main/accounts/"
    click API_Server "https://github.com/attendee-labs/attendee/tree/main/bots/"
    click UI_Server "https://github.com/attendee-labs/attendee/tree/main/bots/templates/projects/"
    click Celery_Workers "https://github.com/attendee-labs/attendee/blob/main/attendee/celery.py"
    click Kubernetes "https://github.com/attendee-labs/attendee/blob/main/bots/bot_pod_creator/bot_pod_creator.py"
    click Bot_Pod "https://github.com/attendee-labs/attendee/tree/main/bots/bot_controller/"
    click Billing "https://github.com/attendee-labs/attendee/blob/main/bots/stripe_utils.py"
    click Transcription "https://github.com/attendee-labs/attendee/blob/main/bots/transcription_providers/deepgram/deepgram_streaming_transcriber.py"
    click Video "https://github.com/attendee-labs/attendee/blob/main/bots/zoom_bot_adapter/zoom_bot_adapter.py"
    click Video "https://github.com/attendee-labs/attendee/blob/main/bots/google_meet_bot_adapter/google_meet_bot_adapter.py"
    click Video "https://github.com/attendee-labs/attendee/blob/main/bots/teams_bot_adapter/teams_bot_adapter.py"
    click Video "https://github.com/attendee-labs/attendee/blob/main/bots/web_bot_adapter/web_bot_adapter.py"
    click Celery_Workers "https://github.com/attendee-labs/attendee/blob/main/bots/tasks/run_bot_task.py"
    click Billing "https://github.com/attendee-labs/attendee/blob/main/bots/webhook_utils.py"
    click . "https://github.com/attendee-labs/attendee/tree/main/Dockerfile"

    %% Styles
    classDef internal fill:#D0E6FF,stroke:#0366d6,color:#0366d6;
    classDef external fill:#FFE5D4,stroke:#D65A31,color:#D65A31;
    classDef frontend fill:#E6FFE6,stroke:#28A745,color:#28A745;
    classDef db fill:#FFF5D7,stroke:#D6A800,color:#D6A800;
    classDef infra fill:#E8FFE8,stroke:#2F8F2F,color:#2F8F2F;
```
