# semechko-s/web architecture

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

- Interactive diagram: https://gitdiagram.com/semechko-s/web
- Repository: https://github.com/semechko-s/web

## Overview

ValeraApi is a REST service for managing Valera records and applying life-action rules to their state. Clients use the CRUD and activity routes; the controller delegates to a service, which loads or saves entities through EF Core and SQLite. Swagger/OpenAPI is also exposed in development. The entity contains the domain rules and state normalization. The README documents the persistence and API capabilities; wiring beyond the sampled startup and source excerpts is not inferred.

Main entry points: [`ValeraApi/Services/ValeraService.cs`](https://github.com/semechko-s/web/blob/main/ValeraApi/Services/ValeraService.cs) (Valera Service), [`ValeraApi/Program.cs`](https://github.com/semechko-s/web/blob/main/ValeraApi/Program.cs) (Application Startup), [`ValeraApi/Controllers/ValeraController.cs`](https://github.com/semechko-s/web/blob/main/ValeraApi/Controllers/ValeraController.cs) (Valera Controller), [`ValeraApi/Data/AppDbContext.cs`](https://github.com/semechko-s/web/blob/main/ValeraApi/Data/AppDbContext.cs) (EF Core Context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_controller["Valera Controller"]
  node_swagger["Swagger UI"]
end

subgraph group_domain["Valera Domain"]
  node_service["Valera Service<br/>[ValeraService.cs]"]
  node_service_contract["Service Contract<br/>[IValeraService.cs]"]
  node_valera["Valera State Rules<br/>[Valera.cs]"]
end

subgraph group_persistence["Persistence"]
  node_dbcontext["EF Core Context<br/>[AppDbContext.cs]"]
  node_sqlite[("SQLite Database")]
end

subgraph group_startup["Application Setup"]
  node_program["Application Startup<br/>[Program.cs]"]
end

node_client(("API Client"))

node_client -->|"sends requests"| node_controller
node_controller -->|"calls operations"| node_service
node_service -->|"queries and saves"| node_dbcontext
node_service -->|"applies actions"| node_valera
node_controller -->|"uses interface"| node_service_contract
node_program -->|"configures and creates"| node_dbcontext
node_program -->|"registers service"| node_service
node_dbcontext -.->|"stores records"| node_sqlite
node_program -->|"enables in development"| node_swagger
node_client -->|"explores API"| node_swagger

click node_controller "https://github.com/semechko-s/web/blob/main/ValeraApi/Controllers/ValeraController.cs"
click node_service "https://github.com/semechko-s/web/blob/main/ValeraApi/Services/ValeraService.cs"
click node_service_contract "https://github.com/semechko-s/web/blob/main/ValeraApi/Services/IValeraService.cs"
click node_valera "https://github.com/semechko-s/web/blob/main/ValeraApi/Models/Valera.cs"
click node_dbcontext "https://github.com/semechko-s/web/blob/main/ValeraApi/Data/AppDbContext.cs"
click node_program "https://github.com/semechko-s/web/blob/main/ValeraApi/Program.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_controller,node_swagger,node_client toneBlue
class node_service,node_service_contract,node_valera toneAmber
class node_dbcontext,node_sqlite toneMint
class node_program toneRose
```

## Components

### HTTP API

- [Valera Controller](https://github.com/semechko-s/web/blob/main/ValeraApi/Controllers/ValeraController.cs): `ValeraApi/Controllers/ValeraController.cs`
- **Swagger UI**

### Valera Domain

- [Valera Service](https://github.com/semechko-s/web/blob/main/ValeraApi/Services/ValeraService.cs): `ValeraApi/Services/ValeraService.cs`
- [Service Contract](https://github.com/semechko-s/web/blob/main/ValeraApi/Services/IValeraService.cs): `ValeraApi/Services/IValeraService.cs`
- [Valera State Rules](https://github.com/semechko-s/web/blob/main/ValeraApi/Models/Valera.cs): `ValeraApi/Models/Valera.cs`

### Persistence

- [EF Core Context](https://github.com/semechko-s/web/blob/main/ValeraApi/Data/AppDbContext.cs): `ValeraApi/Data/AppDbContext.cs`
- **SQLite Database**

### Application Setup

- [Application Startup](https://github.com/semechko-s/web/blob/main/ValeraApi/Program.cs): `ValeraApi/Program.cs`

### Other components

- **API Client**

## Connections

- API Client → Valera Controller: sends requests (evidence: `README.md`)
- Valera Controller → Valera Service: calls operations (evidence: `ValeraApi/Controllers/ValeraController.cs`)
- Valera Service → EF Core Context: queries and saves (evidence: `ValeraApi/Services/ValeraService.cs`)
- Valera Service → Valera State Rules: applies actions (evidence: `ValeraApi/Services/ValeraService.cs`)
- Valera Controller → Service Contract: uses interface (evidence: `ValeraApi/Controllers/ValeraController.cs`)
- Application Startup → EF Core Context: configures and creates (evidence: `ValeraApi/Program.cs`)
- Application Startup → Valera Service: registers service (evidence: `ValeraApi/Program.cs`)
- EF Core Context → SQLite Database: stores records (evidence: `README.md`)
- Application Startup → Swagger UI: enables in development (evidence: `ValeraApi/Program.cs`)
- API Client → Swagger UI: explores API (evidence: `README.md`)
