# lunatic2good/video-conferencing-app architecture

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

- Interactive diagram: https://gitdiagram.com/lunatic2good/video-conferencing-app
- Repository: https://github.com/lunatic2good/video-conferencing-app

## Overview

##### Project type and purpose
- This is a full-stack Next.js (v13+) web application built with the App Router.
- It provides user authentication (sign-in/sign-up), meeting scheduling (upcoming, previous, personal room), and real-time call/recording features via the Stream API.

##### File structure
- Top-level “app/” directory holds all route handlers and layouts (Auth, Home, Meeting).
- “components/” contains reusable UI elements (buttons, lists, modals, pages).
- “components/ui/” houses low-level primitives (button, input, dropdown, toast).
- “hooks/” encapsulates data fetching logic (`useGetCalls`, `useGetCallById`, `useToast`).
- “providers/StreamClientProvider.tsx” wraps the app with Stream’s SDK client context.
- “actions/stream.actions.ts” defines direct calls to Stream’s REST/JS SDK for room creation, joining, etc.
- “middleware.ts” enforces auth on server-rendered routes.
- CSS & config: Tailwind + PostCSS configs, global stylesheet, font loading, and Next config.

##### Extract README insights
- Bootstrapped with `create-next-app`, uses Next.js built-in font optimization and recommends Vercel for deployment.
- No custom architecture docs—everything is implicit in file structure.

##### Detail
- Flow of data from user interaction all the way through action calls to the external Stream service and back.
- Don’t omit the middleware/auth step or the static assets/CDN layer.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Client Side
    subgraph "Browser (Client)" 
        direction TB
        Browser["User Browser"]:::frontend
    end

    %% React Application Layer
    subgraph "React App" 
        direction TB
        subgraph "App Router Layouts" 
            direction TB
            GlobalLayout["Global Layout"]:::frontend
            RootLayout["Root (Authenticated) Layout"]:::frontend
        end

        subgraph "Home Section" 
            direction TB
            HomeLayout["Home Layout"]:::frontend
            HomePage["Home Dashboard Page"]:::frontend
            Upcoming["Upcoming Meetings Page"]:::frontend
            Previous["Previous Meetings Page"]:::frontend
            Recordings["Recordings Page"]:::frontend
            PersonalRoom["Personal Room Page"]:::frontend
        end

        subgraph "Auth Section" 
            direction TB
            SignIn["Sign-In Page"]:::frontend
            SignUp["Sign-Up Page"]:::frontend
        end

        subgraph "Meeting Section" 
            direction TB
            MeetingRoomPage["Meeting Room by ID Page"]:::frontend
        end

        subgraph "UI Components" 
            direction TB
            CallList["CallList"]:::frontend
            MeetingCard["MeetingCard"]:::frontend
            MeetingModal["MeetingModal"]:::frontend
            MeetingRoomComp["MeetingRoom"]:::frontend
            MeetingSetup["MeetingSetup"]:::frontend
            HomeCard["HomeCard"]:::frontend
            MeetingTypeList["MeetingTypeList"]:::frontend
            Loader["Loader"]:::frontend
            EndCallButton["EndCallButton"]:::frontend
            MobileNav["MobileNav"]:::frontend
            Navbar["Navbar"]:::frontend
            Sidebar["Sidebar"]:::frontend
        end

        subgraph "UI Primitives" 
            direction TB
            Button["Button"]:::frontend
            Input["Input"]:::frontend
            Dropdown["DropdownMenu"]:::frontend
            Dialog["Dialog"]:::frontend
            Sheet["Sheet"]:::frontend
            Textarea["Textarea"]:::frontend
            Toast["Toast"]:::frontend
            Toaster["Toaster"]:::frontend
        end

        subgraph "Context Providers" 
            direction TB
            StreamProvider["StreamClientProvider"]:::frontend
        end

        subgraph "Hooks (Data Fetching)" 
            direction TB
            GetCalls["useGetCalls"]:::data
            GetCallById["useGetCallById"]:::data
            UseToast["use-toast"]:::data
        end
    end

    %% Server Side
    subgraph "Next.js Server" 
        direction TB
        Middleware["middleware.ts"]:::server
        SSR["SSR/Route Handlers"]:::server
    end

    subgraph "Action Layer" 
        direction TB
        StreamActions["stream.actions.ts"]:::data
    end

    %% External Services
    subgraph "External Services" 
        direction TB
        StreamAPI["Stream API"]:::external
        AuthService["Auth Service"]:::external
        CDN["CDN / Static Assets"]:::external
    end

    %% Config & Styles
    subgraph "Global Config & Styles" 
        direction TB
        GlobalsCSS["globals.css"]:::server
        TailwindConfig["tailwind.config.ts"]:::server
        PostCSSConfig["postcss.config.mjs"]:::server
        NextConfig["next.config.js"]:::server
    end

    %% Connections
    Browser -->|"HTTP Request"| SSR
    SSR -->|uses| Middleware
    SSR -->|renders| GlobalLayout
    GlobalLayout --> RootLayout
    RootLayout --> HomeLayout
    HomeLayout --> HomePage
    HomeLayout --> Upcoming
    HomeLayout --> Previous
    HomeLayout --> Recordings
    HomeLayout --> PersonalRoom
    RootLayout --> MeetingRoomPage
    GlobalLayout --> SignIn
    GlobalLayout --> SignUp

    HomePage -->|renders| CallList
    HomePage -->|renders| HomeCard
    Upcoming -->|renders| MeetingCard
    Previous -->|renders| MeetingCard
    Recordings -->|renders| MeetingCard
    PersonalRoom -->|renders| MeetingSetup
    MeetingRoomPage -->|renders| MeetingRoomComp

    SignIn -->|uses| Input
    SignIn -->|uses| Button
    SignUp -->|uses| Input
    SignUp -->|uses| Button

    AnyComp((any component)) -->|uses| Button
    AnyComp -->|uses| Input

    RootLayout --> Navbar
    RootLayout --> Sidebar
    RootLayout --> MobileNav

    StreamProvider -->|wraps| ReactApp[React App]
    ReactApp --> GetCalls
    ReactApp --> GetCallById
    ReactApp --> UseToast

    GetCalls -->|calls| StreamActions
    GetCallById -->|calls| StreamActions
    UseToast -->|internally uses| StreamActions

    StreamActions -->|REST/WebSocket| StreamAPI
    Middleware -->|auth check| AuthService
    SSR -->|serves assets| CDN

    %% Click Events
    click GlobalLayout "https://github.com/lunatic2good/video-conferencing-app/blob/main/app/layout.tsx"
    click RootLayout "https://github.com/lunatic2good/video-conferencing-app/blob/main/app/(root)/layout.tsx"
    click HomeLayout "https://github.com/lunatic2good/video-conferencing-app/blob/main/app/(root)/(home)/layout.tsx"
    click HomePage "https://github.com/lunatic2good/video-conferencing-app/blob/main/app/(root)/(home)/page.tsx"
    click SignIn "https://github.com/lunatic2good/video-conferencing-app/blob/main/app/(auth)/sign-in/[[...sign-in]]/page.tsx"
    click SignUp "https://github.com/lunatic2good/video-conferencing-app/blob/main/app/(auth)/sign-up/[[...sign-up]]/page.tsx"
    click Upcoming "https://github.com/lunatic2good/video-conferencing-app/blob/main/app/(root)/(home)/upcoming/page.tsx"
    click Previous "https://github.com/lunatic2good/video-conferencing-app/blob/main/app/(root)/(home)/previous/page.tsx"
    click Recordings "https://github.com/lunatic2good/video-conferencing-app/blob/main/app/(root)/(home)/recordings/page.tsx"
    click PersonalRoom "https://github.com/lunatic2good/video-conferencing-app/blob/main/app/(root)/(home)/personal-room/page.tsx"
    click MeetingRoomPage "https://github.com/lunatic2good/video-conferencing-app/blob/main/app/(root)/meeting/[id]/page.tsx"

    click CallList "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/CallList.tsx"
    click MeetingCard "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/MeetingCard.tsx"
    click MeetingModal "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/MeetingModal.tsx"
    click MeetingRoomComp "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/MeetingRoom.tsx"
    click MeetingSetup "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/MeetingSetup.tsx"
    click HomeCard "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/HomeCard.tsx"
    click MeetingTypeList "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/MeetingTypeList.tsx"
    click Loader "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/Loader.tsx"
    click EndCallButton "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/EndCallButton.tsx"
    click MobileNav "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/MobileNav.tsx"
    click Navbar "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/Navbar.tsx"
    click Sidebar "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/Sidebar.tsx"

    click Button "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/ui/button.tsx"
    click Input "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/ui/input.tsx"
    click Dropdown "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/ui/dropdown-menu.tsx"
    click Dialog "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/ui/dialog.tsx"
    click Sheet "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/ui/sheet.tsx"
    click Textarea "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/ui/textarea.tsx"
    click Toast "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/ui/toast.tsx"
    click Toaster "https://github.com/lunatic2good/video-conferencing-app/blob/main/components/ui/toaster.tsx"

    click StreamProvider "https://github.com/lunatic2good/video-conferencing-app/blob/main/providers/StreamClientProvider.tsx"
    click GetCalls "https://github.com/lunatic2good/video-conferencing-app/blob/main/hooks/useGetCalls.ts"
    click GetCallById "https://github.com/lunatic2good/video-conferencing-app/blob/main/hooks/useGetCallById.ts"
    click UseToast "https://github.com/lunatic2good/video-conferencing-app/blob/main/hooks/use-toast.ts"
    click StreamActions "https://github.com/lunatic2good/video-conferencing-app/blob/main/actions/stream.actions.ts"
    click Middleware "https://github.com/lunatic2good/video-conferencing-app/blob/main/middleware.ts"

    click CDN "https://github.com/lunatic2good/video-conferencing-app/tree/main/public/icons/"
    click CDN "https://github.com/lunatic2good/video-conferencing-app/tree/main/public/images/"
    click CDN "https://github.com/lunatic2good/video-conferencing-app/tree/main/app/fonts/"

    click GlobalsCSS "https://github.com/lunatic2good/video-conferencing-app/blob/main/app/globals.css"
    click TailwindConfig "https://github.com/lunatic2good/video-conferencing-app/blob/main/tailwind.config.ts"
    click PostCSSConfig "https://github.com/lunatic2good/video-conferencing-app/blob/main/postcss.config.mjs"
    click NextConfig "https://github.com/lunatic2good/video-conferencing-app/blob/main/next.config.js"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef server fill:#90EE90,stroke:#333,stroke-width:1px
    classDef external fill:#FFA500,stroke:#333,stroke-width:1px
    classDef data fill:#FFD700,stroke:#333,stroke-width:1px
```
