# paulmothapo/paulfoliov2 architecture

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

- Interactive diagram: https://gitdiagram.com/paulmothapo/paulfoliov2
- Repository: https://github.com/paulmothapo/paulfoliov2

## Overview

##### Main Architectural Components

a) Frontend Layer
- Components Layer
- Routing Layer
- Client/Server Entry Points
- UI Component Library
- Hooks Layer

b) Blockchain Layer
- Smart Contracts
- Hardhat Configuration

c) Services Layer
- Data Collection Service

##### Component Organization

**┌─ Frontend Layer ─────────────────────┐**

- ┌─ Components ─┐    ┌─ Routes ─┐    │
- Header     │    │ - Index  │    │
- Hero       │    └─────────┘    │
- Features   │                    │
- ┘                     │

- ┌─ UI Components ─┐  ┌─ Hooks ─┐    │
- Button        │  │ - Mobile │    │
- Card          │  └─────────┘    │
- Input         │                 │
- ┘                  │

- ┘

**┌─ Blockchain Layer ──────────────────┐**

- ┌─ Contracts ─┐   ┌─ Config ─┐     │
- Hardhat  │     │
- ┘   └─────────┘     │

- ┘

**┌─ Services Layer ───────────────────┐**

- ┌─ Data Collection ─┐             │

- ┘             │

- ┘

##### Specific Implementation Details

a) Frontend Architecture:
- Component hierarchy starting from root.tsx
- Separation between UI components and feature components
- Client/server entry points (entry.client.tsx and entry.server.tsx)

b) Blockchain Integration:
- Connection between frontend and smart contracts
- Hardhat configuration flow

c) Services:
- How dataCollect.ts integrates with the rest of the application
- External service connections

##### Interactions

- Demonstrate how components communicate
- Relationship between UI components and feature components
- How services interact with both frontend and blockchain layers

Remember to:
- Clear labels
- Version/date information
- Important configuration dependencies (vite, tailwind, typescript)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Frontend Layer"
        Client["Client-Side Application"]
        
        subgraph "Components"
            CoreComp["Core Components"]
            UILib["UI Components Library"]
            
            FeatureCards["Feature Cards"]:::component
            Footer["Footer"]:::component
            Header["Header"]:::component
            Hero["Hero"]:::component
            
            Button["Button"]:::ui
            Card["Card"]:::ui
            Input["Input"]:::ui
            Sidebar["Sidebar"]:::ui
            
            CoreComp --> FeatureCards
            CoreComp --> Footer
            CoreComp --> Header
            CoreComp --> Hero
            
            UILib --> Button
            UILib --> Card
            UILib --> Input
            UILib --> Sidebar
        end
        
        subgraph "Application Logic"
            Routes["Routes"]:::routes
            Hooks["Hooks"]:::hooks
            Services["Services"]:::services
            Utils["Utilities"]:::utils
            
            MobileHook["Mobile Hook"]:::hook
            DataCollect["Data Collection"]:::service
            
            Hooks --> MobileHook
            Services --> DataCollect
        end
    end
    
    subgraph "Server Layer"
        Server["Server-Side Runtime"]
        EntryServer["Entry Server"]:::server
        EntryClient["Entry Client"]:::server
        
        Server --> EntryServer
        Server --> EntryClient
    end
    
    subgraph "Blockchain Layer"
        Contracts["Smart Contracts"]:::blockchain
        HardhatEnv["Hardhat Environment"]:::blockchain
    end
    
    subgraph "Build & Configuration"
        Vite["Vite"]:::config
        TypeScript["TypeScript"]:::config
        Tailwind["Tailwind CSS"]:::config
        ESLint["ESLint"]:::config
        PostCSS["PostCSS"]:::config
    end
    
    Client --> Server
    Server --> Contracts
    
    %% Component Mappings
    click CoreComp "https://github.com/paulmothapo/paulfolioV2/tree/main/app/components"
    click FeatureCards "https://github.com/paulmothapo/paulfolioV2/blob/main/app/components/feature-cards.tsx"
    click Footer "https://github.com/paulmothapo/paulfolioV2/blob/main/app/components/footer.tsx"
    click Header "https://github.com/paulmothapo/paulfolioV2/blob/main/app/components/header.tsx"
    click Hero "https://github.com/paulmothapo/paulfolioV2/blob/main/app/components/hero.tsx"
    click UILib "https://github.com/paulmothapo/paulfolioV2/tree/main/app/components/ui"
    click Button "https://github.com/paulmothapo/paulfolioV2/blob/main/app/components/ui/button.tsx"
    click Card "https://github.com/paulmothapo/paulfolioV2/blob/main/app/components/ui/card.tsx"
    click Input "https://github.com/paulmothapo/paulfolioV2/blob/main/app/components/ui/input.tsx"
    click Sidebar "https://github.com/paulmothapo/paulfolioV2/blob/main/app/components/ui/sideBar.tsx"
    click Routes "https://github.com/paulmothapo/paulfolioV2/tree/main/app/routes"
    click Hooks "https://github.com/paulmothapo/paulfolioV2/tree/main/app/hooks"
    click MobileHook "https://github.com/paulmothapo/paulfolioV2/blob/main/app/hooks/use-mobile.tsx"
    click Services "https://github.com/paulmothapo/paulfolioV2/tree/main/app/services"
    click DataCollect "https://github.com/paulmothapo/paulfolioV2/blob/main/app/services/dataCollect.ts"
    click EntryServer "https://github.com/paulmothapo/paulfolioV2/blob/main/app/entry.server.tsx"
    click EntryClient "https://github.com/paulmothapo/paulfolioV2/blob/main/app/entry.client.tsx"
    click Contracts "https://github.com/paulmothapo/paulfolioV2/tree/main/contracts/"
    click HardhatEnv "https://github.com/paulmothapo/paulfolioV2/blob/main/hardhat.config.js"
    click Vite "https://github.com/paulmothapo/paulfolioV2/blob/main/vite.config.ts"
    click TypeScript "https://github.com/paulmothapo/paulfolioV2/blob/main/tsconfig.json"
    click Tailwind "https://github.com/paulmothapo/paulfolioV2/blob/main/tailwind.config.ts"
    click PostCSS "https://github.com/paulmothapo/paulfolioV2/blob/main/postcss.config.js"
    click ESLint "https://github.com/paulmothapo/paulfolioV2/blob/main/.eslintrc.cjs"
    click Utils "https://github.com/paulmothapo/paulfolioV2/blob/main/app/lib/utils.ts"
    
    %% Styling
    classDef component fill:#a5d8ff,stroke:#0077cc
    classDef ui fill:#d0bfff,stroke:#7950f2
    classDef routes fill:#b2f2bb,stroke:#37b24d
    classDef hooks fill:#ffd8a8,stroke:#f76707
    classDef services fill:#ffc9c9,stroke:#e03131
    classDef utils fill:#eebefa,stroke:#ae3ec9
    classDef server fill:#74c0fc,stroke:#1c7ed6
    classDef blockchain fill:#ffd43b,stroke:#e67700
    classDef config fill:#e9ecef,stroke:#495057
```
