# markmiro/migratingcranes architecture

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

- Interactive diagram: https://gitdiagram.com/markmiro/migratingcranes
- Repository: https://github.com/markmiro/migratingcranes

## Overview

##### Main Components

a) Development Environment:
- Node.js Build System
- Handlebars Templates (.hbs files)
- CSS/Bootstrap Styling
- R Scripts (External data processing)

b) Build Process:
- Source Files (src/)
- Template Compilation
- Static Asset Generation
- Output (dist/)

c) Deployment & Hosting:
- GitLab (Version Control/CI)
- Cloudflare (Hosting/CDN)

- Development Layer                                        |

- HBS        |  |  CSS/Bootstrap |  |  R Scripts  |  |  Configuration   |             |
- Templates  |  |  Styling       |  |  (Reports)  |  |  (.node-version) |             |

- ↓                                                        |

- Build Layer                                             |

- Build Script  |  |  Static Site      |                                             |
- (build.mjs)   |→ |  Generation       |                                             |

- ↓                                                        |

- Deployment Layer                                           |

- GitLab     | →   |   Cloudflare   |  →  End Users                                  |
- CI/CD      |     |   CDN/Hosting  |                                               |

##### Important Details to Highlight

a) Template Structure:
- Relationship between main templates (index.hbs, about.hbs, to-us.hbs)
- Partials (layout.hbs, google-analytics.hbs)
- Country-specific page generation process

b) Data Flow:
- How R-generated reports are integrated
- Transformation from templates to static HTML
- Path from source to distribution

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Development
        HBSTemplates["HBS Templates"]
        Styling["CSS/Bootstrap Styling"]:::styling
        RScripts["R Scripts (Reports)"]
        Config[".node-version"]:::config
        
        subgraph Templates
            MainTemplates["Main Templates"]:::templates
            Partials["Template Partials"]:::templates
        end
        
        HBSTemplates --> Templates
    end
    
    subgraph Build
        BuildScript["Build Script"]:::build
        StaticGen["Static Site Generation"]
        
        Templates --> BuildScript
        Styling --> BuildScript
        RScripts --> BuildScript
        BuildScript --> StaticGen
    end
    
    subgraph Output
        DistDir["Distribution Directory"]:::dist
        CountryPages["Country-Specific Pages"]:::pages
        StaticAssets["Static Assets"]:::assets
        MainPages["Main Output Pages"]:::pages
        
        StaticGen --> DistDir
        DistDir --> CountryPages
        DistDir --> StaticAssets
        DistDir --> MainPages
    end
    
    subgraph Deployment
        GitLab["GitLab CI/CD"]
        Cloudflare["Cloudflare CDN/Hosting"]
        EndUsers["End Users"]
        
        DistDir --> GitLab
        GitLab --> Cloudflare
        Cloudflare --> EndUsers
    end

    %% Click Events
    click BuildScript "https://github.com/markmiro/migratingcranes/blob/main/build.mjs"
    click Config "https://github.com/markmiro/migratingcranes/blob/main/.node-version"
    click MainTemplates "https://github.com/markmiro/migratingcranes/tree/main/src/"
    click Partials "https://github.com/markmiro/migratingcranes/tree/main/src/partials/"
    click Styling "https://github.com/markmiro/migratingcranes/blob/main/src/styles.css"
    click DistDir "https://github.com/markmiro/migratingcranes/tree/main/dist/"
    click CountryPages "https://github.com/markmiro/migratingcranes/tree/main/dist/to/us/from/"
    click StaticAssets "https://github.com/markmiro/migratingcranes/tree/main/dist/"
    click MainPages "https://github.com/markmiro/migratingcranes/tree/main/dist/"

    %% Styling
    classDef templates fill:#a8d1ff
    classDef styling fill:#ffb3ba
    classDef build fill:#baffc9
    classDef config fill:#ffffba
    classDef dist fill:#bae1ff
    classDef pages fill:#ffdfba
    classDef assets fill:#e8baff

    %% Legend
    subgraph Legend
        L1["Templates"]:::templates
        L2["Styling"]:::styling
        L3["Build Process"]:::build
        L4["Configuration"]:::config
        L5["Distribution"]:::dist
        L6["Pages"]:::pages
        L7["Assets"]:::assets
    end
```
