# dfe-digital/funding-service-cfs-frontend architecture

> Architecture diagram of the GitHub repository dfe-digital/funding-service-cfs-frontend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dfe-digital/funding-service-cfs-frontend
- Repository: https://github.com/dfe-digital/funding-service-cfs-frontend

## Overview

This repository is the Calculate Funding Service web presentation layer: a React client and ASP.NET Core MVC/API application for funding teams. Users navigate the client to manage specifications, calculations, datasets, providers, and funding approvals or releases. The server authorizes requests, coordinates backend APIs, and returns presentation-ready results. Search services shape calculation, dataset, specification, and provider results. The README documents the REST-based platform architecture; sampled server code confirms calculation, dataset, and publishing operations. Unsampled feature internals and most client-to-server routes are not inferred beyond documented relationships.

Main entry points: [`CalculateFunding.Web/calculatefunding-web/src/App.tsx`](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Web/calculatefunding-web/src/App.tsx) (Application routes), [`CalculateFunding.Frontend/Controllers/CalculationController.cs`](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/CalculationController.cs) (Calculations), [`CalculateFunding.Frontend/Controllers/PublishController.cs`](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/PublishController.cs) (Approvals and releases), [`CalculateFunding.Frontend/Controllers/DatasetController.cs`](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/DatasetController.cs) (Dataset management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_react_app["Application routes<br/>[App.tsx]"]
  node_calculation_hook["Calculation search hook"]
  node_dataset_hook["Dataset version hook"]
  node_approval_hook["Provider search hook"]
  node_template_hook["Template search hook"]
end

subgraph group_funding["Funding workflow"]
  node_specs["Specifications"]
  node_calculations["Calculations"]
  node_publishing["Approvals and releases"]
  node_template_builder["Template builder"]
end

subgraph group_data["Data and search"]
  node_datasets["Dataset management"]
  node_provider_results["Provider results"]
  node_calculation_search["Calculation search"]
  node_dataset_search["Dataset search"]
  node_spec_search["Specification search"]
  node_published_search["Published provider search"]
end

subgraph group_operations["Access and operations"]
  node_users["User administration<br/>[UsersController.cs]"]
  node_jobs["Job status<br/>[JobsController.cs]"]
  node_auth["Authorization"]
end

node_user(("Funding user"))
node_backend_apis["Platform REST APIs"]

node_user -->|"uses"| node_react_app
node_react_app -->|"calls REST APIs"| node_backend_apis
node_react_app -->|"routes to"| node_calculation_hook
node_react_app -.->|"routes to"| node_dataset_hook
node_react_app -->|"routes to"| node_approval_hook
node_react_app -->|"routes to"| node_template_hook
node_backend_apis -->|"serves requests"| node_specs
node_backend_apis -->|"serves requests"| node_calculations
node_backend_apis -->|"serves requests"| node_datasets
node_backend_apis -->|"serves requests"| node_publishing
node_backend_apis -->|"serves requests"| node_provider_results
node_backend_apis -.->|"serves requests"| node_users
node_backend_apis -.->|"serves requests"| node_template_builder
node_calculations -->|"checks permissions"| node_auth
node_publishing -->|"checks permissions"| node_auth
node_datasets -->|"creates and updates"| node_backend_apis
node_calculations -->|"edits calculations"| node_backend_apis
node_publishing -->|"queues validation"| node_backend_apis
node_calculation_search -->|"searches calculations"| node_backend_apis
node_dataset_search -->|"searches datasets"| node_backend_apis
node_spec_search -->|"searches specifications"| node_backend_apis
node_published_search -->|"searches providers"| node_backend_apis
node_provider_results -.->|"retrieves results"| node_backend_apis
node_jobs -.->|"retrieves job status"| node_backend_apis

click node_react_app "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Web/calculatefunding-web/src/App.tsx"
click node_calculation_hook "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Web/calculatefunding-web/src/hooks/Calculations/useCalculationProviderSearch.tsx"
click node_dataset_hook "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Web/calculatefunding-web/src/hooks/DataSets/useDataSetVersionSearch.tsx"
click node_approval_hook "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Web/calculatefunding-web/src/hooks/FundingApproval/usePublishedProviderSearch.tsx"
click node_template_hook "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Web/calculatefunding-web/src/hooks/TemplateBuilder/useTemplateSearch.tsx"
click node_specs "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/SpecificationController.cs"
click node_calculations "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/CalculationController.cs"
click node_publishing "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/PublishController.cs"
click node_datasets "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/DatasetController.cs"
click node_provider_results "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/ProviderResultsController.cs"
click node_calculation_search "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Services/CalculationSearchService.cs"
click node_dataset_search "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Services/DatasetSearchService.cs"
click node_spec_search "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Services/SpecificationSearchService.cs"
click node_published_search "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Services/PublishedProviderSearchService.cs"
click node_template_builder "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/TemplateBuildController.cs"
click node_users "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/UsersController.cs"
click node_jobs "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/JobsController.cs"
click node_auth "https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Helpers/IAuthorizationHelper.cs"

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_react_app,node_calculation_hook,node_dataset_hook,node_approval_hook,node_template_hook,node_user toneBlue
class node_specs,node_calculations,node_publishing,node_template_builder toneAmber
class node_datasets,node_provider_results,node_calculation_search,node_dataset_search,node_spec_search,node_published_search,node_backend_apis toneMint
class node_users,node_jobs,node_auth toneRose
```

## Components

### Web client

- [Application routes](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Web/calculatefunding-web/src/App.tsx): `CalculateFunding.Web/calculatefunding-web/src/App.tsx`
- [Calculation search hook](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Web/calculatefunding-web/src/hooks/Calculations/useCalculationProviderSearch.tsx): `CalculateFunding.Web/calculatefunding-web/src/hooks/Calculations/useCalculationProviderSearch.tsx`
- [Dataset version hook](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Web/calculatefunding-web/src/hooks/DataSets/useDataSetVersionSearch.tsx): `CalculateFunding.Web/calculatefunding-web/src/hooks/DataSets/useDataSetVersionSearch.tsx`
- [Provider search hook](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Web/calculatefunding-web/src/hooks/FundingApproval/usePublishedProviderSearch.tsx): `CalculateFunding.Web/calculatefunding-web/src/hooks/FundingApproval/usePublishedProviderSearch.tsx`
- [Template search hook](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Web/calculatefunding-web/src/hooks/TemplateBuilder/useTemplateSearch.tsx): `CalculateFunding.Web/calculatefunding-web/src/hooks/TemplateBuilder/useTemplateSearch.tsx`

### Funding workflow

- [Specifications](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/SpecificationController.cs): `CalculateFunding.Frontend/Controllers/SpecificationController.cs`
- [Calculations](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/CalculationController.cs): `CalculateFunding.Frontend/Controllers/CalculationController.cs`
- [Approvals and releases](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/PublishController.cs): `CalculateFunding.Frontend/Controllers/PublishController.cs`
- [Template builder](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/TemplateBuildController.cs): `CalculateFunding.Frontend/Controllers/TemplateBuildController.cs`

### Data and search

- [Dataset management](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/DatasetController.cs): `CalculateFunding.Frontend/Controllers/DatasetController.cs`
- [Provider results](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/ProviderResultsController.cs): `CalculateFunding.Frontend/Controllers/ProviderResultsController.cs`
- [Calculation search](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Services/CalculationSearchService.cs): `CalculateFunding.Frontend/Services/CalculationSearchService.cs`
- [Dataset search](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Services/DatasetSearchService.cs): `CalculateFunding.Frontend/Services/DatasetSearchService.cs`
- [Specification search](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Services/SpecificationSearchService.cs): `CalculateFunding.Frontend/Services/SpecificationSearchService.cs`
- [Published provider search](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Services/PublishedProviderSearchService.cs): `CalculateFunding.Frontend/Services/PublishedProviderSearchService.cs`

### Access and operations

- [User administration](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/UsersController.cs): `CalculateFunding.Frontend/Controllers/UsersController.cs`
- [Job status](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Controllers/JobsController.cs): `CalculateFunding.Frontend/Controllers/JobsController.cs`
- [Authorization](https://github.com/dfe-digital/funding-service-cfs-frontend/blob/main/CalculateFunding.Frontend/Helpers/IAuthorizationHelper.cs): `CalculateFunding.Frontend/Helpers/IAuthorizationHelper.cs`

### Other components

- **Funding user**
- **Platform REST APIs**

## Connections

- Funding user → Application routes: uses (evidence: `README.md`)
- Application routes → Platform REST APIs: calls REST APIs (evidence: `README.md`)
- Application routes → Calculation search hook: routes to (evidence: `CalculateFunding.Web/calculatefunding-web/src/App.tsx`)
- Application routes → Dataset version hook: routes to
- Application routes → Provider search hook: routes to (evidence: `CalculateFunding.Web/calculatefunding-web/src/App.tsx`)
- Application routes → Template search hook: routes to (evidence: `CalculateFunding.Web/calculatefunding-web/src/App.tsx`)
- Platform REST APIs → Specifications: serves requests (evidence: `README.md`)
- Platform REST APIs → Calculations: serves requests (evidence: `README.md`)
- Platform REST APIs → Dataset management: serves requests (evidence: `README.md`)
- Platform REST APIs → Approvals and releases: serves requests (evidence: `README.md`)
- Platform REST APIs → Provider results: serves requests (evidence: `README.md`)
- Platform REST APIs → User administration: serves requests
- Platform REST APIs → Template builder: serves requests
- Calculations → Authorization: checks permissions (evidence: `CalculateFunding.Frontend/Controllers/CalculationController.cs`)
- Approvals and releases → Authorization: checks permissions (evidence: `CalculateFunding.Frontend/Controllers/PublishController.cs`)
- Dataset management → Platform REST APIs: creates and updates (evidence: `CalculateFunding.Frontend/Controllers/DatasetController.cs`)
- Calculations → Platform REST APIs: edits calculations (evidence: `CalculateFunding.Frontend/Controllers/CalculationController.cs`)
- Approvals and releases → Platform REST APIs: queues validation (evidence: `CalculateFunding.Frontend/Controllers/PublishController.cs`)
- Calculation search → Platform REST APIs: searches calculations (evidence: `CalculateFunding.Frontend/Services/CalculationSearchService.cs`)
- Dataset search → Platform REST APIs: searches datasets
- Specification search → Platform REST APIs: searches specifications
- Published provider search → Platform REST APIs: searches providers (evidence: `CalculateFunding.Frontend/Services/PublishedProviderSearchService.cs`)
- Provider results → Platform REST APIs: retrieves results
- Job status → Platform REST APIs: retrieves job status
