# zilurrane/life-meet architecture

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

- Interactive diagram: https://gitdiagram.com/zilurrane/life-meet
- Repository: https://github.com/zilurrane/life-meet

## Overview

1. Frontend – A React/TypeScript single-page application that handles the user interface and interacts with all the meeting features (video/audio, whiteboard, chat, file sharing, and graph plotter).
2. Server – A Node.js backend that follows a Domain-Driven Design (DDD) or modular “use-case” approach. It is further organized into multiple modules for different features (accounts, chat, meeting, user) each subdivided into domains, DTOs, use cases, mappers, routes, and repositories. The backend leverages integrations like Docker Compose for MongoDB, Redis, and possibly mediasoup for handling media conference interactions.

##### Main Components
- Frontend Application: Emphasize React-based UI components, module structure (account, chat, canvas, media, meeting, user), shared services, and configuration. Also illustrate the role of the Dockerfile and Nginx configuration in the frontend’s docker deployment.
- Server Application: Identify core modules broken by feature (e.g., account, chat, meeting, user) alongside shared utilities (logging, error handling, middleware). Also note the use cases following the DDD pattern, HTTP routes for REST endpoints, and integration with services such as mediasoup (for media routing), email services, and file storage.

##### Relationships and Interactions
- Server Internal Interactions:
- Present how the server modules interact. For example, show the flow from controllers receiving HTTP requests to invoking use cases, which then interact with the domain entities, repositories, and may trigger mediating services (like notification, email, or media management).

##### Architectural Patterns and Design Principles
- Modular structure (each feature is essentially a separate module with a clear separation of concerns).
- Use-case driven design: Each module defines use cases (e.g., createMeeting, deleteMeeting) with controllers, DTOs, and error handling, suggesting a clean layered architecture.
- Containerization: Both frontend and server are dockerized, with Dockerfiles and docker-compose scripts facilitating deployment.
- Separation of concerns: Frontend manages view components and state (with modules for media, chat, meeting, etc.); the backend is segmented into clearly defined domains that manage business logic.

##### Relevant Technologies and Frameworks
- Frontend: React, TypeScript, CSS, and npm tooling.
- Backend: Node.js, Express-like HTTP frameworks (implied by the setup in app.ts and route files), Jest for testing and integration with Docker for deploying MongoDB and Redis.
- Infrastructure: Docker, Docker Compose, Nginx (for serving the frontend), and possibly version control workflows from GitHub Actions.

##### Elements
- Clear labels: Make sure each component – such as “React Frontend”, “Backend API Gateway”, and individual backend modules (account, chat, meeting, user) – is labeled.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend Layer"
        F1["React Frontend"]:::frontend
        F2["Main App (App.tsx)"]:::frontend
        F1 --> F2
        subgraph "Frontend Modules"
            F_Acc["Account Module"]:::frontend
            F_Canvas["Canvas Module"]:::frontend
            F_Chat["Chat Module"]:::frontend
            F_Media["Media Module"]:::frontend
            F_Meet["Meeting Module"]:::frontend
            F_User["User Module"]:::frontend
        end
        F2 --> F_Acc
        F2 --> F_Canvas
        F2 --> F_Chat
        F2 --> F_Media
        F2 --> F_Meet
        F2 --> F_User
    end

    subgraph "Frontend Deployment"
        F_Docker["Dockerfile (Frontend)"]:::deployment
        F_Nginx["Nginx Config"]:::deployment
        F_CICD["CI/CD Workflow (Frontend)"]:::deployment
        F1 --> F_Docker
        F1 --> F_Nginx
        F1 --> F_CICD
    end

    subgraph "Backend Layer"
        B1["Node.js Server"]:::backend
        B2["Entry Point (index.ts)"]:::backend
        B1 --> B2

        subgraph "Backend Modules"
            B_Acc["Account Module (Server)"]:::module
            B_Chat["Chat Module (Server)"]:::module
            B_Meet["Meeting Module (Server)"]:::module
            B_User["User Module (Server)"]:::module
        end
        B1 --> B_Acc
        B1 --> B_Chat
        B1 --> B_Meet
        B1 --> B_User

        B_Shared["Shared Infrastructure"]:::shared
        B1 --> B_Shared
        API["HTTP API (app.ts)"]:::shared
        B_Shared --> API
        B_DB["DB Connection"]:::shared
        B_Redis["Redis Connection"]:::shared
        API --> B_DB
        API --> B_Redis
        B_DB --> DB["MongoDB"]:::database
        B_Redis --> Cache["Redis"]:::cache

        MSoup["Mediasoup Service"]:::module
        B_Meet --> MSoup
    end

    subgraph "Backend Integrations"
        BC["Docker Compose (Server)"]:::deployment
        BS["Startup Script"]:::deployment
        BE["Env Template (Server)"]:::deployment
        B_CICD["CI/CD Workflow (Server)"]:::deployment
        B1 --> BC
        B1 --> BS
        B1 --> BE
        B1 --> B_CICD
    end

    F1 ---|"REST_API/WebSocket"| B1

    classDef frontend fill:#FCEABB,stroke:#F08,stroke-width:2px;
    classDef backend fill:#BBF,stroke:#08F,stroke-width:2px;
    classDef module fill:#CFC,stroke:#080,stroke-width:2px;
    classDef shared fill:#FFF,stroke:#999,stroke-width:2px;
    classDef deployment fill:#EEF,stroke:#55F,stroke-width:2px;
    classDef database fill:#FFE,stroke:#AA0,stroke-width:2px;
    classDef cache fill:#EFE,stroke:#0A0,stroke-width:2px;

    click F1 "https://github.com/zilurrane/life-meet/tree/main/frontend/"
    click F2 "https://github.com/zilurrane/life-meet/blob/main/frontend/src/App.tsx"
    click F_Acc "https://github.com/zilurrane/life-meet/tree/main/frontend/src/modules/account/"
    click F_Canvas "https://github.com/zilurrane/life-meet/tree/main/frontend/src/modules/canvas/"
    click F_Chat "https://github.com/zilurrane/life-meet/tree/main/frontend/src/modules/chat/"
    click F_Media "https://github.com/zilurrane/life-meet/tree/main/frontend/src/modules/media/"
    click F_Meet "https://github.com/zilurrane/life-meet/tree/main/frontend/src/modules/meeting/"
    click F_User "https://github.com/zilurrane/life-meet/tree/main/frontend/src/modules/user/"
    click F_Docker "https://github.com/zilurrane/life-meet/tree/main/frontend/docker/Dockerfile"
    click F_Nginx "https://github.com/zilurrane/life-meet/blob/main/frontend/docker/nginx.conf"
    click F_CICD "https://github.com/zilurrane/life-meet/blob/main/.github/workflows/frontend-docker.yml"
    click B1 "https://github.com/zilurrane/life-meet/tree/main/server/"
    click B2 "https://github.com/zilurrane/life-meet/blob/main/server/src/index.ts"
    click B_Shared "https://github.com/zilurrane/life-meet/tree/main/server/src/shared/"
    click API "https://github.com/zilurrane/life-meet/blob/main/server/src/shared/infra/http/app.ts"
    click B_DB "https://github.com/zilurrane/life-meet/blob/main/server/src/shared/infra/db/connection.ts"
    click B_Redis "https://github.com/zilurrane/life-meet/blob/main/server/src/shared/services/redis/redisConnection.ts"
    click B_Acc "https://github.com/zilurrane/life-meet/tree/main/server/src/modules/account/"
    click B_Chat "https://github.com/zilurrane/life-meet/tree/main/server/src/modules/chat/"
    click B_Meet "https://github.com/zilurrane/life-meet/tree/main/server/src/modules/meeting/"
    click B_User "https://github.com/zilurrane/life-meet/tree/main/server/src/modules/user/"
    click MSoup "https://github.com/zilurrane/life-meet/tree/main/server/src/modules/meeting/services/mediasoup/"
    click BC "https://github.com/zilurrane/life-meet/blob/main/server/integrations/docker-compose.yml"
    click BS "https://github.com/zilurrane/life-meet/blob/main/server/integrations/start.sh"
    click BE "https://github.com/zilurrane/life-meet/blob/main/server/integrations/.env.template"
    click B_CICD "https://github.com/zilurrane/life-meet/blob/main/.github/workflows/server.yml"
```
