# ramg-reddy/doom architecture

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

- Interactive diagram: https://gitdiagram.com/ramg-reddy/doom
- Repository: https://github.com/ramg-reddy/doom

## Overview

##### Main Components

A. Client-Side (Frontend) Layer:
- Next.js App Router Structure (shown by the nested app directory)
- Authentication Routes (/app/(auth))
- Main Application Routes (/app/(root))
- Real-time Video Components
- UI Components Layer

B. Server-Side Layer:
- Next.js API Routes
- Stream SDK Integration
- Authentication Services
- Database Services

C. External Services:
- Clerk Authentication
- Stream Video Services
- MongoDB Database
- AI Summarization Service

**[Client Layer]**
- ↑↓
**[Application Layer]**
- ↑↓
**[Data & External Services Layer]**

##### Detailed Component Breakdown

Client Layer (Top):
- Authentication UI (sign-in, sign-up)
- Meeting Room Components
- Video Controls
- Recording Management
- Navigation Components
- Blue: Core UI components
- Green: Video streaming components
- Yellow: Authentication components

Application Layer (Middle):
- Next.js Server Components
- Stream Client Provider
- API Routes
- Middleware
- Action Handlers
- Purple: Server components
- Orange: API routes
- Red: Middleware

Data & External Services Layer (Bottom):
- Clerk Auth Service
- Stream Video Service
- MongoDB Database
- AI Summarization Service
- Gray: External services
- Dark blue: Database
- Light green: AI services

##### Connection Flows

- Authentication flow
- Video streaming flow
- Data persistence flow
- API communication paths
- Real-time communication channels

##### Additional Details

- Separation between server and client components
- Where TypeScript types are enforced
- Areas where Tailwind CSS is applied
- Security boundaries
- Where middleware intercepts requests

##### Technical Stack Indicators

Technology badges for:
- Next.js 14
- Stream
- Clerk
- MongoDB
- TypeScript
- Tailwind CSS
- ShadCn

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Auth[Authentication UI]
        MeetingRoom[Meeting Room UI]:::video
        VideoControls[Video Controls]:::video
        RecordingMgmt[Recording Management]:::ui
        Nav[Navigation Components]:::ui
        UICore[Core UI Components]:::ui
    end

    subgraph Server
        NextServer[Next.js Server Components]:::server
        StreamProvider[Stream Client Provider]:::server
        APIRoutes[API Routes]:::api
        Middleware[Authentication Middleware]:::security
        ActionHandlers[Action Handlers]:::server
    end

    subgraph External
        Clerk[Clerk Auth Service]:::external
        StreamVideo[Stream Video Service]:::external
        MongoDB[MongoDB Database]:::database
        AI[AI Summarization Service]:::external
    end

    %% Connections
    Auth --> Middleware
    Middleware --> Clerk
    MeetingRoom --> StreamProvider
    StreamProvider --> StreamVideo
    VideoControls --> StreamProvider
    ActionHandlers --> MongoDB
    APIRoutes --> ActionHandlers
    RecordingMgmt --> APIRoutes
    Nav --> NextServer
    UICore --> NextServer

    %% Click Events
    click Auth "https://github.com/ramG-reddy/Doom/tree/main//app/(auth)"
    click MeetingRoom "https://github.com/ramG-reddy/Doom/blob/main//components/MeetingRoom.tsx"
    click VideoControls "https://github.com/ramG-reddy/Doom/blob/main//components/EndCallButton.tsx"
    click Nav "https://github.com/ramG-reddy/Doom/blob/main//components/Navbar.tsx"
    click UICore "https://github.com/ramG-reddy/Doom/tree/main//components/ui"
    click Middleware "https://github.com/ramG-reddy/Doom/blob/main//middleware.ts"
    click StreamProvider "https://github.com/ramG-reddy/Doom/blob/main//providers/StreamClientProvider.tsx"
    click ActionHandlers "https://github.com/ramG-reddy/Doom/blob/main//actions/stream.actions.ts"

    %% Styles
    classDef ui fill:#3498db
    classDef video fill:#2ecc71
    classDef server fill:#9b59b6
    classDef api fill:#e67e22
    classDef security fill:#e74c3c
    classDef external fill:#95a5a6
    classDef database fill:#2c3e50

    %% Legend
    subgraph Legend
        L1[UI Components]:::ui
        L2[Video Components]:::video
        L3[Server Components]:::server
        L4[API Routes]:::api
        L5[Security]:::security
        L6[External Services]:::external
        L7[Database]:::database
    end
```
