# abhinavborah/loom-video-conference architecture

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

- Interactive diagram: https://gitdiagram.com/abhinavborah/loom-video-conference
- Repository: https://github.com/abhinavborah/loom-video-conference

## Overview

##### Project type and purpose
- This is a full-stack React/Next.js (App Router) web application bootstrapped with Create Next App.
- From the file tree and UI names (MeetingRoom, CallList, StreamClientProvider, stream.actions.ts), it’s clearly a video/audio call scheduling and room application that uses a third-party streaming service (Stream).

##### File structure
- Top-level “app” directory: Next.js 13+ App Router layout, routing, and page.tsx files for auth (sign-in, sign-up), home (personal-room, recordings, upcoming, etc.), and dynamic meeting pages by ID.
- “components/ui”: reusable presentational React components (buttons, cards, modals, navbar, sidebar).
- “actions/stream.actions.ts”: wrappers around HTTP calls (fetch/POST) to the streaming service’s API.
- “hooks”: custom React hooks (useGetCalls, useGetCallById) that encapsulate data fetching logic and internal state.
- “providers/StreamClientProvider.tsx”: React Context provider that instantiates the streaming client and makes it available throughout the component tree.
- “lib/utils.ts” & “constants/index.ts”: shared utility functions and constants (endpoints, keys).
- “middleware.ts”: Next.js middleware (likely for auth checks or request logging).
- Configuration & styling: next.config.mjs, tailwind.config.ts, postcss.config.js, globals.css.

##### README for additional insights
- Standard Next.js docs are referenced; no custom deployment details beyond Vercel.
- No built-in database code—data persistence is off-loaded to the external streaming service.

##### Key components and their relationships
a. Client Browser (user)
b. Next.js Frontend – App Router
- Server‐side rendering (SSR) / static rendering (SSG) for initial loads
- Client‐side React hydration
c. UI Component Layer (components/ui)
d. State + Data Layer
- Providers (StreamClientProvider)
- Hooks (useGetCalls, useGetCallById)
- Action modules (stream.actions.ts)
e. External Streaming Service API (e.g., Stream)
f. CDN / Static Asset Hosting (public/, Next.js optimization)
g. Middleware Layer (middleware.ts) – for auth enforcement or request transforms

##### Architectural patterns & design principles
- Layered architecture: Presentation (UI) → Application (routing + hooks) → Infrastructure (actions → external API)
- Separation of concerns:
- “app” handles routing and server/client renders
- UI components solely for visuals and props
- Hooks encapsulate data-fetching logic
- Actions modules wrap all HTTP calls to the external service
- Context Provider for streaming client injection (inversion of control)
- Next.js conventions (App Router, file‐based routing, server/client components)

## Diagram (Mermaid)

```mermaid
flowchart TD
  subgraph "Client Browser"
    B["Browser"]:::client
  end

  B -->|HTTP request| M["middleware.ts"]:::server

  subgraph "App Router: Routing & Pages"
    LAYOUT1["app/layout.tsx"]:::server
    SIGNIN["sign-in page\napp/(auth)/sign-in/[[...sign-in]]/page.tsx"]:::server
    SIGNUP["sign-up page\napp/(auth)/sign-up/[[...sign-up]]/page.tsx"]:::server
    ROOTLAYOUT["app/(root)/layout.tsx"]:::server
    HOME["home page\napp/(root)/(home)/page.tsx"]:::server
    PERSONAL["personal-room\napp/(root)/(home)/personal-room/page.tsx"]:::server
    PREV["previous\napp/(root)/(home)/previous/page.tsx"]:::server
    REC["recordings\napp/(root)/(home)/recordings/page.tsx"]:::server
    UPC["upcoming\napp/(root)/(home)/upcoming/page.tsx"]:::server
    MEET["meeting page\napp/(root)/meeting/[id]/page.tsx"]:::server

    M --> LAYOUT1
    LAYOUT1 --> SIGNIN
    LAYOUT1 --> SIGNUP
    LAYOUT1 --> ROOTLAYOUT
    ROOTLAYOUT --> HOME
    HOME --> PERSONAL
    HOME --> PREV
    HOME --> REC
    HOME --> UPC
    ROOTLAYOUT --> MEET
  end

  subgraph "Next.js Server (SSR)"
    SIGNIN --> SA["actions/stream.actions.ts"]:::server
    SIGNUP --> SA
    PERSONAL --> SA
    PREV --> SA
    REC --> SA
    UPC --> SA
    MEET --> SA
    SA -->|HTTP fetch| SAPI[(Streaming Service API)]:::external
    SAPI -->|response| SA
    SA -->|data| ROOTLAYOUT
    ROOTLAYOUT -->|render HTML+JSON| B
  end

  subgraph "CDN / Static Assets"
    Static["public/ & Optimized Assets"]:::cdn
    ROOTLAYOUT --> Static
    Static --> B
  end

  B -->|hydrate| CR["Next.js Client\n(React)"]:::client

  subgraph "Client-side React"
    CR --> Prov["providers/StreamClientProvider.tsx"]:::client
    Prov --> Hooks["hooks/useGetCalls.ts\nhooks/useGetCallById.ts"]:::client
    Prov --> UI["components/ui"]:::client
    Hooks -->|client fetch| SA
  end

  subgraph "UI Components"
    CL["CallList"]:::client
    ECB["EndCallButton"]:::client
    HC["HomeCard"]:::client
    LD["Loader"]:::client
    MC["MeetingCard"]:::client
    MM["MeetingModal"]:::client
    MR["MeetingRoom"]:::client
    MS["MeetingSetup"]:::client
    MTL["MeetingTypeList"]:::client
    MN["MobileNav"]:::client
    NB["Navbar"]:::client
    SB["Sidebar"]:::client
    BTN["button"]:::client
    DLG["dialog"]:::client
    DM["dropdown-menu"]:::client
    IN["input"]:::client
    SH["sheet"]:::client
    TA["textarea"]:::client
    TO["toast"]:::client
    TR["toaster"]:::client
    UT["use-toast"]:::client
    UI --> CL --> ECB --> HC --> LD --> MC --> MM --> MR --> MS --> MTL --> MN --> NB --> SB --> BTN --> DLG --> DM --> IN --> SH --> TA --> TO --> TR --> UT
  end

  classDef client fill:#c6f6d5,stroke:#2f855a,color:#22543d
  classDef server fill:#bee3f8,stroke:#3182ce,color:#2a4365
  classDef external fill:#fbd38d,stroke:#dd6b20,color:#9c4221
  classDef cdn fill:#faf089,stroke:#d69e2e,color:#975a16

  click M "https://github.com/abhinavborah/loom-video-conference/blob/main/middleware.ts"
  click LAYOUT1 "https://github.com/abhinavborah/loom-video-conference/blob/main/app/layout.tsx"
  click SIGNIN "https://github.com/abhinavborah/loom-video-conference/blob/main/app/(auth)/sign-in/[[...sign-in]]/page.tsx"
  click SIGNUP "https://github.com/abhinavborah/loom-video-conference/blob/main/app/(auth)/sign-up/[[...sign-up]]/page.tsx"
  click ROOTLAYOUT "https://github.com/abhinavborah/loom-video-conference/blob/main/app/(root)/layout.tsx"
  click HOME "https://github.com/abhinavborah/loom-video-conference/blob/main/app/(root)/(home)/page.tsx"
  click PERSONAL "https://github.com/abhinavborah/loom-video-conference/blob/main/app/(root)/(home)/personal-room/page.tsx"
  click PREV "https://github.com/abhinavborah/loom-video-conference/blob/main/app/(root)/(home)/previous/page.tsx"
  click REC "https://github.com/abhinavborah/loom-video-conference/blob/main/app/(root)/(home)/recordings/page.tsx"
  click UPC "https://github.com/abhinavborah/loom-video-conference/blob/main/app/(root)/(home)/upcoming/page.tsx"
  click MEET "https://github.com/abhinavborah/loom-video-conference/blob/main/app/(root)/meeting/[id]/page.tsx"
  click SA "https://github.com/abhinavborah/loom-video-conference/blob/main/actions/stream.actions.ts"
  click Hooks "https://github.com/abhinavborah/loom-video-conference/blob/main/hooks/useGetCalls.ts"
  click Hooks "https://github.com/abhinavborah/loom-video-conference/blob/main/hooks/useGetCallById.ts"
  click Prov "https://github.com/abhinavborah/loom-video-conference/blob/main/providers/StreamClientProvider.tsx"
  click UI "https://github.com/abhinavborah/loom-video-conference/tree/main/components/ui"
  click CL "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/CallList.tsx"
  click ECB "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/EndCallButton.tsx"
  click HC "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/HomeCard.tsx"
  click LD "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/Loader.tsx"
  click MC "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/MeetingCard.tsx"
  click MM "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/MeetingModal.tsx"
  click MR "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/MeetingRoom.tsx"
  click MS "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/MeetingSetup.tsx"
  click MTL "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/MeetingTypeList.tsx"
  click MN "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/MobileNav.tsx"
  click NB "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/Navbar.tsx"
  click SB "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/Sidebar.tsx"
  click BTN "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/button.tsx"
  click DLG "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/dialog.tsx"
  click DM "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/dropdown-menu.tsx"
  click IN "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/input.tsx"
  click SH "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/sheet.tsx"
  click TA "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/textarea.tsx"
  click TO "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/toast.tsx"
  click TR "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/toaster.tsx"
  click UT "https://github.com/abhinavborah/loom-video-conference/blob/main/components/ui/use-toast.ts"
  click Static "https://github.com/abhinavborah/loom-video-conference/blob/main/app/globals.css"
  click Static "https://github.com/abhinavborah/loom-video-conference/blob/main/next.config.mjs"
  click Static "https://github.com/abhinavborah/loom-video-conference/blob/main/tailwind.config.ts"
  click Static "https://github.com/abhinavborah/loom-video-conference/blob/main/postcss.config.js"
  click Static "https://github.com/abhinavborah/loom-video-conference/blob/main/tsconfig.json"
  click Static "https://github.com/abhinavborah/loom-video-conference/tree/main/public/"
  click Static "https://github.com/abhinavborah/loom-video-conference/tree/main/Optimized Assets"
  click SAPI "https://github.com/abhinavborah/loom-video-conference/tree/main/Streaming Service API"
```
