# seanchenr/sean-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/seanchenr/sean-portfolio
- Repository: https://github.com/seanchenr/sean-portfolio

## Overview

##### Project type and purpose
- This is a single-page, frontend-only portfolio website built with React, TypeScript and Vite.
- It renders a 3D interactive scene (using Three.js) with animations (GSAP) and Tailwind CSS styling.

##### File structure
- Top-level config:
- vite.config.ts, tsconfig*.json, tailwind.config.js, eslint.config.js
- package.json / lock files
- public/ :
- index.html
- Static assets: GLTF/GLB 3D models, textures, videos, images, license files
- src/ :
- main.tsx (React entrypoint)
- App.tsx
- components/ : reusable UI & 3D sub-components (NavBar, Button, AnimatedCounter, HeroModels/*)
- layout/ : page sections (Hero, FeatureCards, Info, ShowcaseSection, LogoSection)
- assets/ and constants/
- types/ : shared TypeScript interfaces

##### README for additional insights
- Tech stack badges confirm use of React, Three.js, GSAP, Tailwind, Vite, TypeScript
- No backend or external data services are mentioned

##### Main components & interactions (
a. Hosting & Deployment pipeline
- Git repository → CI/CD (e.g. GitHub Actions) → Vite build (bundle JS/CSS/assets) → Deploy to static host/CDN (Netlify, Vercel, S3+CloudFront)
b. Client-side architecture
1. Browser loads index.html and bundled assets
2. React app bootstrap (main.tsx → App.tsx)
3. Tailwind CSS provides styling layer
4. React component tree:
– Layout components render page sections
– HeroModels components mount a Three.js canvas
5. Three.js:
– Loads GLTF/GLB models from public/models and textures
– Builds scene graph (Scene, Camera, Renderer)
6. GSAP:
– Drives timeline and animations on 3D objects and UI elements
7. User interactions (scroll, clicks) propagate through React state/hooks → trigger GSAP/Three.js updates

##### Architectural patterns & design principles
- SPA (Single-Page Application) with clear separation:
- Entry & routing (none here—just one page)
- Presentation/Layout layer vs. 3D rendering layer
- Component-driven UI (React)
- Modular asset pipeline (Vite) for fast HMR and optimized production build
- Static-site deployment with CDN for performance

1. Developer & CI/CD
2. Build & Deployment (Vite bundling, CDN)
3. Browser Runtime (React + Tailwind + Three.js + GSAP)
4. Public Assets Store (models, textures, index.html)
- Inside Browser Runtime, break out:
- React Root → Layout Components → HeroModels
- Three.js Scene (Scene, Camera, Renderer) → GLTF Loader → Model Nodes
- GSAP Timeline & Animations
- React Components (NavBar, Buttons, AnimatedCounter)
- Developer → CI/CD → Build → Deploy → CDN → Browser
- Browser fetches index.html & bundles → React bootstrap → Three.js load assets → Render → GSAP drives animations → User events flow back into React/GSAP
- Rectangles (modules/components)
- Vite (bundler/dev server)
- TypeScript (typing layer)
- Tailwind CSS (utility classes)
- Three.js (3D engine)
- GSAP (animation engine)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer & CI/CD Layer
    subgraph "Developer & CI/CD" 
        direction TB
        Dev["Developer"]:::build
        CI["GitHub Actions"]:::build
        Dev --> CI
    end

    %% Build & Deployment Layer
    subgraph "CI/CD & Build" 
        direction TB
        ViteConfig["vite.config.ts"]:::code
        TSConfig["tsconfig.json / tsconfig.app.json / tsconfig.node.json"]:::code
        ESLint["eslint.config.js"]:::code
        TailwindConfig["tailwind.config.js"]:::code
        PackageLock["package.json / lockfiles"]:::code
        CI --> ViteConfig --> TSConfig --> ESLint --> TailwindConfig --> PackageLock
        Build["Vite Build"]:::build
        PackageLock --> Build
    end

    %% Hosting & CDN Layer
    subgraph "Hosting & CDN" 
        direction TB
        Deploy["Deploy"]:::build
        Netlify["Netlify / Vercel"]:::hosting
        CDN["S3 + CloudFront"]:::hosting
        Build --> Deploy --> Netlify
        Deploy --> CDN
    end

    %% Public Assets Store
    subgraph "Public Assets Store" 
        direction TB
        IndexHTML["index.html"]:::assets
        Models[(public/models)]:::assets
        Images[(public/images)]:::assets
        IndexHTML --> Models
        IndexHTML --> Images
    end

    %% Browser Runtime Layer
    subgraph "Browser Runtime" 
        direction TB
        Browser["Browser"]:::runtime

        %% React App
        subgraph "React Application"
            direction TB
            Main["main.tsx"]:::code
            App["App.tsx"]:::code
            Browser -->|fetch bundles| Main --> App
        end

        Tailwind["Tailwind CSS"]:::runtime
        ThreeJS["Three.js Engine"]:::runtime
        GSAP["GSAP Animation"]:::runtime

        %% React Component Tree
        subgraph "React Components"
            direction TB
            NavBar["NavBar"]:::code
            Button["Button"]:::code
            Counter["AnimatedCounter"]:::code
            subgraph "Layout Sections"
                direction TB
                HeroSec["Hero.tsx"]:::code
                Feature["FeatureCards.tsx"]:::code
                Info["Info.tsx"]:::code
                Showcase["ShowcaseSection.tsx"]:::code
                Logo["LogoSection.tsx"]:::code
            end
        end

        %% 3D Scene Components
        subgraph "3D Scene & HeroModels"
            direction TB
            Computer["Computer.tsx"]:::code
            Experience["HeroExperience.tsx"]:::code
            Lights["HeroLights.tsx"]:::code
            Loader["HeroLoader.tsx"]:::code
            PC["HeroPC.tsx"]:::code
            Particles["Particles.tsx"]:::code
            Room["Room.tsx"]:::code
        end

        %% Asset Loading Flow
        Models -->|loads via GLTFLoader| ThreeJS
        ThreeJS --> Computer
        ThreeJS --> Experience
        ThreeJS --> Lights
        ThreeJS --> Loader
        ThreeJS --> PC
        ThreeJS --> Particles
        ThreeJS --> Room

        App --> NavBar
        App --> Button
        App --> Counter
        App --> HeroSec
        HeroSec --> Computer
        HeroSec --> Experience
        HeroSec --> Lights
        HeroSec --> Loader
        HeroSec --> PC
        HeroSec --> Particles
        HeroSec --> Room

        %% Styling & Animations
        App --> Tailwind
        ThreeJS --> GSAP
        NavBar --> GSAP
        Button --> GSAP
        Counter --> GSAP

        %% User Interaction
        Browser -->|user events| App
        App -->|trigger| GSAP
    end

    %% Connections between layers
    CDN -->|serves bundled assets| Browser
    Models -->|served from| CDN
    Images -->|served from| CDN
    IndexHTML -->|served from| CDN

    %% Click Events
    click Main "https://github.com/seanchenr/sean-portfolio/blob/main/src/main.tsx"
    click App "https://github.com/seanchenr/sean-portfolio/blob/main/src/App.tsx"
    click HeroSec "https://github.com/seanchenr/sean-portfolio/blob/main/src/layout/Hero.tsx"
    click Feature "https://github.com/seanchenr/sean-portfolio/blob/main/src/layout/FeatureCards.tsx"
    click Info "https://github.com/seanchenr/sean-portfolio/blob/main/src/layout/Info.tsx"
    click Showcase "https://github.com/seanchenr/sean-portfolio/blob/main/src/layout/ShowcaseSection.tsx"
    click Logo "https://github.com/seanchenr/sean-portfolio/blob/main/src/layout/LogoSection.tsx"
    click NavBar "https://github.com/seanchenr/sean-portfolio/blob/main/src/components/NavBar.tsx"
    click Button "https://github.com/seanchenr/sean-portfolio/blob/main/src/components/Button.tsx"
    click Counter "https://github.com/seanchenr/sean-portfolio/blob/main/src/components/AnimatedCounter.tsx"
    click Computer "https://github.com/seanchenr/sean-portfolio/blob/main/src/components/HeroModels/Computer.tsx"
    click Experience "https://github.com/seanchenr/sean-portfolio/blob/main/src/components/HeroModels/HeroExperience.tsx"
    click Lights "https://github.com/seanchenr/sean-portfolio/blob/main/src/components/HeroModels/HeroLights.tsx"
    click Loader "https://github.com/seanchenr/sean-portfolio/blob/main/src/components/HeroModels/HeroLoader.tsx"
    click PC "https://github.com/seanchenr/sean-portfolio/blob/main/src/components/HeroModels/HeroPC.tsx"
    click Particles "https://github.com/seanchenr/sean-portfolio/blob/main/src/components/HeroModels/Particles.tsx"
    click Room "https://github.com/seanchenr/sean-portfolio/blob/main/src/components/HeroModels/Room.tsx"

    %% Styles
    classDef build fill:#d0e8ff,stroke:#333,stroke-width:1px
    classDef hosting fill:#d0ffd6,stroke:#333,stroke-width:1px
    classDef runtime fill:#fff4b3,stroke:#333,stroke-width:1px
    classDef assets fill:#e0e0e0,stroke:#333,stroke-width:1px
    classDef code fill:#f0f0f0,stroke:#333,stroke-width:1px
```
