# genesyscloudblueprints/analytics-detail-record-metrics-blueprint architecture

> Architecture diagram of the GitHub repository genesyscloudblueprints/analytics-detail-record-metrics-blueprint, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint
- Repository: https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint

## Overview

#### Purpose and Entry Point
This is a Genesys Cloud Developer Blueprint for an Analytics Detailed Record Metric application. It lets an administrator or supervisor gather contact-center performance data from the Genesys Cloud Analytics API and inspect efficiency metrics.

The browser application starts at `src/index.html`, which loads the TypeScript client entry point `src/scripts/main.ts`. Vite builds and serves the application from `src/`.

#### Front-End Application Shell
`src/scripts/main.ts` is the primary control-flow entry point. It initializes the application, coordinates configuration and view behavior, and is the likely integration point for Genesys Cloud SDK/API calls.

`src/index.html` defines the single-page HTML host. Global presentation is supplied by `src/styles/style.css`.

#### Configuration and Genesys Cloud Boundary
`src/scripts/config.ts` centralizes runtime/application configuration. This is the architectural boundary where Genesys Cloud organization, region, OAuth/client settings, API endpoints, or query defaults would be represented rather than embedded in rendering code.

The app’s external service dependency is Genesys Cloud, specifically its Analytics API. The application is intended to run in a browser and authenticate/access cloud analytics data under an authorized admin or supervisor context.

#### Analytics Data Flow
The expected primary flow is:

1. The user opens the Vite-hosted browser application.
2. `src/scripts/main.ts` initializes configured Genesys Cloud access using `src/scripts/config.ts`.
3. The app requests detailed performance/metric data from the Genesys Cloud Analytics API.
4. Returned analytics records are transformed or selected for display.
5. `src/scripts/view.ts` renders the metrics and user-facing analysis UI into `src/index.html`.

The key boundary is between client-side UI/state and remote Genesys Cloud analytics data: API failures, authorization, query timing, and result shapes should be handled before view rendering.

#### Presentation Layer
`src/scripts/view.ts` owns the view/rendering layer, separating DOM/UI updates from application startup and configuration. `src/styles/style.css` provides the visual treatment for the analytics dashboard or record-detail display.

This separation supports changing metric visualization or table/detail presentation without changing API initialization logic.

#### Build and Runtime Infrastructure
The app is a TypeScript/Vite project defined by `src/package.json`, `src/tsconfig.json`, and `src/vite.config.ts`. Vite is the development and build runtime; the deployed artifact is a static browser application that depends on Genesys Cloud APIs at runtime.

CI is provided by `.github/workflows/test.yml`, with workflow error reporting in `.github/workflows/display-error.sh`. Blueprint documentation and its high-level flow image live in `blueprint/index.md` and `blueprint/images/flowchart.png`.

Main entry points: [`src/scripts/main.ts`](https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/scripts/main.ts) (Application controller), [`src/index.html`](https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/index.html) (SPA host), [`src/scripts/view.ts`](https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/scripts/view.ts) (Metrics view), [`src/vite.config.ts`](https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/vite.config.ts) (Vite runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser application"]
  node_html["SPA host<br/>HTML entry<br/>[index.html]"]
  node_main["Application controller<br/>TypeScript entry<br/>[main.ts]"]
  node_config["Runtime configuration<br/>configuration module<br/>[config.ts]"]
  node_analytics_records["Metric record handling<br/>client data flow"]
  node_view["Metrics view<br/>rendering module<br/>[view.ts]"]
  node_styles["Dashboard styles<br/>CSS<br/>[style.css]"]
end

subgraph group_cloud["Genesys Cloud"]
  node_analytics_api{{"Analytics API<br/>external API"}}
end

subgraph group_delivery["Build, CI &amp; docs"]
  node_vite["Vite runtime<br/>build and dev server<br/>[vite.config.ts]"]
  node_package["Project dependencies<br/>package manifest<br/>[package.json]"]
  node_typescript["TypeScript compiler settings<br/>compiler configuration<br/>[tsconfig.json]"]
  node_ci["CI workflow<br/>GitHub Actions workflow<br/>[test.yml]"]
  node_error_script["Workflow error reporting<br/>shell script<br/>[display-error.sh]"]
  node_blueprint["Blueprint documentation<br/>[index.md]"]
  node_flowchart["Architecture flow image<br/>documentation image"]
end

node_html -->|"loads"| node_main
node_main -->|"reads access settings"| node_config
node_main -->|"requests detailed metrics"| node_analytics_api
node_analytics_api -->|"returns records"| node_analytics_records
node_main -->|"coordinates"| node_analytics_records
node_analytics_records -->|"display-ready metrics"| node_view
node_view -->|"updates DOM"| node_html
node_styles -->|"styles host and UI"| node_html
node_vite -->|"serves and builds"| node_html
node_package -->|"defines tooling"| node_vite
node_typescript -->|"compiles"| node_main
node_ci -->|"reports failures"| node_error_script
node_blueprint -->|"includes"| node_flowchart

click node_html "https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/index.html"
click node_main "https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/scripts/main.ts"
click node_config "https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/scripts/config.ts"
click node_view "https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/scripts/view.ts"
click node_styles "https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/styles/style.css"
click node_vite "https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/vite.config.ts"
click node_package "https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/package.json"
click node_typescript "https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/tsconfig.json"
click node_ci "https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/.github/workflows/test.yml"
click node_error_script "https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/.github/workflows/display-error.sh"
click node_blueprint "https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/blueprint/index.md"

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_html,node_main,node_config,node_analytics_records,node_view,node_styles toneBlue
class node_analytics_api toneAmber
class node_vite,node_package,node_typescript,node_ci,node_error_script,node_blueprint,node_flowchart toneMint
```

## Components

### Browser application

- [SPA host](https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/index.html): HTML entry · `src/index.html`
- [Application controller](https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/scripts/main.ts): TypeScript entry · Initializes access, requests metrics, and coordinates rendering. · `src/scripts/main.ts`
- [Runtime configuration](https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/scripts/config.ts): configuration module · Centralizes organization, OAuth, endpoint, and query settings. · `src/scripts/config.ts`
- **Metric record handling**: client data flow · Selects or transforms returned analytics records before display.
- [Metrics view](https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/scripts/view.ts): rendering module · Renders analytics detail and analysis UI. · `src/scripts/view.ts`
- [Dashboard styles](https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/styles/style.css): CSS · `src/styles/style.css`

### Genesys Cloud

- **Analytics API**: external API · Authorized Genesys Cloud analytics data source.

### Build, CI & docs

- [Vite runtime](https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/vite.config.ts): build and dev server · Builds and serves the static browser application. · `src/vite.config.ts`
- [Project dependencies](https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/package.json): package manifest · `src/package.json`
- [TypeScript compiler settings](https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/src/tsconfig.json): compiler configuration · `src/tsconfig.json`
- [CI workflow](https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/.github/workflows/test.yml): GitHub Actions workflow · `.github/workflows/test.yml`
- [Workflow error reporting](https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/.github/workflows/display-error.sh): shell script · `.github/workflows/display-error.sh`
- [Blueprint documentation](https://github.com/genesyscloudblueprints/analytics-detail-record-metrics-blueprint/blob/main/blueprint/index.md): documentation · `blueprint/index.md`
- **Architecture flow image**: documentation image

## Connections

- SPA host → Application controller: loads
- Application controller → Runtime configuration: reads access settings
- Application controller → Analytics API: requests detailed metrics
- Analytics API → Metric record handling: returns records
- Application controller → Metric record handling: coordinates
- Metric record handling → Metrics view: display-ready metrics
- Metrics view → SPA host: updates DOM
- Dashboard styles → SPA host: styles host and UI
- Vite runtime → SPA host: serves and builds
- Project dependencies → Vite runtime: defines tooling
- TypeScript compiler settings → Application controller: compiles
- CI workflow → Workflow error reporting: reports failures
- Blueprint documentation → Architecture flow image: includes
