# aashish037/meet architecture

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

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

## Overview

##### Project type and purpose
- This is a full-stack web application built on Next.js 13 (the new App Router), TypeScript, and Tailwind CSS.
- Its primary purpose is to support video/voice calls and meeting management (see `actions/stream.actions.ts`, `Hooks/useGetCalls.ts`, and pages under `app/(root)/meeting`).

##### File structure
- Top-level directories:
- `app/` contains your page hierarchy and layouts.
- `components/` holds all reusable UI pieces, including an `ui/` subdirectory for low-level primitives (buttons, inputs, dialogs, toasts).
- `Hooks/` provides custom React hooks for data fetching (`useGetCalls`, `useGetCallById`).
- `actions/` contains business-logic modules for interacting with the external Stream service.
- `providers/` offers React context providers (`StreamClientProvider.tsx`) wrapping the app with client instances.
- `lib/` for general utilities.
- Configuration files for ESLint, Tailwind, PostCSS, TypeScript, and Next.js.

##### README for additional insights
- Standard Next.js boilerplate; no built-in API routes in the tree, so all real-time functionality relies on an external streaming service (likely Stream’s SDK).

##### Main components and interactions
a. Client Browser / Frontend
- Pages (sign-in/up flows, home, personal room, upcoming/previous/recordings, meeting room)
- React components (UI primitives, MeetingRoom, MeetingSetup, CallList, etc.)
b. Next.js Server (Vercel Serverless Functions)
- SSR/SSG pipelines (App Router, `middleware.ts` for route protection)
- Environment configuration (`.env`, `next.config.mjs`)
- Build & deployment (`package.json`, PostCSS, Tailwind)
c. External Services
- Stream Video/Voice API (used by `actions/stream.actions.ts` and `StreamClientProvider`)
- Authentication Provider (could be NextAuth or custom, enforced in `middleware.ts`)

d. Data flow and relationships
1. User interacts with a Next.js page → React component renders UI.
2. Components call Hooks (e.g. `useGetCalls`) → invoke `actions/stream.actions.ts` under the hood.
3. `StreamClientProvider` supplies authenticated SDK client → directs requests to the Stream API endpoint.
4. Stream API returns call/session data → Hook updates component state → UI re-renders.
5. All pages pass through `middleware.ts` for route guarding (auth checks) before SSR.

##### Architectural patterns and design principles
- Separation of concerns:
- UI layer (components) vs. data-fetching layer (hooks & actions) vs. service provider (context)
- Atomic design in `components/ui/` for consistency
- App Router’s nested layouts (`app/(auth)`, `app/(root)/(home)`, etc.) mirror UI composition
- Serverless SSR/SSG for page delivery, with external API integration

##### Elements
- Clear, self-explanatory labels on each rectangle or container (e.g., “MeetingRoom Component”, “StreamVideo API”)
- user → pages
- pages → hooks/actions
- actions → external API
- API responses → hooks → components
- Blue rectangles for front-end modules
- Green for server-side/SSR components
- Orange for external services

##### Detail level guidance
- Your `app/` folder structure as nested containers to reflect the App Router’s layout inheritance.
- Where environment variables (from `.env`) feed into the Next.js server config and the Stream SDK instantiation.
- Don’t forget to indicate CSS/static‐assets delivery via the public folder and Tailwind pipeline.

## Diagram (Mermaid)

```mermaid
flowchart TD
    direction TB

    %% External User
    User["User"]:::external

    %% Frontend Pages
    subgraph "Frontend"
        direction TB

        %% Layouts
        subgraph "Layouts"
            direction TB
            GlobalLayout["Global Layout"]:::frontend
            RootLayout["Root Layout (Authenticated)"]:::frontend
            HomeLayout["Home Layout"]:::frontend
        end

        %% Pages
        subgraph "Pages (App Router)"
            direction TB
            SignIn["Sign-In Page"]:::frontend
            SignUp["Sign-Up Page"]:::frontend
            HomePage["Home Page"]:::frontend
            PersonalRoom["Personal Room Page"]:::frontend
            PreviousCalls["Previous Calls Page"]:::frontend
            UpcomingCalls["Upcoming Calls Page"]:::frontend
            Recordings["Recordings Page"]:::frontend
            MeetingRoomPage["Meeting Room Page"]:::frontend
        end

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

        %% Hooks
        subgraph "Hooks (Data Fetching)"
            direction TB
            UseGetCalls["useGetCalls Hook"]:::frontend
            UseGetCallById["useGetCallById Hook"]:::frontend
        end

        %% Provider
        StreamProvider["StreamClientProvider"]:::frontend

        %% Static Assets
        subgraph "Static Assets"
            direction TB
            Icons["Public Icons"]:::frontend
            Images["Public Images"]:::frontend
        end

    end

    %% Backend / Server
    subgraph "Backend (Next.js Serverless)"
        direction TB
        Middleware["Route Protection Middleware"]:::backend
        Env["Environment Variables (.env)"]:::backend
        NextConfig["Next.js Config"]:::backend
        TailwindConfig["Tailwind Config"]:::backend
        PostCSSConfig["PostCSS Config"]:::backend
        TSConfig["TypeScript Config"]:::backend
        Utils["Utility Functions"]:::backend
        Constants["Constants"]:::backend
    end

    %% Business Logic
    StreamActions["Stream Actions Module"]:::backend

    %% External Services
    subgraph "External Services"
        direction TB
        StreamAPI["Stream Video/Voice API"]:::external
        AuthService["Authentication Service"]:::external
    end

    %% Data Flows
    User -->|navigates to| SignIn
    User -->|navigates to| SignUp
    User -->|navigates to| HomePage
    User -->|navigates to| PersonalRoom
    User -->|navigates to| PreviousCalls
    User -->|navigates to| UpcomingCalls
    User -->|navigates to| Recordings
    User -->|navigates to| MeetingRoomPage

    HomePage -->|uses layout| HomeLayout
    SignIn -->|wrapped by| GlobalLayout
    SignUp -->|wrapped by| GlobalLayout
    HomePage -->|wrapped by| RootLayout
    PersonalRoom -->|wrapped by| HomeLayout
    PreviousCalls -->|wrapped by| HomeLayout
    UpcomingCalls -->|wrapped by| HomeLayout
    Recordings -->|wrapped by| HomeLayout
    MeetingRoomPage -->|wrapped by| RootLayout

    %% Component usage
    SignIn -->|renders| Navbar
    SignUp -->|renders| Navbar
    HomePage -->|renders| Sidebar
    HomePage -->|renders| MobileNav
    HomePage -->|renders list| CallList
    HomePage -->|renders cards| HomeCard
    PersonalRoom -->|renders| MeetingSetup
    MeetingRoomPage -->|renders| MeetingRoomComp
    PreviousCalls -->|renders list| MeetingCard
    PreviousCalls -->|renders filters| MeetingTypeList
    Recordings -->|renders list| MeetingModel
    UpcomingCalls -->|renders list| MeetingCard
    MeetingRoomPage -->|renders| EndCallButton
    AnyPage -->|shows loading| Loader

    %% Hooks and Actions
    CallList -->|calls| UseGetCalls
    MeetingRoomComp -->|calls| UseGetCallById
    UseGetCalls -->|invokes| StreamActions
    UseGetCallById -->|invokes| StreamActions

    %% Provider to Actions
    StreamProvider -->|provides client to| StreamActions

    %% Middleware and Config
    RootLayout -->|uses| Middleware
    GlobalLayout -->|uses| Middleware
    Middleware -->|reads| Env
    StreamActions -->|reads| Env

    %% Config dependencies
    NextConfig -->|configures| SSR
    TailwindConfig -->|configures| CSS
    PostCSSConfig -->|configures| CSS
    TSConfig -->|configures| Typescript

    %% Utils and Constants
    StreamActions -->|uses| Utils
    StreamActions -->|uses| Constants

    %% Static Assets delivery
    GlobalLayout -->|loads| Icons
    GlobalLayout -->|loads| Images

    %% External service calls
    StreamActions -->|HTTP/SDK calls| StreamAPI
    Middleware -->|auth check| AuthService

    %% Click Events
    click SignIn "https://github.com/aashish037/meet/blob/main/app/(auth)/sign-in/[[...sign-in]]/page.tsx"
    click SignUp "https://github.com/aashish037/meet/blob/main/app/(auth)/sign-up/[[...sign-up]]/page.tsx"
    click HomePage "https://github.com/aashish037/meet/blob/main/app/(root)/(home)/page.tsx"
    click HomeLayout "https://github.com/aashish037/meet/blob/main/app/(root)/(home)/layout.tsx"
    click PersonalRoom "https://github.com/aashish037/meet/blob/main/app/(root)/(home)/personal-room/page.tsx"
    click PreviousCalls "https://github.com/aashish037/meet/blob/main/app/(root)/(home)/previous/page.tsx"
    click UpcomingCalls "https://github.com/aashish037/meet/blob/main/app/(root)/(home)/upcoming/page.tsx"
    click Recordings "https://github.com/aashish037/meet/blob/main/app/(root)/(home)/recordings/page.tsx"
    click MeetingRoomPage "https://github.com/aashish037/meet/blob/main/app/(root)/meeting/[id]/page.tsx"
    click GlobalLayout "https://github.com/aashish037/meet/blob/main/app/layout.tsx"
    click RootLayout "https://github.com/aashish037/meet/blob/main/app/(root)/layout.tsx"
    click UIPrimitives "https://github.com/aashish037/meet/tree/main/components/ui/"
    click CallList "https://github.com/aashish037/meet/blob/main/components/CallList.tsx"
    click MeetingRoomComp "https://github.com/aashish037/meet/blob/main/components/MeetingRoom.tsx"
    click MeetingSetup "https://github.com/aashish037/meet/blob/main/components/MeetingSetup.tsx"
    click MeetingCard "https://github.com/aashish037/meet/blob/main/components/MeetingCard.tsx"
    click MeetingModel "https://github.com/aashish037/meet/blob/main/components/MeetingModel.tsx"
    click MeetingTypeList "https://github.com/aashish037/meet/blob/main/components/MeetingTypeList.tsx"
    click EndCallButton "https://github.com/aashish037/meet/blob/main/components/EndCallButton.tsx"
    click HomeCard "https://github.com/aashish037/meet/blob/main/components/HomeCard.tsx"
    click Loader "https://github.com/aashish037/meet/blob/main/components/Loader.tsx"
    click MobileNav "https://github.com/aashish037/meet/blob/main/components/MobileNav.tsx"
    click Navbar "https://github.com/aashish037/meet/blob/main/components/Navbar.tsx"
    click Sidebar "https://github.com/aashish037/meet/blob/main/components/Sidebar.tsx"
    click UseGetCalls "https://github.com/aashish037/meet/blob/main/Hooks/useGetCalls.ts"
    click UseGetCallById "https://github.com/aashish037/meet/blob/main/Hooks/useGetCallById.ts"
    click StreamActions "https://github.com/aashish037/meet/blob/main/actions/stream.actions.ts"
    click StreamProvider "https://github.com/aashish037/meet/blob/main/providers/StreamClientProvider.tsx"
    click Middleware "https://github.com/aashish037/meet/blob/main/middleware.ts"
    click Env "https://github.com/aashish037/meet/blob/main/.env"
    click NextConfig "https://github.com/aashish037/meet/blob/main/next.config.mjs"
    click TailwindConfig "https://github.com/aashish037/meet/blob/main/tailwind.config.ts"
    click PostCSSConfig "https://github.com/aashish037/meet/blob/main/postcss.config.mjs"
    click TSConfig "https://github.com/aashish037/meet/blob/main/tsconfig.json"
    click Utils "https://github.com/aashish037/meet/blob/main/lib/utils.ts"
    click Constants "https://github.com/aashish037/meet/blob/main/constants/index.ts"
    click Icons "https://github.com/aashish037/meet/tree/main/public/icons/"
    click Images "https://github.com/aashish037/meet/tree/main/public/images/"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0284C7,stroke-width:1px
    classDef backend fill:#D1FAE5,stroke:#059669,stroke-width:1px
    classDef external fill:#FEF3C7,stroke:#D97706,stroke-width:1px
```
