# pedrowerkhaizer/emb-people-intelligence-hub architecture

> Architecture diagram of the GitHub repository pedrowerkhaizer/emb-people-intelligence-hub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pedrowerkhaizer/emb-people-intelligence-hub
- Repository: https://github.com/pedrowerkhaizer/emb-people-intelligence-hub

## Overview

People Intelligence Hub is an internal People Analytics catalog: employees open the portal, receive group-aware visibility, search or navigate to an item, and view its details or linked report. The administration console manages the catalog and related navigation, audience groups, useful links, and updates; server-side catalog logic validates and persists changes. The README documents additional features such as favorites, feedback, and simulation, but sampled excerpts do not establish all of their wiring, so those connections are not inferred.

Main entry points: [`server.js`](https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/server.js) (HTTP server), [`public/app.js`](https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/app.js) (Catalog experience), [`public/admin-core.js`](https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/admin-core.js) (Admin workflow), [`api/catalogStore.js`](https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/api/catalogStore.js) (Catalog persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Employee portal"]
  node_portal_ui["Hub interface<br/>[index.html]"]
  node_hub["Catalog experience<br/>[app.js]"]
  node_shared["Shared helpers<br/>[catalog-utils.js]"]
end

subgraph group_identity["Identity and access"]
  node_msal["MSAL authentication<br/>[msal-auth.js]"]
  node_roles["Role resolution<br/>[index.js]"]
end

subgraph group_admin["Catalog administration"]
  node_admin_ui["Admin console<br/>[admin.html]"]
  node_admin_core["Admin workflow<br/>[admin-core.js]"]
  node_admin_table["Catalog table<br/>[admin-table.js]"]
  node_admin_forms["Catalog editor<br/>[admin-forms.js]"]
  node_payload_validation["Form validation"]
end

subgraph group_backend["Server and catalog data"]
  node_server["HTTP server<br/>[server.js]"]
  node_catalog_store["Catalog persistence<br/>[catalogStore.js]"]
  node_catalog_data[("Catalog data")]
  node_seed_data["Initial catalog seeds<br/>[items.json]"]
end

node_employee(("Employee"))
node_admin_user(("Admin user"))
node_entra{{"Entra ID"}}
node_graph{{"Microsoft Graph"}}
node_report_service{{"Linked reports"}}

node_employee -->|"opens"| node_portal_ui
node_portal_ui -->|"loads"| node_hub
node_hub -->|"fetches catalogs"| node_server
node_server -->|"reads catalogs"| node_catalog_store
node_catalog_store -->|"reads and writes"| node_catalog_data
node_seed_data -->|"seeds missing data"| node_catalog_store
node_hub -->|"uses status helpers"| node_shared
node_hub -.->|"initializes sign-in"| node_msal
node_msal -.->|"authenticates"| node_entra
node_hub -.->|"requests roles"| node_server
node_server -->|"resolves groups"| node_roles
node_roles -->|"checks membership"| node_graph
node_admin_user -->|"opens"| node_admin_ui
node_admin_ui -->|"loads"| node_admin_core
node_admin_core -->|"renders catalogs"| node_admin_table
node_admin_core -->|"loads editor"| node_admin_forms
node_admin_forms -->|"validates input"| node_payload_validation
node_admin_core -.->|"gets access token"| node_msal
node_admin_core -->|"calls admin API"| node_server
node_server -->|"authorizes admin"| node_roles
node_server -->|"mutates catalogs"| node_catalog_store
node_hub -->|"opens linked report"| node_report_service

click node_portal_ui "https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/index.html"
click node_hub "https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/app.js"
click node_shared "https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/lib/catalog-utils.js"
click node_admin_ui "https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/admin.html"
click node_admin_core "https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/admin-core.js"
click node_admin_table "https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/admin-table.js"
click node_admin_forms "https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/admin-forms.js"
click node_payload_validation "https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/lib/validate-payload.js"
click node_msal "https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/msal-auth.js"
click node_server "https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/server.js"
click node_roles "https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/api/GetRoles/index.js"
click node_catalog_store "https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/api/catalogStore.js"
click node_seed_data "https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/seed/items.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_portal_ui,node_hub,node_shared,node_admin_user toneBlue
class node_msal,node_roles toneAmber
class node_admin_ui,node_admin_core,node_admin_table,node_admin_forms,node_payload_validation toneMint
class node_server,node_catalog_store,node_catalog_data,node_seed_data toneRose
class node_employee,node_entra,node_graph,node_report_service toneIndigo
```

## Components

### Employee portal

- [Hub interface](https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/index.html): `public/index.html`
- [Catalog experience](https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/app.js): `public/app.js`
- [Shared helpers](https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/lib/catalog-utils.js): `public/lib/catalog-utils.js`

### Identity and access

- [MSAL authentication](https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/msal-auth.js): `public/msal-auth.js`
- [Role resolution](https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/api/GetRoles/index.js): `api/GetRoles/index.js`

### Catalog administration

- [Admin console](https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/admin.html): `public/admin.html`
- [Admin workflow](https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/admin-core.js): `public/admin-core.js`
- [Catalog table](https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/admin-table.js): `public/admin-table.js`
- [Catalog editor](https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/admin-forms.js): `public/admin-forms.js`
- [Form validation](https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/public/lib/validate-payload.js): `public/lib/validate-payload.js`

### Server and catalog data

- [HTTP server](https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/server.js): `server.js`
- [Catalog persistence](https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/api/catalogStore.js): `api/catalogStore.js`
- **Catalog data**
- [Initial catalog seeds](https://github.com/pedrowerkhaizer/emb-people-intelligence-hub/blob/main/seed/items.json): `seed/items.json`

### Other components

- **Employee**
- **Admin user**
- **Entra ID**
- **Microsoft Graph**
- **Linked reports**

## Connections

- Employee → Hub interface: opens
- Hub interface → Catalog experience: loads
- Catalog experience → HTTP server: fetches catalogs
- HTTP server → Catalog persistence: reads catalogs
- Catalog persistence → Catalog data: reads and writes
- Initial catalog seeds → Catalog persistence: seeds missing data
- Catalog experience → Shared helpers: uses status helpers
- Catalog experience → MSAL authentication: initializes sign-in
- MSAL authentication → Entra ID: authenticates
- Catalog experience → HTTP server: requests roles
- HTTP server → Role resolution: resolves groups
- Role resolution → Microsoft Graph: checks membership
- Admin user → Admin console: opens
- Admin console → Admin workflow: loads
- Admin workflow → Catalog table: renders catalogs
- Admin workflow → Catalog editor: loads editor
- Catalog editor → Form validation: validates input
- Admin workflow → MSAL authentication: gets access token
- Admin workflow → HTTP server: calls admin API
- HTTP server → Role resolution: authorizes admin
- HTTP server → Catalog persistence: mutates catalogs
- Catalog experience → Linked reports: opens linked report
