# 23bitstudio/teamgraph architecture

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

- Interactive diagram: https://gitdiagram.com/23bitstudio/teamgraph
- Repository: https://github.com/23bitstudio/teamgraph

## Overview

TeamGraph is a WordPress plugin for managing an organization and publishing accessible org charts and team directories. The main workflow runs from an admin editing members and reporting relationships, through WordPress REST endpoints and stored member data, to a block or shortcode rendering a filtered tree, grid, or list for visitors. Admin capabilities also include organization terms, color guides, CSV transfer, and sample data. The README and excerpts establish the major features; several PHP internals and front-end implementation details were not excerpted, so their internal call relationships are not expanded.

Main entry points: [`src/admin/index.js`](https://github.com/23bitstudio/teamgraph/blob/main/src/admin/index.js) (Admin screen router), [`includes/class-teamgraph-rest.php`](https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-rest.php) (REST endpoints), [`src/admin/api.js`](https://github.com/23bitstudio/teamgraph/blob/main/src/admin/api.js) (Admin REST client), [`includes/class-teamgraph-data.php`](https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-data.php) (Member records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Admin screens"]
  node_members_screen["Member directory<br/>[Members.js]"]
  node_member_form["Member editor<br/>[MemberForm.js]"]
  node_builder["Chart builder<br/>[Builder.js]"]
  node_organization_screen["Organization settings<br/>[Organization.js]"]
  node_theme_screen["Color guide editor<br/>[Theme.js]"]
  node_settings_screen["Settings and CSV<br/>[Settings.js]"]
end

subgraph group_admincore["Admin services"]
  node_admin_mount["Admin screen router<br/>[index.js]"]
  node_admin_api["Admin REST client<br/>[api.js]"]
  node_admin_components["Shared admin UI<br/>[components.js]"]
end

subgraph group_wordpress["WordPress integration"]
  node_rest["REST endpoints"]
  node_block_editor["Chart block editor<br/>[index.js]"]
  node_block_render["Dynamic block"]
  node_shortcode["Shortcode renderer"]
end

subgraph group_domain["Organization data"]
  node_member_data["Member records"]
  node_org_terms["Departments and locations"]
  node_theme_data["Color guide settings"]
  node_csv["CSV transfer"]
  node_demo["Sample organization"]
end

subgraph group_frontend["Visitor views"]
  node_frontend_assets["Chart interactions and styles<br/>[teamgraph-chart.js]"]
  node_frontend_styles["Chart layout styles"]
end

node_admin_user(("Administrator"))
node_wp_database[("WordPress database")]
node_visitor(("Site visitor"))

node_admin_user -->|"opens screen"| node_admin_mount
node_admin_mount -->|"mounts"| node_members_screen
node_admin_mount -->|"mounts"| node_member_form
node_admin_mount -->|"mounts"| node_builder
node_admin_mount -->|"mounts"| node_organization_screen
node_admin_mount -->|"mounts"| node_theme_screen
node_admin_mount -->|"mounts"| node_settings_screen
node_members_screen -->|"requests data"| node_admin_api
node_member_form -->|"loads and saves"| node_admin_api
node_builder -->|"updates hierarchy"| node_admin_api
node_organization_screen -->|"manages terms"| node_admin_api
node_theme_screen -->|"saves guides"| node_admin_api
node_settings_screen -->|"manages settings"| node_admin_api
node_admin_api -->|"calls REST API"| node_rest
node_block_editor -->|"loads block options"| node_rest
node_rest -.->|"manages members"| node_member_data
node_rest -.->|"manages terms"| node_org_terms
node_rest -.->|"manages guides"| node_theme_data
node_rest -.->|"handles CSV"| node_csv
node_rest -.->|"handles samples"| node_demo
node_member_data -->|"stores records"| node_wp_database
node_org_terms -->|"stores taxonomies"| node_wp_database
node_theme_data -->|"stores options"| node_wp_database
node_visitor -->|"uses shortcode"| node_shortcode
node_visitor -->|"views block"| node_block_render
node_shortcode -.->|"renders organization"| node_member_data
node_block_render -.->|"renders organization"| node_member_data
node_shortcode -.->|"outputs chart"| node_frontend_assets
node_block_render -.->|"outputs chart"| node_frontend_assets
node_frontend_assets -.->|"enhances layout"| node_frontend_styles

click node_members_screen "https://github.com/23bitstudio/teamgraph/blob/main/src/admin/pages/Members.js"
click node_member_form "https://github.com/23bitstudio/teamgraph/blob/main/src/admin/pages/MemberForm.js"
click node_builder "https://github.com/23bitstudio/teamgraph/blob/main/src/admin/pages/Builder.js"
click node_organization_screen "https://github.com/23bitstudio/teamgraph/blob/main/src/admin/pages/Organization.js"
click node_theme_screen "https://github.com/23bitstudio/teamgraph/blob/main/src/admin/pages/Theme.js"
click node_settings_screen "https://github.com/23bitstudio/teamgraph/blob/main/src/admin/pages/Settings.js"
click node_admin_mount "https://github.com/23bitstudio/teamgraph/blob/main/src/admin/index.js"
click node_admin_api "https://github.com/23bitstudio/teamgraph/blob/main/src/admin/api.js"
click node_admin_components "https://github.com/23bitstudio/teamgraph/blob/main/src/admin/components.js"
click node_rest "https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-rest.php"
click node_block_editor "https://github.com/23bitstudio/teamgraph/blob/main/src/block/index.js"
click node_block_render "https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-block.php"
click node_shortcode "https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-shortcode.php"
click node_member_data "https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-data.php"
click node_org_terms "https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-groups.php"
click node_theme_data "https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-settings.php"
click node_csv "https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-csv.php"
click node_demo "https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-demo.php"
click node_frontend_assets "https://github.com/23bitstudio/teamgraph/blob/main/assets/frontend/teamgraph-chart.js"
click node_frontend_styles "https://github.com/23bitstudio/teamgraph/blob/main/assets/frontend/teamgraph-chart.css"

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_members_screen,node_member_form,node_builder,node_organization_screen,node_theme_screen,node_settings_screen toneBlue
class node_admin_mount,node_admin_api,node_admin_components,node_wp_database toneAmber
class node_rest,node_block_editor,node_block_render,node_shortcode toneMint
class node_member_data,node_org_terms,node_theme_data,node_csv,node_demo toneRose
class node_frontend_assets,node_frontend_styles,node_admin_user,node_visitor toneIndigo
```

## Components

### Admin screens

- [Member directory](https://github.com/23bitstudio/teamgraph/blob/main/src/admin/pages/Members.js): `src/admin/pages/Members.js`
- [Member editor](https://github.com/23bitstudio/teamgraph/blob/main/src/admin/pages/MemberForm.js): `src/admin/pages/MemberForm.js`
- [Chart builder](https://github.com/23bitstudio/teamgraph/blob/main/src/admin/pages/Builder.js): `src/admin/pages/Builder.js`
- [Organization settings](https://github.com/23bitstudio/teamgraph/blob/main/src/admin/pages/Organization.js): `src/admin/pages/Organization.js`
- [Color guide editor](https://github.com/23bitstudio/teamgraph/blob/main/src/admin/pages/Theme.js): `src/admin/pages/Theme.js`
- [Settings and CSV](https://github.com/23bitstudio/teamgraph/blob/main/src/admin/pages/Settings.js): `src/admin/pages/Settings.js`

### Admin services

- [Admin screen router](https://github.com/23bitstudio/teamgraph/blob/main/src/admin/index.js): `src/admin/index.js`
- [Admin REST client](https://github.com/23bitstudio/teamgraph/blob/main/src/admin/api.js): `src/admin/api.js`
- [Shared admin UI](https://github.com/23bitstudio/teamgraph/blob/main/src/admin/components.js): `src/admin/components.js`

### WordPress integration

- [REST endpoints](https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-rest.php): `includes/class-teamgraph-rest.php`
- [Chart block editor](https://github.com/23bitstudio/teamgraph/blob/main/src/block/index.js): `src/block/index.js`
- [Dynamic block](https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-block.php): `includes/class-teamgraph-block.php`
- [Shortcode renderer](https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-shortcode.php): `includes/class-teamgraph-shortcode.php`

### Organization data

- [Member records](https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-data.php): `includes/class-teamgraph-data.php`
- [Departments and locations](https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-groups.php): `includes/class-teamgraph-groups.php`
- [Color guide settings](https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-settings.php): `includes/class-teamgraph-settings.php`
- [CSV transfer](https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-csv.php): `includes/class-teamgraph-csv.php`
- [Sample organization](https://github.com/23bitstudio/teamgraph/blob/main/includes/class-teamgraph-demo.php): `includes/class-teamgraph-demo.php`

### Visitor views

- [Chart interactions and styles](https://github.com/23bitstudio/teamgraph/blob/main/assets/frontend/teamgraph-chart.js): `assets/frontend/teamgraph-chart.js`
- [Chart layout styles](https://github.com/23bitstudio/teamgraph/blob/main/assets/frontend/teamgraph-chart.css): `assets/frontend/teamgraph-chart.css`

### Other components

- **Administrator**
- **WordPress database**
- **Site visitor**

## Connections

- Administrator → Admin screen router: opens screen (evidence: `src/admin/index.js`)
- Admin screen router → Member directory: mounts (evidence: `src/admin/index.js`)
- Admin screen router → Member editor: mounts (evidence: `src/admin/index.js`)
- Admin screen router → Chart builder: mounts (evidence: `src/admin/index.js`)
- Admin screen router → Organization settings: mounts (evidence: `src/admin/index.js`)
- Admin screen router → Color guide editor: mounts (evidence: `src/admin/index.js`)
- Admin screen router → Settings and CSV: mounts (evidence: `src/admin/index.js`)
- Member directory → Admin REST client: requests data (evidence: `src/admin/pages/Members.js`)
- Member editor → Admin REST client: loads and saves (evidence: `src/admin/pages/MemberForm.js`)
- Chart builder → Admin REST client: updates hierarchy (evidence: `src/admin/pages/Builder.js`)
- Organization settings → Admin REST client: manages terms (evidence: `src/admin/pages/Organization.js`)
- Color guide editor → Admin REST client: saves guides (evidence: `src/admin/pages/Theme.js`)
- Settings and CSV → Admin REST client: manages settings (evidence: `src/admin/pages/Settings.js`)
- Admin REST client → REST endpoints: calls REST API (evidence: `src/admin/api.js`)
- Chart block editor → REST endpoints: loads block options (evidence: `src/block/index.js`)
- REST endpoints → Member records: manages members
- REST endpoints → Departments and locations: manages terms
- REST endpoints → Color guide settings: manages guides
- REST endpoints → CSV transfer: handles CSV
- REST endpoints → Sample organization: handles samples
- Member records → WordPress database: stores records (evidence: `README.md`)
- Departments and locations → WordPress database: stores taxonomies (evidence: `README.md`)
- Color guide settings → WordPress database: stores options (evidence: `README.md`)
- Site visitor → Shortcode renderer: uses shortcode (evidence: `README.md`)
- Site visitor → Dynamic block: views block (evidence: `README.md`)
- Shortcode renderer → Member records: renders organization
- Dynamic block → Member records: renders organization
- Shortcode renderer → Chart interactions and styles: outputs chart
- Dynamic block → Chart interactions and styles: outputs chart
- Chart interactions and styles → Chart layout styles: enhances layout
