# virtualflybrain/vfb2 architecture

> Architecture diagram of the GitHub repository virtualflybrain/vfb2, 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/virtualflybrain/vfb2
- Repository: https://github.com/virtualflybrain/vfb2

## Overview

VFB2 is a static documentation site for Virtual Fly Brain. Its principal workflow is visitors consulting the site’s documentation and reference material; the repository also includes a term-page generator that fetches VFB term data, formats report pages, and writes them to disk. The README establishes the site’s purpose, while source excerpts support the generator and metadata-refresh relationships. The theme’s scripts and some documented site capabilities are present in the tree, but their runtime wiring was not sampled, so those links are omitted.

Main entry points: [`vfbterms.py`](https://github.com/virtualflybrain/vfb2/blob/master/vfbterms.py) (Term page generator), [`scripts/fetch_video_metadata.py`](https://github.com/virtualflybrain/vfb2/blob/master/scripts/fetch_video_metadata.py) (Video metadata refresh), [`content/en`](https://github.com/virtualflybrain/vfb2/tree/master/content/en) (Documentation pages), [`data/videos.json`](https://github.com/virtualflybrain/vfb2/blob/master/data/videos.json) (Video metadata)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Documentation site"]
  node_site_docs["Documentation pages"]
  node_api_guides["API guides"]
  node_feature_guides["Website feature guides"]
  node_data_guides["Data guides"]
  node_tutorials["Tutorials"]
  node_news["News and releases"]
  node_hosted_resources["Hosted resources"]
  node_video_content["Video content"]
end

subgraph group_theme["Site theme"]
  node_site_theme["Site layouts"]
  node_theme_app["Theme interactions<br/>[app.js]"]
  node_connectome_view["Connectome interaction<br/>[connectome.js]"]
end

subgraph group_data_tools["Data tools"]
  node_term_generator["Term page generator<br/>[vfbterms.py]"]
  node_term_formatter["Report formatting<br/>[vfbterms.py]"]
  node_term_reports["Generated term reports"]
  node_video_refresh["Video metadata refresh"]
  node_video_metadata["Video metadata<br/>[videos.json]"]
end

node_visitor(("Site visitor"))
node_term_api["VFB term API"]

node_visitor -->|"consults"| node_site_docs
node_term_generator -->|"fetches terms"| node_term_api
node_term_generator -->|"formats data"| node_term_formatter
node_term_generator -->|"writes reports"| node_term_reports
node_video_refresh -->|"scans shortcodes"| node_video_content
node_video_refresh -->|"writes metadata"| node_video_metadata

click node_site_docs "https://github.com/virtualflybrain/vfb2/tree/master/content/en"
click node_api_guides "https://github.com/virtualflybrain/vfb2/tree/master/content/en/docs/APIs"
click node_feature_guides "https://github.com/virtualflybrain/vfb2/tree/master/content/en/docs/Website%20Features"
click node_data_guides "https://github.com/virtualflybrain/vfb2/tree/master/content/en/docs/Data"
click node_tutorials "https://github.com/virtualflybrain/vfb2/tree/master/content/en/docs/Tutorials"
click node_news "https://github.com/virtualflybrain/vfb2/tree/master/content/en/blog"
click node_hosted_resources "https://github.com/virtualflybrain/vfb2/tree/master/content/en/hosted"
click node_site_theme "https://github.com/virtualflybrain/vfb2/tree/master/themes/vfb-nova/layouts"
click node_theme_app "https://github.com/virtualflybrain/vfb2/blob/master/themes/vfb-nova/assets/js/app.js"
click node_connectome_view "https://github.com/virtualflybrain/vfb2/blob/master/themes/vfb-nova/assets/js/connectome.js"
click node_term_generator "https://github.com/virtualflybrain/vfb2/blob/master/vfbterms.py"
click node_term_formatter "https://github.com/virtualflybrain/vfb2/blob/master/vfbterms.py"
click node_video_refresh "https://github.com/virtualflybrain/vfb2/blob/master/scripts/fetch_video_metadata.py"
click node_video_content "https://github.com/virtualflybrain/vfb2/tree/master/content/en"
click node_video_metadata "https://github.com/virtualflybrain/vfb2/blob/master/data/videos.json"

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_site_docs,node_api_guides,node_feature_guides,node_data_guides,node_tutorials,node_news,node_hosted_resources,node_video_content toneBlue
class node_site_theme,node_theme_app,node_connectome_view toneAmber
class node_term_generator,node_term_formatter,node_term_reports,node_video_refresh,node_video_metadata,node_term_api toneMint
class node_visitor toneIndigo
```

## Components

### Documentation site

- [Documentation pages](https://github.com/virtualflybrain/vfb2/tree/master/content/en): `content/en`
- [API guides](https://github.com/virtualflybrain/vfb2/tree/master/content/en/docs/APIs): `content/en/docs/APIs`
- [Website feature guides](https://github.com/virtualflybrain/vfb2/tree/master/content/en/docs/Website%20Features): `content/en/docs/Website Features`
- [Data guides](https://github.com/virtualflybrain/vfb2/tree/master/content/en/docs/Data): `content/en/docs/Data`
- [Tutorials](https://github.com/virtualflybrain/vfb2/tree/master/content/en/docs/Tutorials): `content/en/docs/Tutorials`
- [News and releases](https://github.com/virtualflybrain/vfb2/tree/master/content/en/blog): `content/en/blog`
- [Hosted resources](https://github.com/virtualflybrain/vfb2/tree/master/content/en/hosted): `content/en/hosted`
- [Video content](https://github.com/virtualflybrain/vfb2/tree/master/content/en): `content/en`

### Site theme

- [Site layouts](https://github.com/virtualflybrain/vfb2/tree/master/themes/vfb-nova/layouts): `themes/vfb-nova/layouts`
- [Theme interactions](https://github.com/virtualflybrain/vfb2/blob/master/themes/vfb-nova/assets/js/app.js): `themes/vfb-nova/assets/js/app.js`
- [Connectome interaction](https://github.com/virtualflybrain/vfb2/blob/master/themes/vfb-nova/assets/js/connectome.js): `themes/vfb-nova/assets/js/connectome.js`

### Data tools

- [Term page generator](https://github.com/virtualflybrain/vfb2/blob/master/vfbterms.py): `vfbterms.py`
- [Report formatting](https://github.com/virtualflybrain/vfb2/blob/master/vfbterms.py): `vfbterms.py`
- **Generated term reports**
- [Video metadata refresh](https://github.com/virtualflybrain/vfb2/blob/master/scripts/fetch_video_metadata.py): `scripts/fetch_video_metadata.py`
- [Video metadata](https://github.com/virtualflybrain/vfb2/blob/master/data/videos.json): `data/videos.json`

### Other components

- **Site visitor**
- **VFB term API**

## Connections

- Site visitor → Documentation pages: consults (evidence: `README.md`)
- Term page generator → VFB term API: fetches terms (evidence: `vfbterms.py`)
- Term page generator → Report formatting: formats data (evidence: `vfbterms.py`)
- Term page generator → Generated term reports: writes reports (evidence: `vfbterms.py`)
- Video metadata refresh → Video content: scans shortcodes (evidence: `scripts/fetch_video_metadata.py`)
- Video metadata refresh → Video metadata: writes metadata (evidence: `scripts/fetch_video_metadata.py`)
