# evandroviegasdotcom/zoom_clone architecture

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

- Interactive diagram: https://gitdiagram.com/evandroviegasdotcom/zoom_clone
- Repository: https://github.com/evandroviegasdotcom/zoom_clone

## Overview

##### Project type and purpose
- This is a full-stack Next.js application.
- Purpose: Provide a “home” page (public), a “get-started” flow, and an authenticated area where users can create or join meetings.

##### File structure
Top Level:
- next.config.ts, tsconfig.json, Tailwind, PostCSS, ESLint – framework & build config
- app/ – Next.js App Router directory, subdivided into public and private sections
- components/ – shared UI components (navbar, button, input, etc.)
- services/ – business-logic modules (auth, meeting, user) used by server components and API routes
- lib/, utils/ – general utilities
- middleware.ts – Next.js middleware (e.g., auth redirects)
- public/ – static assets

app/ directory:
- (public)/(home) & get-started – pages accessible without login
- (private)/app – authenticated pages: create-meeting, join-meeting, meeting rooms
- app/layout.tsx & providers/index.tsx – global layout, context and providers (e.g., auth context)

##### README for additional insights
- Bootstrapped with create-next-app
- Uses next/font, Tailwind CSS
- Deployed on Vercel

##### Main components
a. Client Layer (Browser)
- Next.js React pages (public and private)
- UI components (components/ui/*, navbar)
b. Presentation Layer (Next.js Server)
- App Router pages & layouts (app/*)
- Middleware (auth guard)
- Providers (context for auth, theming, etc.)
c. Business Logic Layer (services/*)
- Auth service – signup, login, session management
- User service – get/update user profiles
- Meeting service – create, join, manage meeting data
d. Data Layer
- Database (e.g., PostgreSQL, MongoDB – assumed)
- External APIs (if any – e.g., video/audio provider)
e. Infrastructure & Deployment
- Vercel (or other hosting)
- CDN for static assets (public/)

##### Relationships & Interactions
- Browser sends HTTP requests (page navigations, API calls) to Next.js server
- Next.js server:
- Renders React pages (SSR/SSG)
- Executes middleware → determines public vs. private route
- Calls services modules server-side (services/auth, services/meeting, etc.)
- Services modules communicate with the database (SQL/noSQL)
- Pages/components invoke client-side API routes (if any) or call server actions directly
- Static assets served from /public via CDN

##### Architectural patterns & design principles
- Layered architecture: UI → server pages → services → database
- Separation of concerns:
- UI components in components/
- Business logic in services/
- Shared utilities in lib/ and utils/
- Next.js App Router conventions: layout.tsx, page.tsx, nested routing
- Middleware pattern for authentication guarding

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    subgraph "Client Layer"
        direction TB
        Browser["Browser"]:::client
    end

    %% Presentation Layer (Next.js Server)
    subgraph "Next.js Server"
        direction TB
        Layout["Global App Layout\napp/layout.tsx"]:::server
        Providers["Providers & Context\napp/providers/index.tsx"]:::server
        Middleware["Auth Middleware\nmiddleware.ts"]:::server

        subgraph "Public Pages"
            direction TB
            Home["Home Page\npage.tsx"]:::server
            GetStarted["Get-Started Flow\npage.tsx"]:::server
        end

        subgraph "Private Pages"
            direction TB
            AppLayout["Private App Layout\nlayout.tsx"]:::server
            CreateMeeting["Create Meeting\nindex.tsx"]:::server
            JoinMeeting["Join Meeting\nindex.tsx"]:::server
            subgraph "Meeting Room"
                direction TB
                MeetingLayout["Meeting Layout\nlayout.tsx"]:::server
                MeetingPage["Meeting Page\npage.tsx"]:::server
                MeetingRoom["Room Component\nroom.tsx"]:::server
            end
        end
    end

    %% UI Components
    subgraph "UI Components"
        direction TB
        Navbar["Navbar\ncomponents/navbar/index.tsx"]:::ui
        Button["Button\ncomponents/ui/button.tsx"]:::ui
        Input["Input\ncomponents/ui/input.tsx"]:::ui
        Label["Label\ncomponents/ui/label.tsx"]:::ui
        Select["Select\ncomponents/ui/select.tsx"]:::ui
        Tabs["Tabs\ncomponents/ui/tabs.tsx"]:::ui
    end

    %% Business Logic Layer
    subgraph "Services"
        direction TB
        AuthService["Auth Service\nservices/auth/index.ts"]:::service
        UserService["User Service\nservices/user/index.ts"]:::service
        MeetingService["Meeting Service\nservices/meeting/index.ts"]:::service
    end

    %% Shared Utilities
    subgraph "Utilities"
        direction TB
        LibUtils["Lib Utils\nlib/utils.ts"]:::util
        RandomUtil["Random Generator\nutils/generate-random-number.ts"]:::util
    end

    %% Data Layer & External
    subgraph "Data & External"
        direction TB
        Database["Database\n(PostgreSQL/MongoDB)"]:::data
        CDN["Static Assets CDN\npublic/"]:::external
    end

    %% Connections
    Browser -->|"GET /, /get-started, /app/*"| Layout
    Layout --> Providers
    Providers --> Middleware
    Middleware -->|"auth guard"| Home
    Middleware -->|"auth guard"| GetStarted
    Middleware -->|"auth guard"| AppLayout
    AppLayout --> CreateMeeting
    AppLayout --> JoinMeeting
    AppLayout --> MeetingLayout
    MeetingLayout --> MeetingPage
    MeetingPage --> MeetingRoom

    Home -->|"uses UI"| Navbar
    Home --> Button
    Home --> Input
    Home --> Label
    GetStarted --> Navbar
    CreateMeeting --> Navbar
    JoinMeeting --> Navbar
    MeetingRoom --> Navbar

    Home -->|"server action"| AuthService
    CreateMeeting -->|"POST createMeeting()"| MeetingService
    JoinMeeting -->|"POST joinMeeting()"| MeetingService
    MeetingPage -->|"GET meeting data"| MeetingService
    AuthService -->|"CRUD users"| UserService
    AuthService --> Database
    UserService --> Database
    MeetingService --> Database

    Layout -->|"serve CSS/Tailwind"| CDN
    Home -->|"fetch static assets"| CDN

    %% Click Events
    click Home "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/app/(public)/(home)/page.tsx"
    click GetStarted "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/app/(public)/get-started/[[...rest]]/page.tsx"
    click AppLayout "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/app/(private)/app/(app)/layout.tsx"
    click CreateMeeting "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/app/(private)/app/(app)/components/create-meeting/index.tsx"
    click JoinMeeting "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/app/(private)/app/(app)/components/join-meeting/index.tsx"
    click MeetingLayout "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/app/(private)/app/(meetings)/meeting/layout.tsx"
    click MeetingPage "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/app/(private)/app/(meetings)/meeting/page.tsx"
    click MeetingRoom "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/app/(private)/app/(meetings)/meeting/room.tsx"
    click Layout "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/app/layout.tsx"
    click Providers "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/app/providers/index.tsx"
    click Middleware "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/middleware.ts"
    click Navbar "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/components/navbar/index.tsx"
    click Button "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/components/ui/button.tsx"
    click Input "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/components/ui/input.tsx"
    click Label "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/components/ui/label.tsx"
    click Select "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/components/ui/select.tsx"
    click Tabs "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/components/ui/tabs.tsx"
    click AuthService "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/services/auth/index.ts"
    click UserService "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/services/user/index.ts"
    click MeetingService "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/services/meeting/index.ts"
    click LibUtils "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/lib/utils.ts"
    click RandomUtil "https://github.com/evandroviegasdotcom/zoom_clone/blob/main/utils/generate-random-number.ts"
    click CDN "https://github.com/evandroviegasdotcom/zoom_clone/tree/main/public/"

    %% Styles
    classDef client fill:#ADD8E6,stroke:#333,stroke-width:1px;
    classDef server fill:#90EE90,stroke:#333,stroke-width:1px;
    classDef ui fill:#E0FFFF,stroke:#333,stroke-width:1px;
    classDef service fill:#FFA500,stroke:#333,stroke-width:1px;
    classDef util fill:#F5DEB3,stroke:#333,stroke-width:1px;
    classDef data fill:#D3D3D3,stroke:#333,stroke-width:1px;
    classDef external fill:#FFE4C4,stroke:#333,stroke-width:1px;
```
