# nyulibraries/primo-customization architecture

> Architecture diagram of the GitHub repository nyulibraries/primo-customization, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nyulibraries/primo-customization
- Repository: https://github.com/nyulibraries/primo-customization

## Overview

This repository customizes NYU’s Primo VE discovery interface across institution views, with shared directives and campus-specific assets. The primary workflow is to edit a view or shared customization, preview it in local Primo with CDN assets, then deploy CDN changes or create and upload a Primo customization package. The graph includes the shared browser runtime and the documented local proxy/CDN environment. Evidence is limited to the README and sampled source; unsampled customization and packaging internals are represented only at paths supported by the tree.

Main entry points: [`primo-explore-devenv/gulp/tasks/08-servers.js`](https://github.com/nyulibraries/primo-customization/blob/develop/primo-explore-devenv/gulp/tasks/08-servers.js) (Preview server), [`tools/cdn-server/server.mjs`](https://github.com/nyulibraries/primo-customization/blob/develop/tools/cdn-server/server.mjs) (Local CDN server), [`custom`](https://github.com/nyulibraries/primo-customization/tree/develop/custom) (Institution views), [`primo-explore-devenv/gulp/primoProxy.js`](https://github.com/nyulibraries/primo-customization/blob/develop/primo-explore-devenv/gulp/primoProxy.js) (Primo proxy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customization["Primo customizations"]
  node_views["Institution views"]
  node_customhtmlcss["View HTML and CSS"]
  node_colors["View color settings<br/>[colors.json]"]
end

subgraph group_runtime["Shared browser runtime"]
  node_sharedconfig["Shared configuration<br/>[01-config.js]"]
  node_filters["Shared filters<br/>[02-filters.js]"]
  node_injection["Directive injection<br/>[03-inject.js]"]
  node_libkey["LibKey integration<br/>[04-libkey.js]"]
  node_autodirectives["Generated directives"]
  node_runtimeentry["Runtime startup<br/>[06-run.js]"]
  node_module["Angular module<br/>[custom.module.js]"]
end

subgraph group_preview["Local preview"]
  node_cdn["Local CDN server<br/>[server.mjs]"]
  node_devconfig["Preview configuration<br/>[config.js]"]
  node_proxy["Primo proxy<br/>[primoProxy.js]"]
  node_previewserver["Preview server<br/>[08-servers.js]"]
  node_browsersync["Browser reload"]
end

subgraph group_delivery["Customization delivery"]
  node_package["Primo package"]
end

node_engineer(("Customizer"))
node_primo["Primo VE"]
node_cdnassets["CDN assets"]

node_engineer -->|"edits view"| node_views
node_engineer -->|"edits assets"| node_cdnassets
node_views -.->|"contains view files"| node_customhtmlcss
node_previewserver -->|"routes requests"| node_proxy
node_previewserver -->|"reads settings"| node_devconfig
node_previewserver -->|"starts server"| node_browsersync
node_proxy -->|"reads settings"| node_devconfig
node_previewserver -->|"proxies requests"| node_primo
node_engineer -->|"starts locally"| node_cdn
node_cdn -->|"serves files"| node_cdnassets
node_engineer -->|"opens preview"| node_primo
node_primo -.->|"loads custom assets"| node_cdn
node_engineer -->|"creates package"| node_package
node_package -->|"uploads package"| node_primo
node_engineer -->|"deploys changes"| node_cdnassets

click node_views "https://github.com/nyulibraries/primo-customization/tree/develop/custom"
click node_sharedconfig "https://github.com/nyulibraries/primo-customization/blob/develop/custom/00_common/js/01-config.js"
click node_filters "https://github.com/nyulibraries/primo-customization/blob/develop/custom/00_common/js/02-filters.js"
click node_injection "https://github.com/nyulibraries/primo-customization/blob/develop/custom/00_common/js/03-inject.js"
click node_libkey "https://github.com/nyulibraries/primo-customization/blob/develop/custom/00_common/js/04-libkey.js"
click node_autodirectives "https://github.com/nyulibraries/primo-customization/blob/develop/custom/00_common/js/05-autogenerated-custom-directives.js"
click node_runtimeentry "https://github.com/nyulibraries/primo-customization/blob/develop/custom/00_common/js/06-run.js"
click node_module "https://github.com/nyulibraries/primo-customization/blob/develop/custom/00_common/js/custom.module.js"
click node_customhtmlcss "https://github.com/nyulibraries/primo-customization/tree/develop/custom/01NYU_INST-NYU"
click node_colors "https://github.com/nyulibraries/primo-customization/blob/develop/custom/01NYU_INST-NYU/colors.json"
click node_cdn "https://github.com/nyulibraries/primo-customization/blob/develop/tools/cdn-server/server.mjs"
click node_devconfig "https://github.com/nyulibraries/primo-customization/blob/develop/primo-explore-devenv/gulp/config.js"
click node_proxy "https://github.com/nyulibraries/primo-customization/blob/develop/primo-explore-devenv/gulp/primoProxy.js"
click node_previewserver "https://github.com/nyulibraries/primo-customization/blob/develop/primo-explore-devenv/gulp/tasks/08-servers.js"
click node_browsersync "https://github.com/nyulibraries/primo-customization/blob/develop/primo-explore-devenv/gulp/browserSyncManager.js"
click node_package "https://github.com/nyulibraries/primo-customization/tree/develop/primo-explore-devenv/packages"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_views,node_customhtmlcss,node_colors toneBlue
class node_sharedconfig,node_filters,node_injection,node_libkey,node_autodirectives,node_runtimeentry,node_module toneAmber
class node_cdn,node_devconfig,node_proxy,node_previewserver,node_browsersync toneMint
class node_package toneRose
class node_engineer,node_primo,node_cdnassets toneIndigo
```

## Components

### Primo customizations

- [Institution views](https://github.com/nyulibraries/primo-customization/tree/develop/custom): `custom`
- [View HTML and CSS](https://github.com/nyulibraries/primo-customization/tree/develop/custom/01NYU_INST-NYU): `custom/01NYU_INST-NYU`
- [View color settings](https://github.com/nyulibraries/primo-customization/blob/develop/custom/01NYU_INST-NYU/colors.json): `custom/01NYU_INST-NYU/colors.json`

### Shared browser runtime

- [Shared configuration](https://github.com/nyulibraries/primo-customization/blob/develop/custom/00_common/js/01-config.js): `custom/00_common/js/01-config.js`
- [Shared filters](https://github.com/nyulibraries/primo-customization/blob/develop/custom/00_common/js/02-filters.js): `custom/00_common/js/02-filters.js`
- [Directive injection](https://github.com/nyulibraries/primo-customization/blob/develop/custom/00_common/js/03-inject.js): `custom/00_common/js/03-inject.js`
- [LibKey integration](https://github.com/nyulibraries/primo-customization/blob/develop/custom/00_common/js/04-libkey.js): `custom/00_common/js/04-libkey.js`
- [Generated directives](https://github.com/nyulibraries/primo-customization/blob/develop/custom/00_common/js/05-autogenerated-custom-directives.js): `custom/00_common/js/05-autogenerated-custom-directives.js`
- [Runtime startup](https://github.com/nyulibraries/primo-customization/blob/develop/custom/00_common/js/06-run.js): `custom/00_common/js/06-run.js`
- [Angular module](https://github.com/nyulibraries/primo-customization/blob/develop/custom/00_common/js/custom.module.js): `custom/00_common/js/custom.module.js`

### Local preview

- [Local CDN server](https://github.com/nyulibraries/primo-customization/blob/develop/tools/cdn-server/server.mjs): `tools/cdn-server/server.mjs`
- [Preview configuration](https://github.com/nyulibraries/primo-customization/blob/develop/primo-explore-devenv/gulp/config.js): `primo-explore-devenv/gulp/config.js`
- [Primo proxy](https://github.com/nyulibraries/primo-customization/blob/develop/primo-explore-devenv/gulp/primoProxy.js): `primo-explore-devenv/gulp/primoProxy.js`
- [Preview server](https://github.com/nyulibraries/primo-customization/blob/develop/primo-explore-devenv/gulp/tasks/08-servers.js): `primo-explore-devenv/gulp/tasks/08-servers.js`
- [Browser reload](https://github.com/nyulibraries/primo-customization/blob/develop/primo-explore-devenv/gulp/browserSyncManager.js): `primo-explore-devenv/gulp/browserSyncManager.js`

### Customization delivery

- [Primo package](https://github.com/nyulibraries/primo-customization/tree/develop/primo-explore-devenv/packages): `primo-explore-devenv/packages`

### Other components

- **Customizer**
- **Primo VE**
- **CDN assets**

## Connections

- Customizer → Institution views: edits view (evidence: `README.md`)
- Customizer → CDN assets: edits assets (evidence: `README.md`)
- Institution views → View HTML and CSS: contains view files
- Preview server → Primo proxy: routes requests (evidence: `primo-explore-devenv/gulp/tasks/08-servers.js`)
- Preview server → Preview configuration: reads settings (evidence: `primo-explore-devenv/gulp/tasks/08-servers.js`)
- Preview server → Browser reload: starts server (evidence: `primo-explore-devenv/gulp/tasks/08-servers.js`)
- Primo proxy → Preview configuration: reads settings (evidence: `primo-explore-devenv/gulp/primoProxy.js`)
- Preview server → Primo VE: proxies requests (evidence: `README.md`)
- Customizer → Local CDN server: starts locally (evidence: `README.md`)
- Local CDN server → CDN assets: serves files (evidence: `README.md`)
- Customizer → Primo VE: opens preview (evidence: `README.md`)
- Primo VE → Local CDN server: loads custom assets
- Customizer → Primo package: creates package (evidence: `README.md`)
- Primo package → Primo VE: uploads package (evidence: `README.md`)
- Customizer → CDN assets: deploys changes (evidence: `README.md`)
