# proofxyz/moonbirds-assets architecture

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

- Interactive diagram: https://gitdiagram.com/proofxyz/moonbirds-assets
- Repository: https://github.com/proofxyz/moonbirds-assets

## Overview

##### Project type and purpose
- This is an open-source “asset repository” for Moonbirds NFT traits and artwork. There is no running frontend or backend service here—this repo simply houses the raw materials (PNGs, SVGs, and trait metadata) that downstream systems (e.g., image-composition pipelines, NFT metadata servers, or static‐site generators) will consume.

##### File structure
- Top-level files:
- README.md – describes purpose
- traits.json – a central metadata file listing all trait categories and possibly their weights or IDs
- Directories:
- traits/ – subfolders (Beak, Body, Eyes, etc.) each containing the source images for that trait category
- collection/png and collection/svg – the output folders, presumably containing fully composed Moonbird images in PNG and SVG formats
- No build scripts or config files—this is purely an assets layout.

##### Components
a. Trait Source Store
- Traits JSON (traits.json)
- Trait directories (traits/Beak, traits/Body, …) with PNG/SVG files
b. Asset Generation Pipeline (external or hypothetical)—a service or script not in this repo that:
- Reads traits.json
- Randomly (or deterministically) selects one file per trait category
- Composes them into a final image layer stack
- Outputs into collection/png and collection/svg
c. Collection Store
- Output directories (collection/png, collection/svg)
d. Downstream Consumers (external)
- NFT metadata server
- Static website or marketplace front end
- IPFS pinning service

##### Important architectural patterns and principles
- Single source of truth for trait definitions (traits.json)
- Clear separation of source assets vs. generated output
- Extensibility: add a new trait simply by dropping images into a new folder under traits/ and updating traits.json
- Format parity: ensure any new trait is available in both PNG and SVG if needed

##### Final reminder
- Simplicity of this repo: it’s purely a data store; the “logic” lives off-repo in an image-composer or CI/CD job

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Trait Source Store"
        TS_traits_json["traits.json"]:::static
        TS_beak["traits/Beak"]:::static
        TS_body["traits/Body"]:::static
        TS_eyes["traits/Eyes"]:::static
        TS_eyewear["traits/Eyewear"]:::static
        TS_gradients["traits/Gradients"]:::static
        TS_headwear["traits/Headwear"]:::static
        TS_outerwear["traits/Outerwear"]:::static
    end

    AGP["Asset Generation Pipeline"]:::pipeline

    subgraph "Collection Store"
        CS_png["collection/png"]:::output
        CS_svg["collection/svg"]:::output
    end

    subgraph "Downstream Consumers"
        DC_metadata["NFT Metadata Server"]:::external
        DC_website["Static Website/Marketplace"]:::external
        DC_ipfs["IPFS Pinning Service"]:::external
    end

    TS_traits_json -->|reads| AGP
    TS_beak -->|reads| AGP
    TS_body -->|reads| AGP
    TS_eyes -->|reads| AGP
    TS_eyewear -->|reads| AGP
    TS_gradients -->|reads| AGP
    TS_headwear -->|reads| AGP
    TS_outerwear -->|reads| AGP

    AGP -->|writes| CS_png
    AGP -->|writes| CS_svg

    CS_png -->|serves| DC_metadata
    CS_png -->|serves| DC_website
    CS_png -->|serves| DC_ipfs
    CS_svg -->|serves| DC_metadata
    CS_svg -->|serves| DC_website
    CS_svg -->|serves| DC_ipfs

    click TS_traits_json "https://github.com/proofxyz/moonbirds-assets/blob/main/traits.json"
    click TS_beak "https://github.com/proofxyz/moonbirds-assets/tree/main/traits/Beak"
    click TS_body "https://github.com/proofxyz/moonbirds-assets/tree/main/traits/Body"
    click TS_eyes "https://github.com/proofxyz/moonbirds-assets/tree/main/traits/Eyes"
    click TS_eyewear "https://github.com/proofxyz/moonbirds-assets/tree/main/traits/Eyewear"
    click TS_gradients "https://github.com/proofxyz/moonbirds-assets/tree/main/traits/Gradients"
    click TS_headwear "https://github.com/proofxyz/moonbirds-assets/tree/main/traits/Headwear"
    click TS_outerwear "https://github.com/proofxyz/moonbirds-assets/tree/main/traits/Outerwear"
    click CS_png "https://github.com/proofxyz/moonbirds-assets/tree/main/collection/png"
    click CS_svg "https://github.com/proofxyz/moonbirds-assets/tree/main/collection/svg"

    classDef static fill:#cce5ff,stroke:#66b0ff,color:#004085
    classDef pipeline fill:#d4edda,stroke:#a3dba0,color:#155724
    classDef output fill:#ffe5b4,stroke:#ffcc80,color:#7f6000
    classDef external fill:#e2e3e5,stroke:#c6c8ca,color:#383d41
```
