# ravikandel/ravi.web architecture

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

- Interactive diagram: https://gitdiagram.com/ravikandel/ravi.web
- Repository: https://github.com/ravikandel/ravi.web

## Overview

This repository contains a small ASP.NET health-check API, its service/repository layers, a generated .NET API client, and a separate Vite/React starter screen. The backend workflow checks database health, builds a service response, maps it to the API model, and returns it through the controller. The generated client can request the health-check endpoint and deserialize its response. The React app currently displays the Vite counter demo and is not shown calling the API. Edges reflect excerpts and source-index references; unsampled wiring is omitted.

Main entry points: [`Ravi.Web.Client/Api/HealthCheckApi.cs`](https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Client/Api/HealthCheckApi.cs) (Health API client), [`Ravi.Web.Services/HealthCheck/HealthCheckService.cs`](https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Services/HealthCheck/HealthCheckService.cs) (Health service), [`Ravi.WebHost/Program.cs`](https://github.com/ravikandel/ravi.web/blob/main/Ravi.WebHost/Program.cs) (ASP.NET host), [`Ravi.Web.Api/ControllersImpl/HealthCheckApiController.cs`](https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Api/ControllersImpl/HealthCheckApiController.cs) (Health controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_host["Web host"]
  node_webhost["ASP.NET host<br/>[Program.cs]"]
  node_environment["Environment settings"]
  node_registration["Service registration"]
end

subgraph group_backend["Health check backend"]
  node_controller["Health controller"]
  node_mapper["Response mapper"]
  node_service["Health service"]
  node_repository["Health repository"]
  node_dbfactory["DB connection factory"]
  node_response["Service response"]
  node_apiresponse["API response model"]
end

subgraph group_client["Generated API client"]
  node_clientapi["Health API client<br/>[HealthCheckApi.cs]"]
  node_clientutils["Client utilities<br/>[ClientUtils.cs]"]
  node_serializer["JSON options"]
  node_clientmodel["Client response model"]
end

subgraph group_frontend["React starter"]
  node_app["Demo app<br/>[App.tsx]"]
end

node_caller(("API caller"))
node_browser(("Browser user"))

node_webhost -->|"reads environment"| node_environment
node_webhost -->|"registers services"| node_registration
node_controller -->|"checks health"| node_service
node_controller -->|"maps response"| node_mapper
node_mapper -->|"maps from"| node_response
node_service -->|"checks database"| node_repository
node_service -->|"builds response"| node_response
node_registration -->|"registers factory"| node_dbfactory
node_clientapi -->|"formats request"| node_clientutils
node_clientapi -->|"uses JSON options"| node_serializer
node_clientapi -->|"deserializes response"| node_clientmodel
node_caller -.->|"invokes client"| node_clientapi
node_clientapi -.->|"HTTP request"| node_webhost
node_browser -.->|"views demo"| node_app

click node_webhost "https://github.com/ravikandel/ravi.web/blob/main/Ravi.WebHost/Program.cs"
click node_environment "https://github.com/ravikandel/ravi.web/blob/main/Ravi.WebHost/Configuration/EnvironmentSettings.cs"
click node_registration "https://github.com/ravikandel/ravi.web/blob/main/Ravi.WebHost/ServiceRegistration.cs"
click node_controller "https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Api/ControllersImpl/HealthCheckApiController.cs"
click node_mapper "https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Api/ControllersImpl/Mappers/ApiMappers/HealthCheckMapper.cs"
click node_service "https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Services/HealthCheck/HealthCheckService.cs"
click node_repository "https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Repositories/HealthCheck/HealthCheckRepository.cs"
click node_dbfactory "https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Repositories/DbConnection/DbConnectionFactory.cs"
click node_response "https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.ServiceModel/HealthCheck/HealthCheckResponse.cs"
click node_apiresponse "https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Api/Models/HealthCheckResponseV1.cs"
click node_clientapi "https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Client/Api/HealthCheckApi.cs"
click node_clientutils "https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Client/Client/ClientUtils.cs"
click node_serializer "https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Client/Client/JsonSerializerOptionsProvider.cs"
click node_clientmodel "https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Client/Model/HealthCheckResponseV1.cs"
click node_app "https://github.com/ravikandel/ravi.web/blob/main/clientApp/src/App.tsx"

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_webhost,node_environment,node_registration,node_browser toneBlue
class node_controller,node_mapper,node_service,node_repository,node_dbfactory,node_response,node_apiresponse toneAmber
class node_clientapi,node_clientutils,node_serializer,node_clientmodel,node_caller toneMint
class node_app toneRose
```

## Components

### Web host

- [ASP.NET host](https://github.com/ravikandel/ravi.web/blob/main/Ravi.WebHost/Program.cs): `Ravi.WebHost/Program.cs`
- [Environment settings](https://github.com/ravikandel/ravi.web/blob/main/Ravi.WebHost/Configuration/EnvironmentSettings.cs): `Ravi.WebHost/Configuration/EnvironmentSettings.cs`
- [Service registration](https://github.com/ravikandel/ravi.web/blob/main/Ravi.WebHost/ServiceRegistration.cs): `Ravi.WebHost/ServiceRegistration.cs`

### Health check backend

- [Health controller](https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Api/ControllersImpl/HealthCheckApiController.cs): `Ravi.Web.Api/ControllersImpl/HealthCheckApiController.cs`
- [Response mapper](https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Api/ControllersImpl/Mappers/ApiMappers/HealthCheckMapper.cs): `Ravi.Web.Api/ControllersImpl/Mappers/ApiMappers/HealthCheckMapper.cs`
- [Health service](https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Services/HealthCheck/HealthCheckService.cs): `Ravi.Web.Services/HealthCheck/HealthCheckService.cs`
- [Health repository](https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Repositories/HealthCheck/HealthCheckRepository.cs): `Ravi.Web.Repositories/HealthCheck/HealthCheckRepository.cs`
- [DB connection factory](https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Repositories/DbConnection/DbConnectionFactory.cs): `Ravi.Web.Repositories/DbConnection/DbConnectionFactory.cs`
- [Service response](https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.ServiceModel/HealthCheck/HealthCheckResponse.cs): `Ravi.Web.ServiceModel/HealthCheck/HealthCheckResponse.cs`
- [API response model](https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Api/Models/HealthCheckResponseV1.cs): `Ravi.Web.Api/Models/HealthCheckResponseV1.cs`

### Generated API client

- [Health API client](https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Client/Api/HealthCheckApi.cs): `Ravi.Web.Client/Api/HealthCheckApi.cs`
- [Client utilities](https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Client/Client/ClientUtils.cs): `Ravi.Web.Client/Client/ClientUtils.cs`
- [JSON options](https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Client/Client/JsonSerializerOptionsProvider.cs): `Ravi.Web.Client/Client/JsonSerializerOptionsProvider.cs`
- [Client response model](https://github.com/ravikandel/ravi.web/blob/main/Ravi.Web.Client/Model/HealthCheckResponseV1.cs): `Ravi.Web.Client/Model/HealthCheckResponseV1.cs`

### React starter

- [Demo app](https://github.com/ravikandel/ravi.web/blob/main/clientApp/src/App.tsx): `clientApp/src/App.tsx`

### Other components

- **API caller**
- **Browser user**

## Connections

- ASP.NET host → Environment settings: reads environment (evidence: `Ravi.WebHost/Program.cs`)
- ASP.NET host → Service registration: registers services (evidence: `Ravi.WebHost/Program.cs`)
- Health controller → Health service: checks health (evidence: `Ravi.Web.Api/ControllersImpl/HealthCheckApiController.cs`)
- Health controller → Response mapper: maps response (evidence: `Ravi.Web.Api/ControllersImpl/HealthCheckApiController.cs`)
- Response mapper → Service response: maps from (evidence: `Ravi.Web.Api/ControllersImpl/Mappers/ApiMappers/HealthCheckMapper.cs`)
- Health service → Health repository: checks database (evidence: `Ravi.Web.Services/HealthCheck/HealthCheckService.cs`)
- Health service → Service response: builds response (evidence: `Ravi.Web.Services/HealthCheck/HealthCheckService.cs`)
- Service registration → DB connection factory: registers factory (evidence: `Ravi.WebHost/ServiceRegistration.cs`)
- Health API client → Client utilities: formats request (evidence: `Ravi.Web.Client/Api/HealthCheckApi.cs`)
- Health API client → JSON options: uses JSON options (evidence: `Ravi.Web.Client/Api/HealthCheckApi.cs`)
- Health API client → Client response model: deserializes response (evidence: `Ravi.Web.Client/Api/HealthCheckApi.cs`)
- API caller → Health API client: invokes client
- Health API client → ASP.NET host: HTTP request
- Browser user → Demo app: views demo
