# moncydev/portfolio-website architecture

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

- Interactive diagram: https://gitdiagram.com/moncydev/portfolio-website
- Repository: https://github.com/moncydev/portfolio-website

## Overview

##### Overall Project Breakdown
- Project Type: A single-page, full-stack front-end application (portfolio website).
- Core Technologies: React for UI, TypeScript as the language, GSAP for animations, and ThreeJS/WebGL for rendering 3D models.
- Project Layers: Component layers (UI components), animation/interaction layers, asset management (public models and images), and context management (e.g., LoadingProvider).

##### Main Components
– Entry Point & Configuration:
- index.html and main.tsx: The HTML container and TypeScript entry point where React mounts.
- Configuration Files: Package.json, Vite config, ESLint, and various TS configs for building and linting.

– Public Assets:
- Public Folder: Contains static assets like images, models, and Draco decoders for optimized 3D model delivery.
- 3D Models: Under public/models, these include GLB and encrypted 3D assets, pointing to a specialized usage for interactive 3D content.

– Source Code (src directory):
- Core Application (App.tsx, App.css): The main container for the SPA.
- Components: A rich library of React components, such as Landing, About, Contact, Navbar, and a dedicated Character component which handles the 3D model scene (e.g., Scene.tsx, exports.ts, and multiple utilities for animation, decryption, mouse interactions, and resizing).
- Utility Modules: Provided in src/components/utils and src/components/Character/utils for handling animation (GSAP), text splitting, and other effects.
- Context and State Management: The context folder (LoadingProvider.tsx) manages application states such as loading states which are likely critical given the heavy animated/3D content.
- Data: Static data like boneData in the src/data directory which may be used for 3D character rigging or animations.

##### Relationships & Interactions
– The React UI (rendered via App.tsx) interacts with multiple component modules (Navbar, Landing, About, etc.) that make up the portfolio.
– The Character component integrates 3D rendering by using ThreeJS/WebGL. It interacts with specialized utilities for animations (using GSAP) and model handling (decryption, lighting, and mouse-based interactions).
– The LoadingProvider in the context layer provides global state control, ensuring the UI manages asynchronous loading of assets and initial animations.
– The public assets directory supports the dynamic loading of static files for images and 3D models that are consumed by various components.

##### Important Architectural Patterns/Design Principles
– Component-Based Architecture: React components are organized in a modular and hierarchical structure (e.g., separate folders for Character, utilities, styles).
– Separation of Concerns: The separation of UI, animations, state management, and asset handling is clearly visible (components vs. utilities vs. context).
– Integration of Animation and 3D Rendering: Specialized components and utilities show intentional modularity for smoothly integrating GSAP animations with ThreeJS's 3D rendering capabilities.
– Asset Management: Use of public directories for static resources, including encrypted/encoded models and decoders for efficient loading.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Entry & Configuration
    subgraph "Entry & Configuration"
        A["index.html"]:::config
        B["main.tsx"]:::config
        C["package.json"]:::config
        D["vite.config.ts"]:::config
        E["tsconfig.json"]:::config
        F["eslint.config.js"]:::config
    end

    %% Public Assets
    subgraph "Public Assets"
        PA["Public Folder"]:::assets
        PB["3D Models & Assets"]:::assets
        PC["Draco Decoders"]:::assets
    end

    %% Core Application
    subgraph "Core Application"
        CA["App.tsx / App.css"]:::app
        MC["MainContainer.tsx"]:::app
    end

    %% UI Components
    subgraph "User Interface Layer"
        L["Landing.tsx / Landing.css"]:::ui
        APT["About.tsx / About.css"]:::ui
        CP["Career.tsx / Career.css"]:::ui
        CT["Contact.tsx / Contact.css"]:::ui
        NB["Navbar.tsx / Navbar.css"]:::ui
        SI["SocialIcons.tsx / SocialIcons.css"]:::ui
        TS["TechStack.tsx"]:::ui
        WD["WhatIDo.tsx / WhatIDo.css"]:::ui
        WP["Work.tsx / Work.css"]:::ui
        WI["WorkImage.tsx"]:::ui
        LD["Loading.tsx"]:::ui
    end

    %% 3D Rendering Subsystem (Character Component)
    subgraph "3D Rendering (Character)"
        CH["index.tsx"]:::character
        SC["Scene.tsx"]:::character
        CE["exports.ts"]:::character
        AU1["animationUtils.ts"]:::character
        AU2["character.ts"]:::character
        AU3["decrypt.ts"]:::character
        AU4["lighting.ts"]:::character
        AU5["mouseUtils.ts"]:::character
        AU6["resizeUtils.ts"]:::character
    end

    %% Animation & Interaction Utilities
    subgraph "Animation & Interaction Utilities"
        GU1["GsapScroll.ts"]:::animation
        GU2["initialFX.ts"]:::animation
        GU3["splitText.ts"]:::animation
    end

    %% State Management
    subgraph "State Management"
        SP["LoadingProvider.tsx"]:::state
    end

    %% Data Management
    subgraph "Data Management"
        BD["boneData.ts"]:::data
    end

    %% Relationships & Data Flow
    A -->|"loads"| B
    B -->|"mounts"| CA
    CA -->|"renders"| MC

    %% UI Components integration with Core Application
    CA -->|"includes"| L
    CA -->|"includes"| APT
    CA -->|"includes"| CP
    CA -->|"includes"| CT
    CA -->|"includes"| NB
    CA -->|"includes"| SI
    CA -->|"includes"| TS
    CA -->|"includes"| WD
    CA -->|"includes"| WP
    WP -->|"renders"| WI

    %% State Management interaction
    SP -- "provides" --> CA
    SP -- "updates" --- L
    SP -- "updates" --- APT
    SP -- "updates" --- CP
    SP -- "updates" --- CT
    SP -- "updates" --- NB
    SP -- "updates" --- SI
    SP -- "updates" --- TS
    SP -- "updates" --- WD
    SP -- "updates" --- WP

    %% 3D Rendering integration within UI
    CA -->|"integrates"| CH
    CH -->|"sets up"| SC
    CH -->|"exports"| CE
    CH -->|"uses"| AU1
    CH -->|"uses"| AU2
    CH -->|"uses"| AU3
    CH -->|"uses"| AU4
    CH -->|"uses"| AU5
    CH -->|"uses"| AU6

    %% Assets flow into 3D Rendering
    PB -->|"supplies models"| CH
    PC -->|"supplies decoders"| CH

    %% Animation & Interaction Utilities usage
    CA -->|"triggers"| GU1
    CA -->|"triggers"| GU2
    CA -->|"triggers"| GU3

    %% Data Management usage (e.g., for rigging in 3D)
    CH -->|"reads"| BD

    %% Click Events for Entry & Configuration
    click A "https://github.com/moncydev/portfolio-website/blob/main//index.html"
    click B "https://github.com/moncydev/portfolio-website/blob/main//src/main.tsx"
    click C "https://github.com/moncydev/portfolio-website/blob/main//package.json"
    click D "https://github.com/moncydev/portfolio-website/blob/main//vite.config.ts"
    click E "https://github.com/moncydev/portfolio-website/blob/main//tsconfig.json"
    click F "https://github.com/moncydev/portfolio-website/blob/main//eslint.config.js"

    %% Click Events for Public Assets
    click PA "https://github.com/moncydev/portfolio-website/tree/main//public"
    click PB "https://github.com/moncydev/portfolio-website/tree/main//public/models"
    click PC "https://github.com/moncydev/portfolio-website/tree/main//public/draco"

    %% Click Events for Core Application
    click CA "https://github.com/moncydev/portfolio-website/blob/main//src/App.tsx"
    click MC "https://github.com/moncydev/portfolio-website/blob/main//src/MainContainer.tsx"

    %% Click Events for UI Components
    click L "https://github.com/moncydev/portfolio-website/blob/main//src/components/Landing.tsx"
    click APT "https://github.com/moncydev/portfolio-website/blob/main//src/components/About.tsx"
    click CP "https://github.com/moncydev/portfolio-website/blob/main//src/components/Career.tsx"
    click CT "https://github.com/moncydev/portfolio-website/blob/main//src/components/Contact.tsx"
    click NB "https://github.com/moncydev/portfolio-website/blob/main//src/components/Navbar.tsx"
    click SI "https://github.com/moncydev/portfolio-website/blob/main//src/components/SocialIcons.tsx"
    click TS "https://github.com/moncydev/portfolio-website/blob/main//src/components/TechStack.tsx"
    click WD "https://github.com/moncydev/portfolio-website/blob/main//src/components/WhatIDo.tsx"
    click WP "https://github.com/moncydev/portfolio-website/blob/main//src/components/Work.tsx"
    click WI "https://github.com/moncydev/portfolio-website/blob/main//src/components/WorkImage.tsx"
    click LD "https://github.com/moncydev/portfolio-website/blob/main//src/components/Loading.tsx"

    %% Click Events for 3D Rendering (Character)
    click CH "https://github.com/moncydev/portfolio-website/blob/main//src/components/Character/index.tsx"
    click SC "https://github.com/moncydev/portfolio-website/blob/main//src/components/Character/Scene.tsx"
    click CE "https://github.com/moncydev/portfolio-website/blob/main//src/components/Character/exports.ts"
    click AU1 "https://github.com/moncydev/portfolio-website/blob/main//src/components/Character/utils/animationUtils.ts"
    click AU2 "https://github.com/moncydev/portfolio-website/blob/main//src/components/Character/utils/character.ts"
    click AU3 "https://github.com/moncydev/portfolio-website/blob/main//src/components/Character/utils/decrypt.ts"
    click AU4 "https://github.com/moncydev/portfolio-website/blob/main//src/components/Character/utils/lighting.ts"
    click AU5 "https://github.com/moncydev/portfolio-website/blob/main//src/components/Character/utils/mouseUtils.ts"
    click AU6 "https://github.com/moncydev/portfolio-website/blob/main//src/components/Character/utils/resizeUtils.ts"

    %% Click Events for Animation & Interaction Utilities
    click GU1 "https://github.com/moncydev/portfolio-website/blob/main//src/components/utils/GsapScroll.ts"
    click GU2 "https://github.com/moncydev/portfolio-website/blob/main//src/components/utils/initialFX.ts"
    click GU3 "https://github.com/moncydev/portfolio-website/blob/main//src/components/utils/splitText.ts"

    %% Click Event for State Management
    click SP "https://github.com/moncydev/portfolio-website/blob/main//src/context/LoadingProvider.tsx"

    %% Click Event for Data Management
    click BD "https://github.com/moncydev/portfolio-website/blob/main//src/data/boneData.ts"

    %% Styling Definitions
    classDef config fill:#AEDFF7,stroke:#333,stroke-width:1px;
    classDef assets fill:#D5F5E3,stroke:#333,stroke-width:1px;
    classDef app fill:#F9E79F,stroke:#333,stroke-width:1px;
    classDef ui fill:#FADBD8,stroke:#333,stroke-width:1px;
    classDef character fill:#D2B4DE,stroke:#333,stroke-width:1px;
    classDef animation fill:#FDEBD0,stroke:#333,stroke-width:1px;
    classDef state fill:#F5B7B1,stroke:#333,stroke-width:1px;
    classDef data fill:#AED6F1,stroke:#333,stroke-width:1px;
```
