# txmmybxy/timeseriesprocessing architecture

> Architecture diagram of the GitHub repository txmmybxy/timeseriesprocessing, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/txmmybxy/timeseriesprocessing
- Repository: https://github.com/txmmybxy/timeseriesprocessing

## Overview

TimeSeriesProcessing is a .NET API for ingesting semicolon-delimited CSV measurements, validating them, computing per-file aggregates, and storing both aggregates and values. The main upload flow is API → parsing → validation → aggregation and persistence; separate endpoints return filtered, sorted, paginated aggregates or a file’s latest values. The graph reflects calls shown in excerpts and references documented in the source index, plus README capabilities. Some API mappings and persistence details are unsampled, so their internal links are omitted where the caller is not evidenced.

Main entry points: [`TimeSeriesProcessing.Application/Services/Value/ValueService.cs`](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Application/Services/Value/ValueService.cs) (Value workflow), [`TimeSeriesProcessing.Infrastructure/Data/ApplicationDbContext.cs`](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Infrastructure/Data/ApplicationDbContext.cs) (EF data context), [`TimeSeriesProcessing.Application/Services/Result/ResultService.cs`](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Application/Services/Result/ResultService.cs) (Result workflow), [`TimeSeriesProcessing.Api/Controllers/ResultController.cs`](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Api/Controllers/ResultController.cs) (Results endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_result_api["Results endpoint"]
  node_value_api["Values endpoint<br/>[ValueController.cs]"]
  node_error_middleware["Error handling"]
  node_api_contracts["Request and response models<br/>[Features]"]
end

subgraph group_application["Application"]
  node_value_service["Value workflow<br/>[ValueService.cs]"]
  node_result_service["Result workflow<br/>[ResultService.cs]"]
  node_csv_row["CSV row model<br/>[CsvRow.cs]"]
end

subgraph group_infrastructure["Infrastructure"]
  node_parser["CSV parsing<br/>[ParsingService.cs]"]
  node_validation_service["Validation workflow"]
  node_value_validator["Value rules<br/>[ValueValidator.cs]"]
  node_result_repository["Result repository"]
  node_value_repository["Value repository<br/>[ValueRepository.cs]"]
end

subgraph group_domain["Domain and storage"]
  node_db_context["EF data context"]
  node_aggregated_result["File aggregates"]
  node_measurement_value["Measurements"]
end

node_client(("API client"))
node_database[("Relational database")]

node_client -->|"uploads or requests"| node_value_api
node_client -->|"requests results"| node_result_api
node_value_api -->|"delegates to"| node_value_service
node_result_api -->|"delegates to"| node_result_service
node_value_api -->|"uses models"| node_api_contracts
node_result_api -->|"uses models"| node_api_contracts
node_value_service -->|"parses upload"| node_parser
node_value_service -->|"validates rows"| node_validation_service
node_value_service -->|"submits rows"| node_result_service
node_value_service -->|"loads file values"| node_value_repository
node_parser -->|"produces rows"| node_csv_row
node_validation_service -->|"checks each row"| node_value_validator
node_result_service -->|"reads and saves"| node_result_repository
node_result_service -->|"builds aggregate"| node_aggregated_result
node_result_repository -->|"queries and persists"| node_db_context
node_value_repository -->|"queries values"| node_db_context
node_db_context -->|"maps entity"| node_aggregated_result
node_db_context -->|"maps entity"| node_measurement_value
node_db_context -.->|"uses EF provider"| node_database

click node_result_api "https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Api/Controllers/ResultController.cs"
click node_value_api "https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Api/Controllers/ValueController.cs"
click node_error_middleware "https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Api/Middleware/ErrorHandlingMiddleware.cs"
click node_api_contracts "https://github.com/txmmybxy/timeseriesprocessing/tree/main/TimeSeriesProcessing.Api/Features"
click node_value_service "https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Application/Services/Value/ValueService.cs"
click node_result_service "https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Application/Services/Result/ResultService.cs"
click node_csv_row "https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Application/Abstractions/Parsing/CsvRow.cs"
click node_parser "https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Infrastructure/Parsing/ParsingService.cs"
click node_validation_service "https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Infrastructure/Validation/ValidationService.cs"
click node_value_validator "https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Infrastructure/Validation/ValueValidator.cs"
click node_result_repository "https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Infrastructure/Repositories/Result/ResultRepository.cs"
click node_value_repository "https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Infrastructure/Repositories/Value/ValueRepository.cs"
click node_db_context "https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Infrastructure/Data/ApplicationDbContext.cs"
click node_aggregated_result "https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Domain/Models/AggregatedResult.cs"
click node_measurement_value "https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Domain/Models/MeasurementValue.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_result_api,node_value_api,node_error_middleware,node_api_contracts,node_client toneBlue
class node_value_service,node_result_service,node_csv_row,node_database toneAmber
class node_parser,node_validation_service,node_value_validator,node_result_repository,node_value_repository toneMint
class node_db_context,node_aggregated_result,node_measurement_value toneRose
```

## Components

### API

- [Results endpoint](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Api/Controllers/ResultController.cs): `TimeSeriesProcessing.Api/Controllers/ResultController.cs`
- [Values endpoint](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Api/Controllers/ValueController.cs): `TimeSeriesProcessing.Api/Controllers/ValueController.cs`
- [Error handling](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Api/Middleware/ErrorHandlingMiddleware.cs): `TimeSeriesProcessing.Api/Middleware/ErrorHandlingMiddleware.cs`
- [Request and response models](https://github.com/txmmybxy/timeseriesprocessing/tree/main/TimeSeriesProcessing.Api/Features): `TimeSeriesProcessing.Api/Features`

### Application

- [Value workflow](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Application/Services/Value/ValueService.cs): `TimeSeriesProcessing.Application/Services/Value/ValueService.cs`
- [Result workflow](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Application/Services/Result/ResultService.cs): `TimeSeriesProcessing.Application/Services/Result/ResultService.cs`
- [CSV row model](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Application/Abstractions/Parsing/CsvRow.cs): `TimeSeriesProcessing.Application/Abstractions/Parsing/CsvRow.cs`

### Infrastructure

- [CSV parsing](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Infrastructure/Parsing/ParsingService.cs): `TimeSeriesProcessing.Infrastructure/Parsing/ParsingService.cs`
- [Validation workflow](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Infrastructure/Validation/ValidationService.cs): `TimeSeriesProcessing.Infrastructure/Validation/ValidationService.cs`
- [Value rules](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Infrastructure/Validation/ValueValidator.cs): `TimeSeriesProcessing.Infrastructure/Validation/ValueValidator.cs`
- [Result repository](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Infrastructure/Repositories/Result/ResultRepository.cs): `TimeSeriesProcessing.Infrastructure/Repositories/Result/ResultRepository.cs`
- [Value repository](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Infrastructure/Repositories/Value/ValueRepository.cs): `TimeSeriesProcessing.Infrastructure/Repositories/Value/ValueRepository.cs`

### Domain and storage

- [EF data context](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Infrastructure/Data/ApplicationDbContext.cs): `TimeSeriesProcessing.Infrastructure/Data/ApplicationDbContext.cs`
- [File aggregates](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Domain/Models/AggregatedResult.cs): `TimeSeriesProcessing.Domain/Models/AggregatedResult.cs`
- [Measurements](https://github.com/txmmybxy/timeseriesprocessing/blob/main/TimeSeriesProcessing.Domain/Models/MeasurementValue.cs): `TimeSeriesProcessing.Domain/Models/MeasurementValue.cs`

### Other components

- **API client**
- **Relational database**

## Connections

- API client → Values endpoint: uploads or requests (evidence: `README.md`)
- API client → Results endpoint: requests results (evidence: `README.md`)
- Values endpoint → Value workflow: delegates to (evidence: `TimeSeriesProcessing.Api/Controllers/ValueController.cs`)
- Results endpoint → Result workflow: delegates to (evidence: `TimeSeriesProcessing.Api/Controllers/ResultController.cs`)
- Values endpoint → Request and response models: uses models (evidence: `TimeSeriesProcessing.Api/Controllers/ValueController.cs`)
- Results endpoint → Request and response models: uses models (evidence: `TimeSeriesProcessing.Api/Controllers/ResultController.cs`)
- Value workflow → CSV parsing: parses upload (evidence: `TimeSeriesProcessing.Application/Services/Value/ValueService.cs`)
- Value workflow → Validation workflow: validates rows (evidence: `TimeSeriesProcessing.Application/Services/Value/ValueService.cs`)
- Value workflow → Result workflow: submits rows (evidence: `TimeSeriesProcessing.Application/Services/Value/ValueService.cs`)
- Value workflow → Value repository: loads file values (evidence: `TimeSeriesProcessing.Application/Services/Value/ValueService.cs`)
- CSV parsing → CSV row model: produces rows (evidence: `TimeSeriesProcessing.Infrastructure/Parsing/ParsingService.cs`)
- Validation workflow → Value rules: checks each row (evidence: `TimeSeriesProcessing.Infrastructure/Validation/ValidationService.cs`)
- Result workflow → Result repository: reads and saves (evidence: `TimeSeriesProcessing.Application/Services/Result/ResultService.cs`)
- Result workflow → File aggregates: builds aggregate (evidence: `TimeSeriesProcessing.Application/Services/Result/ResultService.cs`)
- Result repository → EF data context: queries and persists (evidence: `TimeSeriesProcessing.Infrastructure/Repositories/Result/ResultRepository.cs`)
- Value repository → EF data context: queries values (evidence: `TimeSeriesProcessing.Infrastructure/Repositories/Value/ValueRepository.cs`)
- EF data context → File aggregates: maps entity (evidence: `TimeSeriesProcessing.Infrastructure/Data/ApplicationDbContext.cs`)
- EF data context → Measurements: maps entity (evidence: `TimeSeriesProcessing.Infrastructure/Data/ApplicationDbContext.cs`)
- EF data context → Relational database: uses EF provider
