# wouter173/website architecture

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

- Interactive diagram: https://gitdiagram.com/wouter173/website
- Repository: https://github.com/wouter173/website

## Overview

##### Main Components

A. Client-Side Layer:
- Next.js App Router (src/app directory structure)
- React Components (src/components)
- UI Components (src/components/ui)
- Client-side Utils (src/lib)
- Static Assets (public directory)
- WebGL Shaders (src/shaders)

B. Server-Side Layer:
- Server Components/Actions (src/server)
- API Integrations (GitHub, Twitter/X)
- MDX Content Processing (work/posts)

C. External Services:
- GitHub API
- Twitter/X API
- Vercel Deployment Platform

**┌─────────────────────────────────────────────────────────────┐**
- Client Layer                           │
- ┌─────────────┐  ┌─────────────┐  ┌─────────────┐       │
- App Router │  │   UI/UX     │  │  WebGL      │       │
- (Pages)    │  │ Components  │  │  Shaders    │       │
- ┘  └─────────────┘  └─────────────┘       │
- ▲            ▲                ▲                 │
- ┼────────────┼────────────────┼────────────────┘

**┌─────────────┼────────────┼────────────────┼────────────────┐**
- ▼            ▼                ▼                 │
- Server Layer                            │
- ┌─────────────┐  ┌─────────────┐  ┌─────────────┐       │
- MDX      │  │  Server     │  │   API       │       │
- Processing │  │ Components  │  │  Routes     │       │
- ┘  └─────────────┘  └─────────────┘       │
- ▲            ▲                ▲                 │
- ┼────────────┼────────────────┼────────────────┘

**┌─────────────┼────────────┼────────────────┼────────────────┐**
- ▼            ▼                ▼                 │
- External Services                         │
- ┌─────────────┐  ┌─────────────┐  ┌─────────────┐       │
- GitHub     │  │  Twitter/X  │  │   Vercel    │       │
- API      │  │    API      │  │ Deployment  │       │
- ┘  └─────────────┘  └─────────────┘       │
- ┘

##### Key Architectural Patterns to Highlight

A. Next.js App Router Architecture:
- Hierarchy of routes under src/app
- Separation between (home) and work routes
- Server and client components

B. Component Architecture:
- Relationship between UI components and pages
- Integration of MDX content with the component system
- Shared components structure

C. Data Flow:
- Flow from external APIs through server components to the client
- How contact form data moves through the system
- Demonstrate the content rendering pipeline for MDX posts

##### Implementation Notes

- Maintain consistent spacing and alignment
- Annotations for key architectural decisions
- Creating separate detailed views for complex subsystems

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and Classes
    classDef client fill:#e1f5fe,stroke:#01579b
    classDef server fill:#e8f5e9,stroke:#1b5e20
    classDef external fill:#fff3e0,stroke:#e65100
    classDef storage fill:#f3e5f5,stroke:#4a148c
    
    subgraph ClientLayer["Client Layer"]
        AppRouter["Next.js App Router"]:::client
        ReactComponents["React Components"]:::client
        UIComponents["UI Components"]:::client
        ClientUtils["Client Utils"]:::client
        StaticAssets["Static Assets"]:::client
        WebGLShaders["WebGL Shaders"]:::client
        Navigation["Navigation System"]:::client
        Icons["Icon System"]:::client
        Posts["Posts Management"]:::client
        ContactForm["Contact Form"]:::client
        VisualEffects["Visual Effects"]:::client
    end

    subgraph ServerLayer["Server Layer"]
        ServerComponents["Server Components/Actions"]:::server
        MDXProcessing["MDX Processing"]:::server
        APIRoutes["API Routes"]:::server
        EnvConfig["Environment Config"]:::server
    end

    subgraph ExternalLayer["External Services"]
        GitHubAPI["GitHub API"]:::external
        TwitterAPI["Twitter/X API"]:::external
        VercelDeploy["Vercel Deployment"]:::external
        MDXContent["MDX Content Storage"]:::storage
    end

    %% Relationships
    AppRouter --> ServerComponents
    AppRouter --> ReactComponents
    ReactComponents --> UIComponents
    ReactComponents --> ClientUtils
    ReactComponents --> WebGLShaders
    ReactComponents --> Navigation
    ReactComponents --> Icons
    ReactComponents --> Posts
    ReactComponents --> ContactForm
    ReactComponents --> VisualEffects
    
    ServerComponents --> GitHubAPI
    ServerComponents --> TwitterAPI
    ServerComponents --> MDXContent
    
    MDXProcessing --> MDXContent
    APIRoutes --> GitHubAPI
    APIRoutes --> TwitterAPI
    
    EnvConfig --> ServerComponents
    EnvConfig --> APIRoutes

    %% Click Events
    click AppRouter "https://github.com/wouter173/website/tree/main/src/app"
    click ReactComponents "https://github.com/wouter173/website/tree/main/src/components"
    click UIComponents "https://github.com/wouter173/website/tree/main/src/components/ui"
    click ClientUtils "https://github.com/wouter173/website/tree/main/src/lib"
    click StaticAssets "https://github.com/wouter173/website/tree/main/public"
    click WebGLShaders "https://github.com/wouter173/website/tree/main/src/shaders"
    click ServerComponents "https://github.com/wouter173/website/tree/main/src/server"
    click MDXContent "https://github.com/wouter173/website/tree/main/src/app/work/posts"
    click ContactForm "https://github.com/wouter173/website/tree/main/src/app/(home)/_contact"
    click GitHubAPI "https://github.com/wouter173/website/blob/main/src/server/github.ts"
    click TwitterAPI "https://github.com/wouter173/website/blob/main/src/server/x.ts"
    click MDXProcessing "https://github.com/wouter173/website/blob/main/src/components/mdx-components.tsx"
    click Navigation "https://github.com/wouter173/website/blob/main/src/components/nav.tsx"
    click VisualEffects "https://github.com/wouter173/website/blob/main/src/components/rays.tsx"
    click Icons "https://github.com/wouter173/website/tree/main/src/components/icons"
    click Posts "https://github.com/wouter173/website/blob/main/src/components/posts.tsx"
    click EnvConfig "https://github.com/wouter173/website/blob/main/src/env.ts"
```
