# kyptodaydream/pwp_dt architecture

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

- Interactive diagram: https://gitdiagram.com/kyptodaydream/pwp_dt
- Repository: https://github.com/kyptodaydream/pwp_dt

## Overview

##### Main System Components

a) Client-Side Layer
- Static site served to browsers
- React-based components structure
- Gatsby runtime

b) Build-Time Layer
- Gatsby build system
- Static site generation process
- Asset processing pipeline

c) Development Environment
- Local development server
- Hot reloading system
- GraphQL data layer

##### Component Organization

Frontend Components (src/components/):
- Layout components (layout.js and variants)
- Core UI components (header.js, footer.js, etc.)
- Reusable components (button.js, image.js, etc.)
- SEO and metadata handling (seo.js)

Page Structure (src/pages/):
- Route-based page components
- Template hierarchy

Static Assets:
- Images and fonts directories
- PDF resources
- Custom HTML files

##### Data Flow and Build Process
Following flows:

Development Flow:
**Local Dev Server → Hot Reloading → Browser**
- ↓
- GraphQL Layer
- ↓
- Static Assets/Content

Build Flow:
**Source Files → Gatsby Build → Static HTML/CSS/JS → CDN/Hosting**

##### Key Relationships to Highlight

- Gatsby configuration files (gatsby-*.js) interaction with the build process
- Component inheritance and composition
- Static asset processing pipeline
- Page routing and navigation flow
- Development vs. Production environments

##### Implementation Details

- React component hierarchy
- Gatsby plugin system
- Static file handling
- CSS/Styling approach (global.css and component-specific styles)
- Image processing pipeline
- Font loading system

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Client-Side Layer"
        Browser["Browser/Client"]
        GatsbyRuntime["Gatsby Runtime"]
        ReactComponents["React Components"]
    end

    subgraph "Build-Time Layer"
        GatsbyBuild["Gatsby Build System"]
        StaticGen["Static Site Generator"]
        AssetProcess["Asset Processing"]
    end

    subgraph "Development Environment"
        DevServer["Local Dev Server"]
        HotReload["Hot Reloading"]
        GraphQL["GraphQL Layer"]
    end

    subgraph "Frontend Components"
        direction TB
        Layout["Layout Components"]:::component
        CoreUI["Core UI Components"]:::component
        Reusable["Reusable Components"]:::component
        SEO["SEO Component"]:::component
    end

    subgraph "Page Structure"
        direction TB
        Pages["Route-based Pages"]:::component
        Templates["Page Templates"]:::component
    end

    subgraph "Static Assets"
        direction TB
        Images["Images"]:::asset
        Fonts["Fonts"]:::asset
        PDFs["PDF Resources"]:::asset
        CustomHTML["Custom HTML"]:::asset
    end

    subgraph "Configuration"
        direction TB
        GatsbyConfig["Gatsby Config"]:::config
        GatsbyNode["Gatsby Node"]:::config
        GatsbyBrowser["Gatsby Browser"]:::config
        GatsbySSR["Gatsby SSR"]:::config
    end

    Browser --> GatsbyRuntime
    GatsbyRuntime --> ReactComponents
    DevServer --> HotReload
    HotReload --> Browser
    GraphQL --> DevServer
    GatsbyBuild --> StaticGen
    StaticGen --> AssetProcess
    AssetProcess --> Browser
    Layout --> ReactComponents
    CoreUI --> ReactComponents
    Reusable --> ReactComponents
    SEO --> ReactComponents
    Pages --> ReactComponents
    Templates --> Pages
    Images --> AssetProcess
    Fonts --> AssetProcess
    PDFs --> AssetProcess
    CustomHTML --> AssetProcess
    GatsbyConfig --> GatsbyBuild
    GatsbyNode --> GatsbyBuild
    GatsbyBrowser --> GatsbyRuntime
    GatsbySSR --> StaticGen

    %% Component Mappings
    click GatsbyConfig "https://github.com/KyptoDaydream/pwp_dt/blob/master/gatsby-config.js"
    click GatsbyNode "https://github.com/KyptoDaydream/pwp_dt/blob/master/gatsby-node.js"
    click GatsbyBrowser "https://github.com/KyptoDaydream/pwp_dt/blob/master/gatsby-browser.js"
    click GatsbySSR "https://github.com/KyptoDaydream/pwp_dt/blob/master/gatsby-ssr.js"
    click Layout "https://github.com/KyptoDaydream/pwp_dt/blob/master/src/components/layout.js"
    click CoreUI "https://github.com/KyptoDaydream/pwp_dt/blob/master/src/components/header.js"
    click SEO "https://github.com/KyptoDaydream/pwp_dt/blob/master/src/components/seo.js"
    click Pages "https://github.com/KyptoDaydream/pwp_dt/tree/master/src/pages"
    click Images "https://github.com/KyptoDaydream/pwp_dt/tree/master/src/images"
    click Fonts "https://github.com/KyptoDaydream/pwp_dt/tree/master/src/fonts"
    click PDFs "https://github.com/KyptoDaydream/pwp_dt/tree/master/static"
    click CustomHTML "https://github.com/KyptoDaydream/pwp_dt/blob/master/static/BudHrdinaOnline.html"
    click Reusable "https://github.com/KyptoDaydream/pwp_dt/tree/master/src/components"

    classDef component fill:#3498db,stroke:#2980b9,color:white
    classDef asset fill:#f1c40f,stroke:#f39c12,color:black
    classDef config fill:#2ecc71,stroke:#27ae60,color:white

    %% Legend
    subgraph Legend
        L1["Component"]:::component
        L2["Asset"]:::asset
        L3["Configuration"]:::config
    end
```
