# collectionbuilder/collectionbuilder-csv architecture

> Architecture diagram of the GitHub repository collectionbuilder/collectionbuilder-csv, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/collectionbuilder/collectionbuilder-csv
- Repository: https://github.com/collectionbuilder/collectionbuilder-csv

## Overview

##### Main Components

a) Input Layer:
- CSV Metadata Files (in _data/)
- Digital Objects (in objects/)
- Configuration Files (_config.yml and other YAML files)

b) Processing Layer (Jekyll Static Site Generator):
- Layout Templates (_layouts/)
- Components (_includes/)
- SASS Styling (_sass/)
- JavaScript Processing (_includes/js/)
- Ruby Plugins (_plugins/)

c) Output Layer:
- Generated Static Website
- Visualization Components
- Search Interface
- Asset Management

##### Data Flow
- CSV Metadata → Jekyll Processing → Generated Pages
- Digital Objects → Asset Processing → Generated Collections
- Configuration Files → Site Structure → Final Output

##### Component Interactions
- How _includes/ components are used by _layouts/
- How plugins process data
- Demonstrate integration with external libraries

##### Specific Implementation Details

- Rectangle: Core Components (Jekyll, Data Storage)
- Rounded Rectangle: Processing Units
- Hexagon: External Libraries (Bootstrap, Leafletjs, DataTables)

##### Visualization Layer

- Generation (Leafletjs)
- Gallery Views (Spotlight)
- Search Functionality (Lunr.js)
- Data Tables
- Timeline Features

##### Architectural Patterns to Emphasize

- Static Site Architecture
- Component-Based Design (_includes/ structure)
- Template Inheritance (_layouts/ hierarchy)
- Asset Pipeline (SASS → CSS, JS processing)

**[Input Layer]**
- ↓
**[Processing Layer]**
- ↓
**[Visualization Layer]**
- ↓
**[Output Layer]**

##### Important Notes

- Version control integration (GitHub)
- Build process
- Integration points with external services
- Metadata processing flow
- How themes and customization work

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        CSV[("CSV Metadata")]:::data
        Objects[("Digital Objects")]:::data
        Config["Configuration Files"]:::config
    end

    subgraph "Processing Layer"
        Jekyll["Jekyll SSG"]:::core
        
        subgraph "Core Components"
            Templates["Layout Templates"]:::component
            Includes["Include Components"]:::component
            Styles["SASS Styling"]:::component
            JS["JavaScript Processing"]:::component
            Plugins["Ruby Plugins"]:::component
        end
        
        subgraph "Feature Processing"
            Search["Search Implementation"]:::feature
            Maps["Map Generation"]:::feature
            Gallery["Gallery Views"]:::feature
            Timeline["Timeline Features"]:::feature
        end
    end

    subgraph "External Libraries"
        Bootstrap["Bootstrap"]:::external
        Leaflet["Leaflet.js"]:::external
        Lunr["Lunr.js"]:::external
        DataTables["DataTables"]:::external
    end

    subgraph "Output Layer"
        Static["Static Website"]:::output
        Assets["Asset Management"]:::output
        DataOut["Data Output"]:::output
    end

    %% Relationships
    CSV --> Jekyll
    Objects --> Jekyll
    Config --> Jekyll

    Jekyll --> |Processes| Templates
    Jekyll --> |Uses| Includes
    Jekyll --> |Compiles| Styles
    Jekyll --> |Executes| JS
    Jekyll --> |Runs| Plugins

    Templates --> Static
    Includes --> Static
    Styles --> Assets
    JS --> Static
    
    Search --> Lunr
    Maps --> Leaflet
    Gallery --> Bootstrap
    Timeline --> DataTables

    %% Click Events
    click CSV "https://github.com/CollectionBuilder/collectionbuilder-csv/tree/main//_data/"
    click Objects "https://github.com/CollectionBuilder/collectionbuilder-csv/tree/main//objects/"
    click Config "https://github.com/CollectionBuilder/collectionbuilder-csv/blob/main//_config.yml"
    click Templates "https://github.com/CollectionBuilder/collectionbuilder-csv/tree/main//_layouts/"
    click Includes "https://github.com/CollectionBuilder/collectionbuilder-csv/tree/main//_includes/"
    click Styles "https://github.com/CollectionBuilder/collectionbuilder-csv/tree/main//_sass/"
    click JS "https://github.com/CollectionBuilder/collectionbuilder-csv/tree/main//_includes/js/"
    click Plugins "https://github.com/CollectionBuilder/collectionbuilder-csv/tree/main//_plugins/"
    click Search "https://github.com/CollectionBuilder/collectionbuilder-csv/blob/main//_layouts/search.html"
    click Maps "https://github.com/CollectionBuilder/collectionbuilder-csv/blob/main//_layouts/map.html"
    click Gallery "https://github.com/CollectionBuilder/collectionbuilder-csv/blob/main//_includes/feature/gallery.html"
    click Timeline "https://github.com/CollectionBuilder/collectionbuilder-csv/blob/main//_layouts/timeline.html"
    click Assets "https://github.com/CollectionBuilder/collectionbuilder-csv/tree/main//assets/"
    click DataOut "https://github.com/CollectionBuilder/collectionbuilder-csv/tree/main//assets/data/"

    %% Styling
    classDef core fill:#f9f,stroke:#333,stroke-width:2px
    classDef component fill:#bbf,stroke:#333
    classDef feature fill:#bfb,stroke:#333
    classDef data fill:#fbb,stroke:#333
    classDef config fill:#ffb,stroke:#333
    classDef external fill:#ddd,stroke:#333
    classDef output fill:#bff,stroke:#333

    %% Legend
    subgraph Legend
        L1["Core System"]:::core
        L2["Components"]:::component
        L3["Features"]:::feature
        L4[("Data Storage")]:::data
        L5["Configuration"]:::config
        L6["External Services"]:::external
        L7["Output"]:::output
    end
```
