# webdevcody/dev-finder architecture

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

- Interactive diagram: https://gitdiagram.com/webdevcody/dev-finder
- Repository: https://github.com/webdevcody/dev-finder

## Overview

##### Project type and purpose
- This is a full-stack web application built with Next.js (App Router).
- It provides user authentication (NextAuth), room-based video interactions (room creation, editing, browsing, video player), and persistent storage via a relational database (Drizzle ORM).

##### File structure
- src/app – Next.js App Router directory containing pages, server-side components, client components, and API routes.
- /api/auth/[...nextauth] – NextAuth endpoints for sign-in/out, session management.
- /browse, /create-room, /edit-room/[roomId], /rooms/[roomId], /your-rooms – page routes and associated client/server code and “actions.ts” for server actions.
- src/components – shared UI primitives and higher-order components (mode-toggle, tags-list, theme-provider).
- src/components/ui – design system components (buttons, cards, dialogs, toasts).
- src/data-access – data-access layer wrapping Drizzle queries for rooms and users.
- src/db – database connection (index.ts) and schema definitions (schema.ts).
- src/lib – utility functions (auth helpers, general utils).
- middleware.ts – global request middleware (likely for session checks).
- drizzle.config.ts, docker-compose.yml – ORM and local dev DB configuration.

##### README
- Confirms a boilerplate Next.js app, uses next/font, deployable to Vercel.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Layer
    subgraph "Frontend Layer"
        direction TB
        Browser["Client Browser UI"]:::frontend
        Layout["Global App Layout & Providers"]:::frontend
        Library["Shared UI Primitives & Design System"]:::frontend
        BrowsePage["Browse Rooms Page"]:::frontend
        RoomCard["Room Card Component"]:::frontend
        SearchBar["Search Bar Component"]:::frontend
        CreatePage["Create Room Page"]:::frontend
        CreateForm["Create Room Form"]:::frontend
        EditPage["Edit Room Page"]:::frontend
        EditForm["Edit Room Form"]:::frontend
        ViewPage["View Room (Video Player) Page"]:::frontend
        VideoPlayer["Video Player Component"]:::frontend
        YourRoomsPage["Your Rooms Page"]:::frontend
        UserRoomCard["User Room Card"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        direction TB
        NextServer["Next.js Server (App Router)"]:::backend
        AuthAPI["NextAuth Authentication API"]:::backend
        RoomActions["Room Server Actions"]:::backend
        Middleware["Global Middleware (Session Handling)"]:::backend
        Utils["Utility Libraries"]:::backend
        DataAccess["Data Access Layer (Drizzle ORM wrappers)"]:::backend
    end

    %% Data & Infra Layer
    subgraph "Data & Infra Layer"
        direction TB
        DrizzleConfig["Drizzle Config"]:::data
        DBConnection["DB Connection"]:::data
        Schema["Schema Definitions"]:::data
        Database["Relational Database"]:::data
        DockerCompose["Docker Compose (Local DB)"]:::data
    end

    %% External Services
    subgraph "External Services"
        direction TB
        OAuth["OAuth Providers"]:::external
        Vercel["Vercel Hosting / CDN"]:::external
    end

    %% Connections
    Browser -->|uses| Layout
    Layout -->|imports| Library
    Layout -->|navigates| BrowsePage
    BrowsePage -->|renders| RoomCard
    BrowsePage -->|renders| SearchBar
    Layout -->|navigates| CreatePage
    CreatePage -->|renders| CreateForm
    Layout -->|navigates| EditPage
    EditPage -->|renders| EditForm
    Layout -->|navigates| ViewPage
    ViewPage -->|renders| VideoPlayer
    Layout -->|navigates| YourRoomsPage
    YourRoomsPage -->|renders| UserRoomCard

    Browser -->|HTTP| NextServer
    NextServer -->|handles| AuthAPI
    NextServer -->|handles| RoomActions
    NextServer -->|runs| Middleware
    NextServer -->|calls| Utils
    RoomActions -->|calls| DataAccess
    AuthAPI -->|uses| DataAccess

    DataAccess -->|reads/writes| DBConnection
    DBConnection -->|uses| DrizzleConfig
    DBConnection -->|defines| Schema
    DBConnection -->|executes SQL| Database
    DockerCompose -->|manages| Database

    AuthAPI -->|token exchange| OAuth
    Browser -->|client-auth| AuthAPI
    NextServer -->|hosted on| Vercel

    %% Click Events - Frontend
    click BrowsePage "https://github.com/webdevcody/dev-finder/blob/main/src/app/browse/page.tsx"
    click RoomCard "https://github.com/webdevcody/dev-finder/blob/main/src/app/browse/room-card.tsx"
    click SearchBar "https://github.com/webdevcody/dev-finder/blob/main/src/app/browse/search-bar.tsx"
    click CreatePage "https://github.com/webdevcody/dev-finder/blob/main/src/app/create-room/page.tsx"
    click CreateForm "https://github.com/webdevcody/dev-finder/blob/main/src/app/create-room/create-room-form.tsx"
    click EditPage "https://github.com/webdevcody/dev-finder/blob/main/src/app/edit-room/[roomId]/page.tsx"
    click EditForm "https://github.com/webdevcody/dev-finder/blob/main/src/app/edit-room/[roomId]/edit-room-form.tsx"
    click ViewPage "https://github.com/webdevcody/dev-finder/blob/main/src/app/rooms/[roomId]/page.tsx"
    click VideoPlayer "https://github.com/webdevcody/dev-finder/blob/main/src/app/rooms/[roomId]/video-player.tsx"
    click YourRoomsPage "https://github.com/webdevcody/dev-finder/blob/main/src/app/your-rooms/page.tsx"
    click UserRoomCard "https://github.com/webdevcody/dev-finder/blob/main/src/app/your-rooms/user-room-card.tsx"

    %% Click Events - Backend
    click AuthAPI "https://github.com/webdevcody/dev-finder/blob/main/src/app/api/auth/[...nextauth]/route.ts"
    click RoomActions "https://github.com/webdevcody/dev-finder/blob/main/src/app/create-room/actions.ts"
    click RoomActions "https://github.com/webdevcody/dev-finder/blob/main/src/app/edit-room/[roomId]/actions.ts"
    click RoomActions "https://github.com/webdevcody/dev-finder/blob/main/src/app/rooms/[roomId]/actions.ts"
    click RoomActions "https://github.com/webdevcody/dev-finder/blob/main/src/app/your-rooms/actions.ts"
    click Middleware "https://github.com/webdevcody/dev-finder/blob/main/src/middleware.ts"
    click Utils "https://github.com/webdevcody/dev-finder/blob/main/src/lib/auth.ts"
    click Utils "https://github.com/webdevcody/dev-finder/blob/main/src/lib/utils.ts"
    click DataAccess "https://github.com/webdevcody/dev-finder/blob/main/src/data-access/rooms.ts"
    click DataAccess "https://github.com/webdevcody/dev-finder/blob/main/src/data-access/users.ts"

    %% Click Events - Data & Infra
    click DrizzleConfig "https://github.com/webdevcody/dev-finder/blob/main/drizzle.config.ts"
    click DBConnection "https://github.com/webdevcody/dev-finder/blob/main/src/db/index.ts"
    click Schema "https://github.com/webdevcody/dev-finder/blob/main/src/db/schema.ts"
    click DockerCompose "https://github.com/webdevcody/dev-finder/blob/main/docker-compose.yml"

    %% Styles
    classDef frontend fill:#E0F7FA,stroke:#006064,color:#004D40
    classDef backend fill:#E8F5E9,stroke:#1B5E20,color:#1B5E20
    classDef data fill:#FFF3E0,stroke:#E65100,color:#BF360C
    classDef external fill:#ECEFF1,stroke:#607D8B,color:#37474F
```
