# menshguy/site architecture

> Architecture diagram of the GitHub repository menshguy/site, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/menshguy/site
- Repository: https://github.com/menshguy/site

## Overview

##### Main Components

a) Frontend Architecture (Primary Focus)
- React Application Core
- P5.js Integration Layer
- Project Components Structure
- Asset Management System
- 3D Model Handling

##### Key Relationships to Highlight

Component Layer Structure:
**Application Core**
- Context Layer (Device Context)
- Main Navigation
- Project Categories
- Seasons
- Trees
- Rowhomes
- Vermont
- Couch (3D)
- Shared Components
- P5 Wrapper
- Doodle
- Page

##### Specific Elements

- React (Blue hexagon)
- TypeScript (Blue rectangle)
- P5.js (Purple circle)
- Three.js/3D handling (Green pentagon)

b) Data Flow Indicators:

##### Important Architectural Patterns to Highlight

- Component composition pattern
- Context-based state management
- Project-based code organization
- Helper utility structure
- Asset management strategy

**┌─────────────────────────────────────────┐**
- Application Core             │
- ┤
- ┌─────────┐ ┌─────────┐ ┌─────────┐    │
- Context │ │   P5    │ │  Main   │    │
- Provider│ │ Wrapper │ │   Nav   │    │
- ┘ └─────────┘ └─────────┘    │
- ┤
- Project Modules              │
- ┌─────────┐ ┌─────────┐ ┌─────────┐    │
- Seasons │ │  Trees  │ │ Vermont │    │
- ┘ └─────────┘ └─────────┘    │
- ┤
- Resource Layer               │
- ┌─────────┐ ┌─────────┐ ┌─────────┐    │
- 3D    │ │ Sounds  │ │ Helpers │    │
- Models  │ │         │ │         │    │
- ┘ └─────────┘ └─────────┘    │
- ┘

##### Implementation Notes

- Keep the main application flow clear and centered
- Related components visually
- Use consistent styling for similar components
- Version information for major dependencies

Remember to include the build and deployment pipeline (Vite/Vercel) as a supporting element, but keep it secondary to the main application architecture.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph AppCore["Application Core"]
        App["React App"]:::core
        Context["Device Context"]:::context
        MainNav["Main Navigation"]:::nav
        P5Wrapper["P5 Wrapper"]:::p5
    end

    subgraph ProjectModules["Project Modules"]
        Seasons["Seasons"]:::project
        Trees["Trees"]:::project
        Rowhomes["Rowhomes"]:::project
        Vermont["Vermont"]:::project
        Couch["Couch 3D"]:::project
    end

    subgraph SharedComponents["Shared Components"]
        Doodle["Doodle"]:::component
        Page["Page"]:::component
    end

    subgraph ResourceLayer["Resource Layer"]
        subgraph AssetManagement["Asset Management"]
            Models3D["3D Models"]:::resource
            Textures["Textures"]:::resource
        end

        subgraph Helpers["Helper Utilities"]
            ShapeHelpers["Shape Helpers"]:::helper
            TreeHelpers["Tree Helpers"]:::helper
            SkyHelpers["Sky Helpers"]:::helper
        end

        subgraph SoundSystem["Sound System"]
            WindEffects["Wind Effects"]:::sound
            SoundUtils["Sound Utilities"]:::sound
        end
    end

    App --> Context
    App --> MainNav
    App --> P5Wrapper
    P5Wrapper --> Doodle
    App --> Page

    MainNav --> ProjectModules
    P5Wrapper --> ProjectModules
    ProjectModules --> Helpers
    ProjectModules --> AssetManagement
    ProjectModules --> SoundSystem

    %% Click Events
    click App "https://github.com/menshguy/site/blob/master/src/App.tsx"
    click Context "https://github.com/menshguy/site/blob/master/src/context/DeviceContext.tsx"
    click MainNav "https://github.com/menshguy/site/blob/master/src/components/MainNav.tsx"
    click P5Wrapper "https://github.com/menshguy/site/blob/master/src/components/P5Wrapper.tsx"
    click Doodle "https://github.com/menshguy/site/blob/master/src/components/Doodle.tsx"
    click Page "https://github.com/menshguy/site/blob/master/src/components/Page.tsx"
    click Seasons "https://github.com/menshguy/site/tree/master/src/projects/seasons/"
    click Trees "https://github.com/menshguy/site/tree/master/src/projects/trees/"
    click Rowhomes "https://github.com/menshguy/site/tree/master/src/projects/rowhomes/"
    click Vermont "https://github.com/menshguy/site/tree/master/src/projects/vermont/"
    click Couch "https://github.com/menshguy/site/tree/master/src/projects/couch/"
    click Models3D "https://github.com/menshguy/site/tree/master/public/3d/"
    click ShapeHelpers "https://github.com/menshguy/site/blob/master/src/helpers/shapes.ts"
    click TreeHelpers "https://github.com/menshguy/site/blob/master/src/helpers/treeHelpers.tsx"
    click SkyHelpers "https://github.com/menshguy/site/blob/master/src/helpers/skyHelpers.tsx"
    click WindEffects "https://github.com/menshguy/site/blob/master/src/sounds/windGentle.ts"
    click SoundUtils "https://github.com/menshguy/site/blob/master/src/sounds/soundHelpers.ts"

    %% Styling
    classDef core fill:#2d4059,stroke:#fff,stroke-width:2px,color:#fff
    classDef context fill:#ea5455,stroke:#fff,stroke-width:2px,color:#fff
    classDef nav fill:#f07b3f,stroke:#fff,stroke-width:2px,color:#fff
    classDef p5 fill:#7768ae,stroke:#fff,stroke-width:2px,color:#fff
    classDef project fill:#4f8a8b,stroke:#fff,stroke-width:2px,color:#fff
    classDef component fill:#ffb400,stroke:#fff,stroke-width:2px,color:#fff
    classDef resource fill:#7ac7c4,stroke:#fff,stroke-width:2px,color:#fff
    classDef helper fill:#c4b6b6,stroke:#fff,stroke-width:2px,color:#fff
    classDef sound fill:#20639b,stroke:#fff,stroke-width:2px,color:#fff
```
