# jkanishkha0305/3d-portfolio architecture

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

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

## Overview

##### Main Components
- Frontend Application – This is the core of the project and includes all the React components, pages, and layout files. Key directories include /src, which contains:
- Component files (e.g., Navbar, Hero, Project, About, Experience, etc.)
- Higher Order Components (HOCs) in the /src/hoc folder that help wrap sections or add common behavior.
- Global styling and utility files (global.scss, tailwind.config.js, postcss.config.js, etc.).
- The main entry points (src/App.jsx, src/main.jsx) that boot up the React app.
- 3D Rendering Module – Within the /src/components/canvas folder, there are distinct components (Ball, Computers, Earth, Stars) for ThreeJS 3D scenes. This module leverages React Three Fiber for integrating 3D graphics into React.
- Assets & Static Resources – These are managed in directories like /public and /dist as well as in the /src/assets folder. They include:
- 3D model files (such as scene.bin, scene.gltf, textures, license.txt) for desktop_pc and planet variants.
- Media and other project-specific assets organized neatly.
- Deployment & Build Infrastructure – Evident from the node configurations (package.json, package-lock.json) and build files (vite.config.js) alongside GitHub actions for deployment located in .github/workflows/deploy.yml.
- External Services & Libraries – The project integrates several external libraries:
- ThreeJS + React Three Fiber for 3D.
- TailwindCSS and Sass for styling.
- Framer Motion for animations.
- Potential email service integration (as explained in the README) for contact forms.
- Various utility libraries like ityped and react-parallax-tilt for interactive UX.

##### Relationships and Interactions
- The React application acts as the client-facing layer, driving interactions and navigation among components.
- Specific components within the /src/components folder are interconnected via routing and props. Higher order components (HOCs) in /src/hoc wrap and enhance these pages with additional behavior (e.g., consistent styling, animations).
- 3D-related components in the canvas folder are integrated within the React component tree and interact with the DOM and user events. They serve as dedicated modules for 3D modeling and animations.
- The static assets (3D scenes and textures) are loaded dynamically into the 3D components using ThreeJS. This involves data flow from the static file system (in /dist and /public) to the rendering components.
- External libraries and configuration files (e.g., tailwind.config.js, vite.config.js) ensure the project’s build process is smooth and optimized for both development and production.

##### Architectural Patterns and Technologies
- Component-Based Architecture – The project is built entirely with React by separating UI segments into individual, reusable components.
- Composition with Higher Order Components (HOCs) – Enhances reusability and consistency across the different sections of the portfolio.
- 3D Rendering using React Three Fiber – Integrates ThreeJS within the React ecosystem, managing 3D scene complexity with React’s lifecycle.
- Build and Deployment Patterns – Use of Vite for fast builds and a clear distinction between source code (/src), public assets (/public), and the build/distribution output (/dist).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Client Layer
    subgraph "Frontend Client"
        FE1["React App (App.jsx)"]:::ui
        FE2["Main Entry (main.jsx)"]:::ui
        subgraph "UI Components"
            U1["Navbar"]:::ui
            U2["Hero"]:::ui
            U3["Projects"]:::ui
            U4["About"]:::ui
            U5["Experience"]:::ui
            U6["Footer"]:::ui
        end
    end

    %% 3D Rendering Engine Layer
    subgraph "3D Rendering Engine (ThreeJS)"
        R1["Ball.jsx"]:::three
        R2["Computers.jsx"]:::three
        R3["Earth.jsx"]:::three
        R4["Stars.jsx"]:::three
    end

    %% Static Assets Layer
    subgraph "Static Assets"
        A1["Desktop PC Models (public)"]:::asset
        A2["Planet Models (public)"]:::asset
        A3["Desktop PC Assets (dist)"]:::asset
        A4["Planet Assets (dist)"]:::asset
    end

    %% Build & Deployment Layer
    subgraph "Build & Deployment"
        D1["vite.config.js"]:::build
        D2["package.json"]:::build
        D3[".github/workflows/deploy.yml"]:::build
        D4["tailwind.config.js"]:::build
        D5["postcss.config.js"]:::build
    end

    %% Connections within Frontend Client
    FE1 --> U1
    FE1 --> U2
    FE1 --> U3
    FE1 --> U4
    FE1 --> U5
    FE1 --> U6

    %% Connection from Frontend to 3D Rendering Engine
    FE1 -->|"integrates"| R1
    FE1 -->|"integrates"| R2
    FE1 -->|"integrates"| R3
    FE1 -->|"integrates"| R4
    U2 -->|"triggers"| R1

    %% Assets flowing to 3D Rendering Engine
    A1 -->|"provides"| R1
    A1 -->|"provides"| R2
    A2 -->|"provides"| R3
    A2 -->|"provides"| R4
    A3 -->|"provides"| R1
    A4 -->|"provides"| R3

    %% Build & Deployment influences Frontend Client
    D1 -->|"configures"| FE1
    D2 -->|"configures"| FE1
    D3 -->|"deploys"| FE1
    D4 -->|"styles"| FE1
    D5 -->|"styles"| FE1

    %% Click Events for Frontend Application
    click FE1 "https://github.com/jkanishkha0305/3d-portfolio/blob/main/src/App.jsx"
    click FE2 "https://github.com/jkanishkha0305/3d-portfolio/blob/main/src/main.jsx"

    %% Click Events for 3D Rendering Module
    click R1 "https://github.com/jkanishkha0305/3d-portfolio/blob/main/src/components/canvas/Ball.jsx"
    click R2 "https://github.com/jkanishkha0305/3d-portfolio/blob/main/src/components/canvas/Computers.jsx"
    click R3 "https://github.com/jkanishkha0305/3d-portfolio/blob/main/src/components/canvas/Earth.jsx"
    click R4 "https://github.com/jkanishkha0305/3d-portfolio/blob/main/src/components/canvas/Stars.jsx"

    %% Click Events for Assets & Static Resources
    click A1 "https://github.com/jkanishkha0305/3d-portfolio/tree/main/public/desktop_pc"
    click A2 "https://github.com/jkanishkha0305/3d-portfolio/tree/main/public/planet"
    click A3 "https://github.com/jkanishkha0305/3d-portfolio/tree/main/dist/desktop_pc"
    click A4 "https://github.com/jkanishkha0305/3d-portfolio/tree/main/dist/planet"

    %% Click Events for Build & Deployment
    click D1 "https://github.com/jkanishkha0305/3d-portfolio/blob/main/vite.config.js"
    click D2 "https://github.com/jkanishkha0305/3d-portfolio/blob/main/package.json"
    click D3 "https://github.com/jkanishkha0305/3d-portfolio/blob/main/.github/workflows/deploy.yml"
    click D4 "https://github.com/jkanishkha0305/3d-portfolio/blob/main/tailwind.config.js"
    click D5 "https://github.com/jkanishkha0305/3d-portfolio/blob/main/postcss.config.js"

    %% Styles
    classDef ui fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef three fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef asset fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef build fill:#f8d7da,stroke:#721c24,stroke-width:2px;
```
