# usgpo/collections architecture

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

- Interactive diagram: https://gitdiagram.com/usgpo/collections
- Repository: https://github.com/usgpo/collections

## Overview

##### Project type and purpose
- This is an open-source documentation repository (“govinfo Collections”) whose goal is to explain how the govinfo team’s metadata extraction parsers work—specifically via regular expressions—for a given collection (here, the Congressional Hearings, “CHRG”).
- It is *not* an application codebase but a “docs-as-code” project that publishes Markdown and PDF renderings of parser specifications and metadata definitions.

##### File structure
- Top-level files:
- README.md – general project overview (“What’s a collection?”, initial CHRG release)
- CONTRIBUTING.md – how to propose changes
- CODEOWNERS – reviewers/maintainers
- LICENSE.md – licensing terms
- CHRG/ folder: documentation specific to the CHRG collection
- CHRG-Metadata.md – definitions of available metadata fields
- CHRG-RegEx.md – the regex patterns used to extract that metadata
- pdf/CHRG-Metadata.pdf & CHRG-RegEx.pdf – prebuilt PDF versions

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Actors
    Dev["Developer"]:::user
    EndUser["End User<br/>(Integrators)"]:::user

    %% Repository Layer
    subgraph "GitHub Repository" 
        direction TB
        Repo["Repository"]:::repo
        subgraph "Root Files"
            direction TB
            README["README.md"]:::code
            CONTRIBUTING["CONTRIBUTING.md"]:::code
            CODEOWNERS["CODEOWNERS"]:::code
            LICENSE["LICENSE.md"]:::code
        end
        subgraph "Documentation Modules"
            direction TB
            subgraph "CHRG Collection"
                direction TB
                CHRG_MD["CHRG-Metadata.md"]:::docs
                CHRG_RE["CHRG-RegEx.md"]:::docs
                subgraph "pdf/"
                    direction TB
                    CHRG_MD_PDF["CHRG-Metadata.pdf"]:::artifact
                    CHRG_RE_PDF["CHRG-RegEx.pdf"]:::artifact
                end
            end
        end
    end

    %% CI/CD Pipeline
    CICD["CI/CD Pipeline<br/>(GitHub Actions)"]:::build

    %% Generated Artifacts
    subgraph "Build Artifacts"
        direction TB
        Site["Static Site (HTML)"]:::artifact
        PDFs["Collection PDFs"]:::artifact
    end

    %% Hosting
    Hosting["GitHub Pages"]:::hosting

    %% Flows
    Dev -->|"push/pr"| Repo
    Repo -->|"trigger build"| CICD
    CICD -->|"generate"| Site
    CICD -->|"generate"| PDFs
    Site -->|"deploy"| Hosting
    PDFs -->|"deploy"| Hosting
    EndUser -->|"access docs"| Hosting

    %% Click Events
    click README "https://github.com/usgpo/collections/blob/master/README.md"
    click CONTRIBUTING "https://github.com/usgpo/collections/blob/master/CONTRIBUTING.md"
    click CODEOWNERS "https://github.com/usgpo/collections/tree/master/CODEOWNERS"
    click LICENSE "https://github.com/usgpo/collections/blob/master/LICENSE.md"
    click CHRG_MD "https://github.com/usgpo/collections/blob/master/CHRG/CHRG-Metadata.md"
    click CHRG_RE "https://github.com/usgpo/collections/blob/master/CHRG/CHRG-RegEx.md"
    click CHRG_MD_PDF "https://github.com/usgpo/collections/blob/master/CHRG/pdf/CHRG-Metadata.pdf"
    click CHRG_RE_PDF "https://github.com/usgpo/collections/blob/master/CHRG/pdf/CHRG-RegEx.pdf"

    %% Styles
    classDef repo fill:#f0f8ff,stroke:#0366d6,stroke-width:2px
    classDef code fill:#fff5b1,stroke:#d4a017,stroke-width:1px
    classDef docs fill:#e3fcef,stroke:#1b7b1b,stroke-width:1px
    classDef build fill:#fff0f6,stroke:#d63384,stroke-width:2px
    classDef artifact fill:#e7f5ff,stroke:#1c7ed6,stroke-width:1px
    classDef hosting fill:#f0f5ff,stroke:#4263eb,stroke-width:2px
    classDef user fill:#fffbeb,stroke:#f08c00,stroke-width:1px,stroke-dasharray: 5 5
```
