# dishant0406/lazyweb architecture

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

- Interactive diagram: https://gitdiagram.com/dishant0406/lazyweb
- Repository: https://github.com/dishant0406/lazyweb

## Overview

##### Main Components

a) Frontend Layer:
- Landing Page Application (lazyweb-landing-page)
- Main Application (lazyweb)
- Component Structure:
- Desktop Interface
- Mobile Interface
- Shared Components
- Utility Components

b) Backend Services:
- Supabase (Database & Authentication)
- Custom API Routes
- Website Screenshot Service
- Metadata Service

**[Client Layer]**
- ↓ ↑
**[Application Layer]**
- ↓ ↑
**[Data & Services Layer]**

##### Specific Implementation Details

A. Client Layer (Top):
- "Landing Page" (Next.js)
- "Main Application" (Next.js)

B. Application Layer (Middle):
- Next.js Server Components
- API Routes (/api/*)
- Authentication Handler
- Resource Management System
- Component hierarchy:
- Desktop Components
- Mobile Components
- Shared Components
- Utility Components

C. Data & Services Layer (Bottom):
- Supabase Section:
- Authentication Service
- Database
- External Services:
- Website Screenshot API
- Metadata API

##### Important Connections to Highlight

- Authentication flow between client and Supabase
- Data flow for resource management
- Demonstrate the website screenshot and metadata service integration
- Relationship between mobile and desktop components with shared utilities

##### Additional Elements

- Bookmark System
- Resource Publishing System
- Search Functionality
- Category Management
- User Management

##### Technical Details to Note

Annotations for:
- TypeScript implementation
- TailwindCSS styling
- Next.js routing system
- API endpoint specifications
- Supabase integration points

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef frontend fill:#3b82f6,color:white
    classDef api fill:#22c55e,color:white
    classDef database fill:#f97316,color:white
    classDef auth fill:#a855f7,color:white
    classDef utility fill:#6b7280,color:white

    %% Client Layer
    subgraph ClientLayer
        LP["Landing Page"]
        MA["Main Application"]
    end
    class LP,MA frontend
    click LP "https://github.com/dishant0406/lazyweb/tree/main/lazyweb-landing-page"
    click MA "https://github.com/dishant0406/lazyweb/tree/main/lazyweb"

    %% Application Layer
    subgraph AppLayer
        subgraph Components
            DC["Desktop Interface"]
            MC["Mobile Interface"]
            SC["Shared Components"]
            UC["Utility Components"]
        end

        subgraph Services
            AR["API Routes"]
            AH["Authentication Handler"]
            RM["Resource Management"]
            SM["State Management"]
        end
    end
    class DC,MC,SC,UC frontend
    class AR,AH,RM,SM utility
    click DC "https://github.com/dishant0406/lazyweb/tree/main/lazyweb/components/desktop"
    click MC "https://github.com/dishant0406/lazyweb/tree/main/lazyweb/components/mobile"
    click SC "https://github.com/dishant0406/lazyweb/tree/main/lazyweb/components/shared"
    click UC "https://github.com/dishant0406/lazyweb/tree/main/lazyweb/components/utility"
    click AR "https://github.com/dishant0406/lazyweb/tree/main/lazyweb/pages/api"
    click AH "https://github.com/dishant0406/lazyweb/tree/main/lazyweb/components/utility/Modals/LoginModal"
    click SM "https://github.com/dishant0406/lazyweb/tree/main/lazyweb/hooks/Zustand"

    %% Features
    subgraph Features
        SB["Search Bar"]
        BM["Bookmark System"]
        CR["Create Resource"]
        RL["Resource List"]
    end
    class SB,BM,CR,RL utility
    click SB "https://github.com/dishant0406/lazyweb/tree/main/lazyweb/components/shared/SearchBar"
    click BM "https://github.com/dishant0406/lazyweb/tree/main/lazyweb/components/utility/Modals/BookmarksModal"
    click CR "https://github.com/dishant0406/lazyweb/tree/main/lazyweb/components/shared/CreateResource"
    click RL "https://github.com/dishant0406/lazyweb/tree/main/lazyweb/components/desktop/ResourceList"

    %% Data & Services Layer
    subgraph DataLayer
        SI["Supabase Integration"]
        DB[(Database)]
        WS["Website Screenshot Service"]
        MS["Metadata Service"]
    end
    class SI auth
    class DB database
    class WS,MS api
    click SI "https://github.com/dishant0406/lazyweb/blob/main/lazyweb/lib/supabaseClient.ts"
    click WS "https://github.com/dishant0406/lazyweb/blob/main/lazyweb/hooks/useWebsiteScreenshot.ts"
    click MS "https://github.com/dishant0406/lazyweb/blob/main/lazyweb/hooks/useWebsiteMetaData.ts"

    %% Connections
    LP --> MA
    MA --> Components
    Components --> Services
    Services --> Features
    Features --> DataLayer
    SI --> DB
    AH --> SI

    %% Legend
    subgraph Legend
        L1[Frontend Components]:::frontend
        L2[API Services]:::api
        L3[Database Services]:::database
        L4[Authentication]:::auth
        L5[Utility Services]:::utility
    end
```
