How genesyscloudblueprints/analytics-detail-record-metrics-blueprint works
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: main.ts Application controller · index.html SPA host · view.ts Metrics view · vite.config.ts Vite runtime
Components 14
Browser application
- SPA host
src/index.html - Application controller · Initializes access, requests metrics, and coordinates rendering.
src/scripts/main.ts - Runtime configuration · Centralizes organization, OAuth, endpoint, and query settings.
src/scripts/config.ts - Metric record handling · Selects or transforms returned analytics records before display.
- Metrics view · Renders analytics detail and analysis UI.
src/scripts/view.ts - Dashboard styles
src/styles/style.css
Genesys Cloud
- Analytics API · Authorized Genesys Cloud analytics data source.
Build, CI & docs
- Vite runtime · Builds and serves the static browser application.
src/vite.config.ts - Project dependencies
src/package.json - TypeScript compiler settings
src/tsconfig.json - CI workflow
.github/workflows/test.yml - Workflow error reporting
.github/workflows/display-error.sh - Blueprint documentation
blueprint/index.md - Architecture flow image
Connections 13
- 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