# dpgalliance/publicgoods-website architecture

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

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

## Overview

##### Project type and purpose
- This is a “static‐site generator” pipeline that produces the live Digital Public Goods website. It glues together:
- An offline WordPress CMS (for content editing and theming)
- A repository of JSON “candidate” data
- A set of scripts that crawl the WP CMS and merge candidate JSON into HTML
- A GitHub Pages–hosted static website (the output)

##### File‐structure highlights
- Top‐level: plain HTML directories (about, blog, map, registry, etc.), plus WP folders (wp‐content, wp‐includes)– this is the raw static snapshot.
- Several subfolders (map/, registry/, eligibility/, roadmap/) contain React builds (static/js, static/css, runtime‐main.js, chunk files).
- README describes the four‐repo architecture:
- publicgoods‐wordpress (offline CMS)
- publicgoods‐candidates (JSON files)
- publicgoods‐scripts (crawler + HTML‐generator)
- publicgoods‐website (this repo; static output)

##### Detail level
- Subcomponent that’s essential: the offline WP stack, the JSON data repo, the script engine, the React‐built subapps, CI pipelines, hosting.
- Avoid over-splitting trivial static pages. Keep a high-level overview but indicate that many static directories exist.
- How the create-react-app outputs are nested under map/, registry/, eligibility/, roadmap/.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Backend Layer
    subgraph "Backend Layer"
        direction TB
        WP_CMS["Offline WordPress CMS"]:::backend
        CandidatesRepo["Candidates JSON Repo"]:::repo
    end

    %% Processing Layer
    subgraph "Processing Layer"
        direction TB
        ScriptEngine["Script Engine (SSG)"]:::processing
    end

    %% Static Site Repo
    subgraph "Static Site Repo"
        direction TB
        StaticRepo["Static Website Repository"]:::repo
        subgraph "Micro-Frontends (React SPAs)"
            direction TB
            MapSPA["Map SPA"]:::spa
            RegistrySPA["Registry SPA"]:::spa
            EligibilitySPA["Eligibility SPA"]:::spa
            RoadmapSPA["Roadmap SPA"]:::spa
        end
    end

    %% CI/CD & Hosting
    subgraph "CI/CD & Hosting"
        direction TB
        GitHubActions["GitHub Actions"]:::hosting
        GitHubPagesCDN["GitHub Pages / CDN"]:::hosting
    end

    %% Client Layer
    Browser["End Users (Browser)"]:::client

    %% Flows
    WP_CMS -->|"Content Pull"| ScriptEngine
    CandidatesRepo -->|"JSON Pull"| ScriptEngine
    ScriptEngine -->|"Generates Static HTML"| StaticRepo
    StaticRepo -->|"CI Push"| GitHubActions
    GitHubActions -->|"Deploy"| GitHubPagesCDN
    Browser -->|"Request Pages"| GitHubPagesCDN
    GitHubPagesCDN -->|"Serve Assets"| Browser

    %% Click Events
    click WP_CMS "https://github.com/dpgalliance/publicgoods-website/tree/main/wp-content/"
    click MapSPA "https://github.com/dpgalliance/publicgoods-website/tree/main/map/static/js/"
    click RegistrySPA "https://github.com/dpgalliance/publicgoods-website/tree/main/registry/static/js/"
    click EligibilitySPA "https://github.com/dpgalliance/publicgoods-website/tree/main/eligibility/static/js/"
    click RoadmapSPA "https://github.com/dpgalliance/publicgoods-website/tree/main/roadmap/static/js/"

    %% Styles
    classDef backend fill:#ffdddd,stroke:#aa3333,stroke-width:2px
    classDef repo fill:#ddffdd,stroke:#33aa33,stroke-width:2px
    classDef processing fill:#ddddff,stroke:#3333aa,stroke-width:2px
    classDef hosting fill:#fff2cc,stroke:#aa7700,stroke-width:2px
    classDef client fill:#f0f0f0,stroke:#666666,stroke-width:2px
    classDef spa fill:#ddf0ff,stroke:#3399cc,stroke-width:2px
```
