# mherr162/portfolio architecture

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

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

## Overview

##### Main Components
- Entry Point & Build Environment: Represent the Vite configuration (vite.config.ts), TypeScript configurations (tsconfig.json, tsconfig.app.json, tsconfig.node.json), package management files (package.json, package-lock.json, bun.lockb), and related build scripts.
- Application Core: The src directory is the heart of the project and includes:
- Main Application (src/App.tsx, src/main.tsx): This is where the React application starts. It initializes the rendering process.
- Page Components (src/pages/Index.tsx, src/pages/NotFound.tsx): These are likely used with routing to form different views of the portfolio.
- Shared Components (src/components): This contains re-usable "feature" components such as About, Contact, Experience, Footer, Header, Hero, Projects, Skills.
- UI Library Components (src/components/ui): These components – such as cards, buttons, alerts, modals, etc. – are either custom wrappers or integrations with shadcn-ui. They constitute the UI component library used across the portfolio.
- Custom Hooks (src/hooks): For handling application-specific logic (like use-mobile for responsiveness and use-toast for notifications).
- Utility Libraries (src/lib): For helper functions or business logic needed in various parts of the application.

##### Establish Component Relationships & Interactions
- Flow from the entry point (index.html) to main.tsx which initializes the React app.
- How App.tsx acts as the container that composes the various page components and shared components.
- Demonstrate the separation and reusability by indicating how the "pages" use the "components" (for layout, content display) and how those refer to the "ui" folder for standardized visual elements.
- Build system (Vite, PostCSS, Tailwind config) as enveloping the entire application, which ensures a cohesive styling and build process.

##### Architectural Patterns
- Component-based Architecture: Clearly denote the hierarchical structure from App to individual components (organized into “components”, “ui”, and “pages”).
- Separation of Concerns: Notice that public assets, application logic, UI elements, and custom hooks are all organized distinctly.
- Utility Abstraction: The "lib" folder contains helper functions independent of UI, emphasizing modular design.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Config Layer
    subgraph "Build & Config Layer"
        B1["vite.config.ts"]:::config
        B2["tsconfig.json"]:::config
        B3["tsconfig.app.json"]:::config
        B4["tsconfig.node.json"]:::config
        B5["package.json"]:::config
        B6["package-lock.json"]:::config
        B7["bun.lockb"]:::config
    end

    %% Public Assets
    subgraph "Public Assets"
        P1["index.html"]:::assets
        P2["public directory"]:::assets
    end

    %% Main Application
    subgraph "Main Application"
        M1["src/main.tsx"]:::core
        M2["src/App.tsx"]:::core
    end

    %% Page Components
    subgraph "Page Components"
        PC1["src/pages/Index.tsx"]:::pages
        PC2["src/pages/NotFound.tsx"]:::pages
    end

    %% Shared Components
    subgraph "Shared Components"
        SC1["src/components/About.tsx"]:::shared
        SC2["src/components/Contact.tsx"]:::shared
        SC3["src/components/Experience.tsx"]:::shared
        SC4["src/components/Footer.tsx"]:::shared
        SC5["src/components/Header.tsx"]:::shared
        SC6["src/components/Hero.tsx"]:::shared
        SC7["src/components/Projects.tsx"]:::shared
        SC8["src/components/Skills.tsx"]:::shared
    end

    %% UI Library Components
    subgraph "UI Library Components"
        UI1["src/components/ui"]:::ui
    end

    %% Custom Hooks
    subgraph "Custom Hooks"
        H1["src/hooks/use-mobile.tsx"]:::hooks
        H2["src/hooks/use-toast.tsx"]:::hooks
    end

    %% Utility Libraries
    subgraph "Utility Libraries"
        L1["src/lib"]:::lib
    end

    %% Component Relationships and Flow
    P1 -->|"initializes"| M1
    B1 -->|"supports"| M1
    M1 -->|"initializesApp"| M2
    M2 -->|"loadsPages"| PC1
    M2 -->|"loadsShared"| SC5
    SC5 -->|"usesUI"| UI1
    PC1 -->|"usesHook"| H1
    PC1 -->|"usesUtil"| L1
    SC5 -->|"usesHook"| H1
    SC5 -->|"usesUtil"| L1

    %% Click Events for Build & Config Layer
    click B1 "https://github.com/mherr162/portfolio/blob/main/vite.config.ts"
    click B2 "https://github.com/mherr162/portfolio/blob/main/tsconfig.json"
    click B3 "https://github.com/mherr162/portfolio/blob/main/tsconfig.app.json"
    click B4 "https://github.com/mherr162/portfolio/blob/main/tsconfig.node.json"
    click B5 "https://github.com/mherr162/portfolio/blob/main/package.json"
    click B6 "https://github.com/mherr162/portfolio/blob/main/package-lock.json"
    click B7 "https://github.com/mherr162/portfolio/blob/main/bun.lockb"

    %% Click Events for Public Assets
    click P1 "https://github.com/mherr162/portfolio/blob/main/index.html"
    click P2 "https://github.com/mherr162/portfolio/tree/main/public directory"

    %% Click Events for Main Application
    click M1 "https://github.com/mherr162/portfolio/blob/main/src/main.tsx"
    click M2 "https://github.com/mherr162/portfolio/blob/main/src/App.tsx"

    %% Click Events for Page Components
    click PC1 "https://github.com/mherr162/portfolio/blob/main/src/pages/Index.tsx"
    click PC2 "https://github.com/mherr162/portfolio/blob/main/src/pages/NotFound.tsx"

    %% Click Events for Shared Components
    click SC1 "https://github.com/mherr162/portfolio/blob/main/src/components/About.tsx"
    click SC2 "https://github.com/mherr162/portfolio/blob/main/src/components/Contact.tsx"
    click SC3 "https://github.com/mherr162/portfolio/blob/main/src/components/Experience.tsx"
    click SC4 "https://github.com/mherr162/portfolio/blob/main/src/components/Footer.tsx"
    click SC5 "https://github.com/mherr162/portfolio/blob/main/src/components/Header.tsx"
    click SC6 "https://github.com/mherr162/portfolio/blob/main/src/components/Hero.tsx"
    click SC7 "https://github.com/mherr162/portfolio/blob/main/src/components/Projects.tsx"
    click SC8 "https://github.com/mherr162/portfolio/blob/main/src/components/Skills.tsx"

    %% Click Event for UI Library Components
    click UI1 "https://github.com/mherr162/portfolio/tree/main/src/components/ui"

    %% Click Events for Custom Hooks
    click H1 "https://github.com/mherr162/portfolio/blob/main/src/hooks/use-mobile.tsx"
    click H2 "https://github.com/mherr162/portfolio/blob/main/src/hooks/use-toast.tsx"

    %% Click Event for Utility Libraries
    click L1 "https://github.com/mherr162/portfolio/tree/main/src/lib"

    %% Styles
    classDef config fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef assets fill:#A3E4D7,stroke:#117864,stroke-width:2px;
    classDef core fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef pages fill:#FAD7A0,stroke:#D35400,stroke-width:2px;
    classDef shared fill:#FDEBD0,stroke:#AF601A,stroke-width:2px;
    classDef ui fill:#D5F5E3,stroke:#27AE60,stroke-width:2px;
    classDef hooks fill:#E8DAEF,stroke:#8E44AD,stroke-width:2px;
    classDef lib fill:#F6DDCC,stroke:#A04000,stroke-width:2px;
```
