# tomasgonzalez/3d-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/tomasgonzalez/3d-portfolio
- Repository: https://github.com/tomasgonzalez/3d-portfolio

## Overview

##### Main Components
a. Frontend Application: This is a single-page application built with React.
- Entry Point: src/index.js and src/App.js, which bootstrap the application.
- Styling: Managed via CSS files (e.g., src/App.css, src/index.css) and scss (see src/components/scrollReminderPage/index.scss).
b. 3D Components: Specialized modules under the src/3d-components directory include:
- “Cube”, “Hologram”, “Logo”, “StarObject”, “StarsField”, and “Track” – these indicate various 3D elements that compose the dynamic visual presentation.
- Each subfolder contains logic, helper hooks, textures, and paths (e.g., src/3d-components/cube and its subdirectories).
c. UI Components: Found in src/components (e.g., navBar, scroll reminder, and uiControls) which handle the standard UI interactions.
d. Scene & Rendering: The directory src/mainScene (with files such as Camera.js and index.js) that likely sets up the Three.js camera, scene, and perhaps the render loop for the 3D visuals.
e. Configuration & Theming: Critical files for easy customization:
- src/configs.js – for portfolio settings.
- src/constants/pageData.js – holds page content/settings.
- src/theme.js – defines styling and theme.
f. Assets and Public Files:
- Assets: In src/assets for models (e.g., cube.glb) and fonts.

##### Interactions and Flow
- The application starts at the React entry point and renders the main App component.
- The App likely integrates the Main Scene (from src/mainScene) and incorporates several 3D elements defined in src/3d-components.
- UI components (navBar, scroll reminder, etc.) overlay or interact with the 3D scene.
- The configuration files feed into every application layer – from scene setup to UI display – to drive customization.
- Assets and static files (in public and src/assets) are loaded as required by both the UI and 3D scenes.
- The structure shows a clear separation between visual 3D elements and traditional React components.

##### Architectural Patterns and Principles
- Component-Based Architecture: React components are modularized (e.g., individual 3D components, UI components) allowing for independent development and reuse.
- Separation of Concerns: Distinct folders for business logic (configs, constants), visual rendering (3d-components, mainScene), and presentation (components).

##### Relevant Technologies
- React – for the core UI and state management.
- Three.js / react-three-fiber / @react-three/drei – for 3D scene management and rendering.
- WebGL – underlying technology powering the 3D graphics.
- Yarn – as the package manager for dependency installation and deployment.
- GitHub Pages – for deployment (with instructions in the README).

– “Main Scene” (camera, scene setup from src/mainScene).
– “UI Components” (navBar, scroll reminder, etc.).
c. In the “3D Rendering Engine” section, break it down into various 3D component modules (cube, hologram, logo, etc.) that are orchestrated by react-three-fiber.

##### Details
- Clearly separate the “presentation layer” (React components, UI) from the “rendering engine” (3D components and scene setup).
- Inclusion of external assets (audio, video, fonts, 3D models) that contribute to the overall visual and interactive experience.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Application
    subgraph "Frontend Application"
        FE1("Index.js"):::frontend
        FE2("App.js"):::frontend
        FE3("App.css"):::frontend
        FE4("index.css"):::frontend
    end

    %% Scene & Rendering
    subgraph "Scene & Rendering"
        SC1("Main Scene"):::scene
    end

    %% 3D Rendering Engine
    subgraph "3D Rendering Engine"
        D1("Cube Component"):::threeD
        D2("Hologram Module"):::threeD
        D3("Logo Component"):::threeD
        D4("StarObject Module"):::threeD
        D5("StarsField Module"):::threeD
        D6("Track Module"):::threeD
    end

    %% UI Components
    subgraph "UI Components"
        UI1("NavBar UI"):::ui
        UI2("Scroll Reminder"):::ui
        UI3("UI Controls"):::ui
    end

    %% Configuration & Theming
    subgraph "Configuration & Theming"
        CT1("Configuration"):::config
        CT2("Page Data"):::config
        CT3("Theme"):::config
    end

    %% Assets and Public Files
    subgraph "Assets/Static Files"
        AS1("Source Assets"):::asset
        AS2("Public Files"):::asset
    end

    %% Connections from Frontend Application to other layers
    FE2 -->|"renders"| SC1
    FE2 -->|"renders"| UI1
    FE2 -->|"loads"| CT1

    %% Main Scene integration of 3D components
    SC1 -->|"incorporates"| D1
    SC1 -->|"incorporates"| D2
    SC1 -->|"incorporates"| D3
    SC1 -->|"incorporates"| D4
    SC1 -->|"incorporates"| D5
    SC1 -->|"incorporates"| D6

    %% Configuration influencing Scene and UI
    CT1 -->|"configures"| SC1
    CT1 -->|"configures"| UI1

    %% Assets feeding into Scene and UI
    AS1 -->|"feeds"| SC1
    AS1 -->|"feeds"| UI1
    AS2 -->|"feeds"| UI1

    %% Connections within UI Components (optional grouping)
    UI1 --- UI2
    UI1 --- UI3

    %% Click Events
    click FE1 "https://github.com/tomasgonzalez/3d-portfolio/blob/main/src/index.js"
    click FE2 "https://github.com/tomasgonzalez/3d-portfolio/blob/main/src/App.js"
    click FE3 "https://github.com/tomasgonzalez/3d-portfolio/blob/main/src/App.css"
    click FE4 "https://github.com/tomasgonzalez/3d-portfolio/blob/main/src/index.css"
    click SC1 "https://github.com/tomasgonzalez/3d-portfolio/tree/main/src/mainScene"
    click D1 "https://github.com/tomasgonzalez/3d-portfolio/tree/main/src/3d-components/cube"
    click D2 "https://github.com/tomasgonzalez/3d-portfolio/tree/main/src/3d-components/hologram"
    click D3 "https://github.com/tomasgonzalez/3d-portfolio/tree/main/src/3d-components/logo"
    click D4 "https://github.com/tomasgonzalez/3d-portfolio/tree/main/src/3d-components/starObject"
    click D5 "https://github.com/tomasgonzalez/3d-portfolio/tree/main/src/3d-components/starsField"
    click D6 "https://github.com/tomasgonzalez/3d-portfolio/tree/main/src/3d-components/track"
    click UI1 "https://github.com/tomasgonzalez/3d-portfolio/tree/main/src/components/navBar"
    click UI2 "https://github.com/tomasgonzalez/3d-portfolio/tree/main/src/components/scrollReminderPage"
    click UI3 "https://github.com/tomasgonzalez/3d-portfolio/tree/main/src/components/uiControls"
    click CT1 "https://github.com/tomasgonzalez/3d-portfolio/blob/main/src/configs.js"
    click CT2 "https://github.com/tomasgonzalez/3d-portfolio/blob/main/src/constants/pageData.js"
    click CT3 "https://github.com/tomasgonzalez/3d-portfolio/blob/main/src/theme.js"
    click AS1 "https://github.com/tomasgonzalez/3d-portfolio/tree/main/src/assets"
    click AS2 "https://github.com/tomasgonzalez/3d-portfolio/tree/main/public"

    %% Styles
    classDef frontend fill:#a6cee3,stroke:#1f78b4,stroke-width:2px;
    classDef scene fill:#b2df8a,stroke:#33a02c,stroke-width:2px;
    classDef threeD fill:#fb9a99,stroke:#e31a1c,stroke-width:2px;
    classDef ui fill:#fdbf6f,stroke:#ff7f00,stroke-width:2px;
    classDef config fill:#cab2d6,stroke:#6a3d9a,stroke-width:2px;
    classDef asset fill:#ffff99,stroke:#b15928,stroke-width:2px;
```
