# burakorkmez/remote-interview-platform architecture

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

- Interactive diagram: https://gitdiagram.com/burakorkmez/remote-interview-platform
- Repository: https://github.com/burakorkmez/remote-interview-platform

## Overview

##### Project Type & Purpose
- This is a full-stack application designed for video calling interviews. It integrates real-time video calls (powered by Stream), screen sharing/recording functionality, and robust authentication/authorization (using Clerk). The README’s “Highlights” section confirms that key features include video calls, screen sharing/recording, server actions, and dynamic/static routes.

##### Major Components
a. Frontend:
- The “src/app” directory includes the page components for different routes such as home, admin dashboard, meetings, recordings, and schedule.
- UI-related components under “src/components” and “src/components/ui”, along with client-side hooks (“src/hooks”) and utilities (“src/lib”).
b. Backend & Server Logic:
- The “convex” directory represents the backend services. It includes API definitions (generated types & JS), data modeling (schema), and application logic (e.g. files like comments.ts, interviews.ts, users.ts, and auth.config.ts).
- Convex is likely used as a serverless data and API platform, handling data storage and business logic operations.
c. External Services & Integrations:
- Stream: Provides the real-time video call and possibly screen share/recording capabilities.
- Clerk: Manages authentication and authorization for users.
d. Infrastructure & Configuration:
- Next.js configuration files (next.config.mjs).
- Build and style configurations (tailwind.config.ts, postcss.config.mjs).
- Environment variables setup as described in the README.
- Package management files (package.json, package-lock.json).

##### Relationships & Interactions
- The frontend (Next.js pages and components) interacts with:
- The Convex backend via API calls (managed by the “convex” folder) for data operations, user comments, scheduling, etc.
- External services: Calls to Stream for video interactions and window integration with Clerk for auth.
- Backend via Convex:
- Handles business logic and data persistence (comments, interviews, users, etc.).
- May expose endpoints used by the front-end server actions.
- Authentication Flow:
- The Clerk integration ensures that any user accessing pages (e.g. meetings, recordings) is properly authenticated.
- UI and State Management:
- Client and server components collaborate through Next.js’s server actions and React rendering, ensuring data consistency.
- Data Flow Example:
- A user makes a video call request on the frontend → The request is authenticated via Clerk → The call details and data are handled by server actions that interact with Convex → In parallel, the video stream is managed by contacting Stream’s services.

##### Architectural Patterns & Design Principles
- Separation of Concerns: Clear separation between frontend (UI/UX, routing, client logic) and backend (data and business logic via Convex).
- Client/Server Components: Use of Next.js server actions and layouts.
- Modular Structure: Well-organized directories (e.g., the “convex” folder isolates backend concerns while “src/app” organizes presentation logic).
- External Integration: The system leverages third-party services (Stream and Clerk) which are externalized from the core business logic.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend (Next.js)
    subgraph "Frontend (Next.js)"
        subgraph "Pages & Routing"
            HomePage["Home Page"]:::frontend
            MeetingPage["Meeting Page"]:::frontend
            RecordingsPage["Recordings Page"]:::frontend
            SchedulePage["Schedule Page"]:::frontend
        end
        subgraph "UI Components & Client Logic"
            Navbar["Navbar"]:::frontend
            MeetingRoom["MeetingRoom"]:::frontend
            Button["Button"]:::frontend
            Card["Card"]:::frontend
            ClerkProvider["Clerk Provider"]:::frontend
            UseGetCall["useGetCallById"]:::frontend
            Utils["Utils"]:::frontend
        end
    end

    %% Backend (Convex)
    subgraph "Backend (Convex)"
        AuthConfig["Auth Config"]:::backend
        Comments["Comments"]:::backend
        Interviews["Interviews"]:::backend
        Users["Users"]:::backend
        Schema["Schema"]:::backend
        StreamActions["Stream Actions"]:::backend
    end

    %% External Services
    subgraph "External Services"
        StreamService["Stream Service"]:::external
        ClerkService["Clerk Service"]:::external
    end

    %% Global Configuration & Infrastructure
    subgraph "Global Configuration & Infrastructure"
        NextConfig["Next.js Config"]:::config
        TailwindConfig["Tailwind Config"]:::config
        PostCSSConfig["PostCSS Config"]:::config
        PackageJson["package.json"]:::config
        PackageLock["package-lock.json"]:::config
    end

    %% Relationships & Data Flow
    HomePage -->|"API"| AuthConfig
    MeetingPage -->|"API"| Interviews
    RecordingsPage -->|"API"| Comments
    SchedulePage -->|"API"| Users
    Navbar -->|"initAuth"| AuthConfig
    UseGetCall -->|"fetchesData"| Interviews
    MeetingRoom -->|"initCall"| StreamActions

    ClerkProvider -->|"authenticates"| ClerkService
    StreamActions -->|"callsVideo"| StreamService

    %% Click Events for Frontend Pages & Routing
    click HomePage "https://github.com/burakorkmez/remote-interview-platform/blob/master/src/app/(root)/(home)/page.tsx"
    click MeetingPage "https://github.com/burakorkmez/remote-interview-platform/blob/master/src/app/(root)/meeting/[id]/page.tsx"
    click RecordingsPage "https://github.com/burakorkmez/remote-interview-platform/blob/master/src/app/(root)/recordings/page.tsx"
    click SchedulePage "https://github.com/burakorkmez/remote-interview-platform/blob/master/src/app/(root)/schedule/page.tsx"

    %% Click Events for UI Components & Client Logic
    click Navbar "https://github.com/burakorkmez/remote-interview-platform/blob/master/src/components/Navbar.tsx"
    click MeetingRoom "https://github.com/burakorkmez/remote-interview-platform/blob/master/src/components/MeetingRoom.tsx"
    click Button "https://github.com/burakorkmez/remote-interview-platform/blob/master/src/components/ui/button.tsx"
    click Card "https://github.com/burakorkmez/remote-interview-platform/blob/master/src/components/ui/card.tsx"
    click ClerkProvider "https://github.com/burakorkmez/remote-interview-platform/blob/master/src/components/providers/ConvexClerkProvider.tsx"
    click UseGetCall "https://github.com/burakorkmez/remote-interview-platform/blob/master/src/hooks/useGetCallById.ts"
    click Utils "https://github.com/burakorkmez/remote-interview-platform/blob/master/src/lib/utils.ts"

    %% Click Events for Backend (Convex)
    click AuthConfig "https://github.com/burakorkmez/remote-interview-platform/blob/master/convex/auth.config.ts"
    click Comments "https://github.com/burakorkmez/remote-interview-platform/blob/master/convex/comments.ts"
    click Interviews "https://github.com/burakorkmez/remote-interview-platform/blob/master/convex/interviews.ts"
    click Users "https://github.com/burakorkmez/remote-interview-platform/blob/master/convex/users.ts"
    click Schema "https://github.com/burakorkmez/remote-interview-platform/blob/master/convex/schema.ts"
    click StreamActions "https://github.com/burakorkmez/remote-interview-platform/blob/master/src/actions/stream.actions.ts"

    %% Click Events for Global Configuration
    click NextConfig "https://github.com/burakorkmez/remote-interview-platform/blob/master/next.config.mjs"
    click TailwindConfig "https://github.com/burakorkmez/remote-interview-platform/blob/master/tailwind.config.ts"
    click PostCSSConfig "https://github.com/burakorkmez/remote-interview-platform/blob/master/postcss.config.mjs"
    click PackageJson "https://github.com/burakorkmez/remote-interview-platform/blob/master/package.json"
    click PackageLock "https://github.com/burakorkmez/remote-interview-platform/blob/master/package-lock.json"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef backend fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef external fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef config fill:#f8d7da,stroke:#721c24,stroke-width:2px;
```
