# cyco77/pptb-fast-record-counter architecture

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

- Interactive diagram: https://gitdiagram.com/cyco77/pptb-fast-record-counter
- Repository: https://github.com/cyco77/pptb-fast-record-counter

## Overview

Fast Record Counter is a Power Platform Toolbox tool for exploring Dataverse entities and counting their records. In the interactive workflow, the tool loads solutions and customizable entities, applies publisher/solution/name filters, and lets the user count one or many entities; counts appear in a sortable grid with progress and notifications, and results can be copied or exported. A separate MCP headless entry point resolves optional solution selectors, filters entities, counts records, and returns per-entity counts and totals. Dataverse access is centralized in the service module. The graph follows documented capabilities where implementation excerpts were incomplete.

Main entry points: [`src/components/Overview.tsx`](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/components/Overview.tsx) (Overview workflow), [`src/services/dataverseService.ts`](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/services/dataverseService.ts) (Dataverse service), [`src/mcp/headless.ts`](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/mcp/headless.ts) (Headless invocation), [`src/App.tsx`](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/App.tsx) (Application shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interactive["Interactive tool"]
  node_app["Application shell<br/>[App.tsx]"]
  node_overview["Overview workflow<br/>[Overview.tsx]"]
  node_filters["Filters and actions<br/>[Filter.tsx]"]
  node_grid["Entity data grid"]
  node_grid_error["Grid error boundary"]
  node_event_log["Event log<br/>[EventLog.tsx]"]
end

subgraph group_domain["Dataverse operations"]
  node_dataverse["Dataverse service"]
  node_blacklist["Entity exclusions<br/>[entityBlacklist.ts]"]
end

subgraph group_headless["MCP invocation"]
  node_headless_entry["Headless invocation<br/>[headless.ts]"]
  node_headless_result["Counts and totals<br/>[headless.ts]"]
end

subgraph group_platform["Toolbox platform"]
  node_connection["Connection state<br/>[useConnection.ts]"]
  node_events["Toolbox events"]
  node_toolbox_api["Toolbox API<br/>[useToolboxAPI.ts]"]
  node_logger["Logger service<br/>[loggerService.ts]"]
end

node_user(("Tool user"))
node_mcp_client(("MCP caller"))
node_dataverse_api["Dataverse API"]

node_user -->|"opens tool"| node_app
node_app -->|"loads connection"| node_connection
node_app -->|"subscribes"| node_events
node_events -->|"dispatches events"| node_app
node_app -->|"renders"| node_overview
node_overview -->|"loads solutions"| node_dataverse
node_overview -->|"loads entities and views"| node_dataverse
node_overview -->|"checks entities"| node_blacklist
node_overview -->|"passes filter state"| node_filters
node_user -->|"selects and searches"| node_filters
node_filters -->|"dispatches actions"| node_overview
node_overview -->|"renders grid within"| node_grid_error
node_grid_error -->|"renders"| node_grid
node_overview -->|"requests record counts"| node_dataverse
node_dataverse -->|"queries metadata and counts"| node_dataverse_api
node_overview -->|"logs operations"| node_logger
node_logger -->|"reports log entries"| node_toolbox_api
node_event_log -->|"receives log entries"| node_logger
node_mcp_client -->|"invokes"| node_headless_entry
node_headless_entry -->|"resolves solutions and loads entities"| node_dataverse
node_headless_entry -->|"checks entities"| node_blacklist
node_headless_entry -->|"requests batch counts"| node_dataverse
node_headless_entry -->|"returns counts and totals"| node_headless_result

click node_app "https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/App.tsx"
click node_overview "https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/components/Overview.tsx"
click node_filters "https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/components/Filter.tsx"
click node_grid "https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/components/EntitiesDataGrid.tsx"
click node_grid_error "https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/components/EntityGridErrorBoundary.tsx"
click node_event_log "https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/components/EventLog.tsx"
click node_connection "https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/hooks/useConnection.ts"
click node_events "https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/hooks/useToolboxEvents.ts"
click node_toolbox_api "https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/hooks/useToolboxAPI.ts"
click node_logger "https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/services/loggerService.ts"
click node_dataverse "https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/services/dataverseService.ts"
click node_blacklist "https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/utils/entityBlacklist.ts"
click node_headless_entry "https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/mcp/headless.ts"
click node_headless_result "https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/mcp/headless.ts"

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_app,node_overview,node_filters,node_grid,node_grid_error,node_event_log,node_user toneBlue
class node_dataverse,node_blacklist toneAmber
class node_headless_entry,node_headless_result,node_dataverse_api toneMint
class node_connection,node_events,node_toolbox_api,node_logger toneRose
class node_mcp_client toneIndigo
```

## Components

### Interactive tool

- [Application shell](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/App.tsx): `src/App.tsx`
- [Overview workflow](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/components/Overview.tsx): `src/components/Overview.tsx`
- [Filters and actions](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/components/Filter.tsx): `src/components/Filter.tsx`
- [Entity data grid](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/components/EntitiesDataGrid.tsx): `src/components/EntitiesDataGrid.tsx`
- [Grid error boundary](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/components/EntityGridErrorBoundary.tsx): `src/components/EntityGridErrorBoundary.tsx`
- [Event log](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/components/EventLog.tsx): `src/components/EventLog.tsx`

### Dataverse operations

- [Dataverse service](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/services/dataverseService.ts): `src/services/dataverseService.ts`
- [Entity exclusions](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/utils/entityBlacklist.ts): `src/utils/entityBlacklist.ts`

### MCP invocation

- [Headless invocation](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/mcp/headless.ts): `src/mcp/headless.ts`
- [Counts and totals](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/mcp/headless.ts): `src/mcp/headless.ts`

### Toolbox platform

- [Connection state](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/hooks/useConnection.ts): `src/hooks/useConnection.ts`
- [Toolbox events](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/hooks/useToolboxEvents.ts): `src/hooks/useToolboxEvents.ts`
- [Toolbox API](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/hooks/useToolboxAPI.ts): `src/hooks/useToolboxAPI.ts`
- [Logger service](https://github.com/cyco77/pptb-fast-record-counter/blob/main/src/services/loggerService.ts): `src/services/loggerService.ts`

### Other components

- **Tool user**
- **MCP caller**
- **Dataverse API**

## Connections

- Tool user → Application shell: opens tool
- Application shell → Connection state: loads connection
- Application shell → Toolbox events: subscribes
- Toolbox events → Application shell: dispatches events
- Application shell → Overview workflow: renders
- Overview workflow → Dataverse service: loads solutions
- Overview workflow → Dataverse service: loads entities and views
- Overview workflow → Entity exclusions: checks entities
- Overview workflow → Filters and actions: passes filter state
- Tool user → Filters and actions: selects and searches
- Filters and actions → Overview workflow: dispatches actions
- Overview workflow → Grid error boundary: renders grid within
- Grid error boundary → Entity data grid: renders
- Overview workflow → Dataverse service: requests record counts
- Dataverse service → Dataverse API: queries metadata and counts
- Overview workflow → Logger service: logs operations
- Logger service → Toolbox API: reports log entries
- Event log → Logger service: receives log entries
- MCP caller → Headless invocation: invokes
- Headless invocation → Dataverse service: resolves solutions and loads entities
- Headless invocation → Entity exclusions: checks entities
- Headless invocation → Dataverse service: requests batch counts
- Headless invocation → Counts and totals: returns counts and totals
