# sayouncdr/portfolio-motion architecture

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

- Interactive diagram: https://gitdiagram.com/sayouncdr/portfolio-motion
- Repository: https://github.com/sayouncdr/portfolio-motion

## Overview

##### Project type and purpose
- This is a single-page, static developer portfolio website.
- Built with React + TypeScript on Vite, styled via Tailwind CSS and animated with Framer Motion.
- It surfaces static data (projects, skills, blogs) plus a small real-time presence feature via Supabase.

##### File structure
- Top-level files: configuration (`vite.config.ts`, `tsconfig.json`), package manifests, HTML entry (`index.html`).
- public/: static assets (images, videos) served by the host/CDN.
- src/: the SPA code
– Components/: UI building blocks (AboutMe, Projects, Footer, BottomBlur, etc.)
– Pages/: high-level route components (ProjectsPage, BlogsPage, ContributionsPage)
– contexts/: global React contexts (ThemeContext)
– data/: compile-time data modules (blogs.ts)
– lib/: helper modules (supabaseClient for realtime, pingBus for event dispatch)
– hooks/: custom React hooks (usePresenceCount for live user count)
– main.tsx + App.tsx: application bootstrap and root component

##### README for additional insights
- Key components described with behavior (video previews, shimmer badge, bottom blur).
- Deployment target: any static host (Vercel/Netlify).
- Real-time feature hints: presence count, live ping chat overlays.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Side
    subgraph "Client (Browser)" 
        direction TB
        Main["main.tsx"]:::client
        App["App.tsx"]:::client
        Main -->|"renders"| App

        subgraph "Global Contexts"
            direction TB
            ThemeContext["ThemeContext.tsx"]:::client
        end
        App -->|"uses"| ThemeContext

        subgraph "Hooks"
            direction TB
            PresenceHook["usePresenceCount.ts"]:::client
        end
        App -->|"calls"| PresenceHook

        subgraph "Lib / Business Logic"
            direction TB
            SupabaseClient["supabaseClient.ts"]:::client
            PingBus["pingBus.ts"]:::client
        end
        PresenceHook -->|"WS connect"| SupabaseClient
        App -->|"publishes events"| PingBus

        subgraph "Data Modules"
            direction TB
            BlogsData["blogs.ts"]:::client
        end
        App -->|"imports"| BlogsData

        subgraph "Pages"
            direction TB
            ProjectsPage["ProjectsPage.tsx"]:::client
            BlogsPage["BlogsPage.tsx"]:::client
            ContributionsPage["ContributionsPage.tsx"]:::client
        end
        App -->|"routes to"| ProjectsPage
        App -->|"routes to"| BlogsPage
        App -->|"routes to"| ContributionsPage

        subgraph "UI Components"
            direction TB
            AboutMe["AboutMe.tsx"]:::client
            ProjectsComp["Projects.tsx"]:::client
            BlogsComp["Blogs.tsx"]:::client
            FooterComp["Footer.tsx"]:::client
            BottomBlurComp["BottomBlur.tsx"]:::client
            LiveViewCounter["LiveViewCounter.tsx"]:::client
            LivePingOverlay["LivePingOverlay.tsx"]:::client
            LivePingChat["LivePingChat.tsx"]:::client
        end
        ProjectsPage -->|"renders"| ProjectsComp
        BlogsPage -->|"renders"| BlogsComp
        ContributionsPage -->|"renders"| AboutMe
        App -->|"always shows"| FooterComp
        App -->|"renders effect"| BottomBlurComp
        PresenceHook -->|"updates"| LiveViewCounter
        PingBus -->|"broadcasts"| LivePingOverlay
        PingBus -->|"broadcasts"| LivePingChat
    end

    %% Static Asset Host / CDN
    subgraph "Static Asset Host (CDN)" 
        direction TB
        Images["public/images/"]:::build
        Videos["public/videos/"]:::build
    end
    Main -->|"GET /index.html"| HTML["index.html"]:::build
    Main -->|"GET bundle"| Dist["dist (JS/CSS)"]:::build
    Main -->|"GET assets"| Images
    Main -->|"GET assets"| Videos

    %% Build & Deploy Pipeline
    subgraph "Build & Deploy (Vite)" 
        direction TB
        ViteConfig["vite.config.ts"]:::build
        TSConfig["tsconfig.json"]:::build
    end
    ViteConfig -->|"build config"| Dist
    TSConfig -->|"type check"| Dist
    HTML -->|"entry"| Dist

    %% External Service
    subgraph "External (Realtime Service)"
        direction TB
        Supabase["Supabase Realtime"]:::external
    end
    SupabaseClient -->|"WS: subscribe presence"| Supabase
    SupabaseClient -->|"WS: receive pings"| Supabase

    %% Click Events
    click Main "https://github.com/sayouncdr/portfolio-motion/blob/main/src/main.tsx"
    click App "https://github.com/sayouncdr/portfolio-motion/blob/main/src/App.tsx"
    click ThemeContext "https://github.com/sayouncdr/portfolio-motion/blob/main/src/contexts/ThemeContext.tsx"
    click PresenceHook "https://github.com/sayouncdr/portfolio-motion/blob/main/src/hooks/usePresenceCount.ts"
    click SupabaseClient "https://github.com/sayouncdr/portfolio-motion/blob/main/src/lib/supabaseClient.ts"
    click PingBus "https://github.com/sayouncdr/portfolio-motion/blob/main/src/lib/pingBus.ts"
    click BlogsData "https://github.com/sayouncdr/portfolio-motion/blob/main/src/data/blogs.ts"
    click ProjectsPage "https://github.com/sayouncdr/portfolio-motion/blob/main/src/Pages/ProjectsPage.tsx"
    click BlogsPage "https://github.com/sayouncdr/portfolio-motion/blob/main/src/Pages/BlogsPage.tsx"
    click ContributionsPage "https://github.com/sayouncdr/portfolio-motion/blob/main/src/Pages/ContributionsPage.tsx"
    click AboutMe "https://github.com/sayouncdr/portfolio-motion/blob/main/src/Components/AboutMe.tsx"
    click ProjectsComp "https://github.com/sayouncdr/portfolio-motion/blob/main/src/Components/Projects.tsx"
    click BlogsComp "https://github.com/sayouncdr/portfolio-motion/blob/main/src/Components/Blogs.tsx"
    click FooterComp "https://github.com/sayouncdr/portfolio-motion/blob/main/src/Components/Footer.tsx"
    click BottomBlurComp "https://github.com/sayouncdr/portfolio-motion/blob/main/src/Components/BottomBlur.tsx"
    click LiveViewCounter "https://github.com/sayouncdr/portfolio-motion/blob/main/src/Components/LiveViewCounter.tsx"
    click LivePingOverlay "https://github.com/sayouncdr/portfolio-motion/blob/main/src/Components/LivePingOverlay.tsx"
    click LivePingChat "https://github.com/sayouncdr/portfolio-motion/blob/main/src/Components/LivePingChat.tsx"
    click Images "https://github.com/sayouncdr/portfolio-motion/tree/main/public/images/"
    click Videos "https://github.com/sayouncdr/portfolio-motion/tree/main/public/videos/"
    click ViteConfig "https://github.com/sayouncdr/portfolio-motion/blob/main/vite.config.ts"
    click TSConfig "https://github.com/sayouncdr/portfolio-motion/blob/main/tsconfig.json"
    click HTML "https://github.com/sayouncdr/portfolio-motion/blob/main/index.html"

    %% Styles
    classDef client fill:#e0f7fa,stroke:#0288d1,stroke-width:2px
    classDef build fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px
    classDef external fill:#fff3e0,stroke:#ef6c00,stroke-width:2px
```
