# kharev/portfolio architecture

> Architecture diagram of the GitHub repository kharev/portfolio, 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/kharev/portfolio
- Repository: https://github.com/kharev/portfolio

## Overview

##### Main Components
a. Frontend Application:
- The entry point (index.html) that loads the application via main.jsx.
- The central App.jsx component – acting as the root container.
b. Component Layers:
- Reusable UI components (found under src/components, e.g., Alert, Button, CustomCursor, DemoComputer, etc.). Note the subfolder for navigation components.
- Section components (under src/sections) such as Hero, About, Projects, Contact, etc., which structure the overall portfolio.
c. Static Assets & Media:
- The "public" directory houses assets including 3D models (in various formats), audio files, textures, and videos that are currently used by 3D components.
d. Configuration and Tools:
- Build and tool configurations (vite.config.js, tailwind.config.js, postcss.config.js, eslint.config.js) indicating the front-end project’s tooling.
- Package files (package.json, package-lock.json) showing dependencies like React and possibly Three.js (although not explicitly named, the presence of 3D models suggests its use).

##### Relationships and Interactions
- The browser loads index.html which references the bundled script from Vite.
- main.jsx bootstraps the React application; it then renders App.jsx.
- App.jsx composes multiple sections and common UI components.
- UI components communicate with each other through props and events to create a dynamic, interactive experience (for example, navigation controls in Navbar coordinate with section components).
- Static assets (3D models, audio, textures) are consumed by certain components (like Earth, DemoComputer, Wizard), suggesting the use of a 3D rendering library (possibly React Three Fiber or Three.js) that renders complex scenes.
- There is a clear separation between the layout (sections and navigation) and the specialized interactive components (3D canvases, animations, custom cursors).

##### Architectural Patterns and Technologies
- Component-Based Architecture: The application is highly modular, with components dedicated to small, focused tasks.
- Separation of Concerns: UI components and layout sections are clearly separated, with distinct directories for each.
- Static Asset Management: The public directory is well-organized to handle assets needed for multimedia content.
- Tooling / Build Pipeline: Vite is used as the build tool providing fast refresh (with either Babel or SWC as mentioned in the README).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Bootstrapping
    subgraph "Frontend Bootstrapping"
        Browser("Browser"):::core
        html("index.html"):::core
        main("src/main.jsx"):::core
        app("src/App.jsx"):::core
    end

    Browser -->|"loads"| html
    html -->|"bootstraps"| main
    main -->|"renders"| app

    %% Application Layers
    subgraph "Application Layers"
        sec("Section Components"):::ui
        ui("UI Components"):::ui
        nav("Navigation Components"):::ui
    end

    app -->|"composes"| sec
    app -->|"composes"| ui
    app -->|"composes"| nav

    %% Static Assets & Multimedia
    subgraph "Static Assets & Media"
        assets("Static Assets & Media"):::assets
    end

    ui -->|"consumes"| assets

    %% Configuration & Build Tools
    subgraph "Configuration & Build Tools"
        vite("vite.config.js"):::config
        tailwind("tailwind.config.js"):::config
        postcss("postcss.config.js"):::config
        eslint("eslint.config.js"):::config
        pkg("package.json"):::config
        pkglock("package-lock.json"):::config
    end

    vite -->|"buildPipeline"| main

    %% Click Events
    click html "https://github.com/kharev/portfolio/blob/main/index.html"
    click main "https://github.com/kharev/portfolio/blob/main/src/main.jsx"
    click app "https://github.com/kharev/portfolio/blob/main/src/App.jsx"
    click ui "https://github.com/kharev/portfolio/tree/main/src/components"
    click nav "https://github.com/kharev/portfolio/tree/main/src/components/navigation"
    click sec "https://github.com/kharev/portfolio/tree/main/src/sections"
    click assets "https://github.com/kharev/portfolio/tree/main/public"
    click vite "https://github.com/kharev/portfolio/blob/main/vite.config.js"
    click tailwind "https://github.com/kharev/portfolio/blob/main/tailwind.config.js"
    click postcss "https://github.com/kharev/portfolio/blob/main/postcss.config.js"
    click eslint "https://github.com/kharev/portfolio/blob/main/eslint.config.js"
    click pkg "https://github.com/kharev/portfolio/blob/main/package.json"
    click pkglock "https://github.com/kharev/portfolio/blob/main/package-lock.json"

    %% Styles
    classDef core fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef ui fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef assets fill:#FFA500,stroke:#000,stroke-width:2px;
    classDef config fill:#D3D3D3,stroke:#000,stroke-width:2px;
```
