# giorgibokuchava/todoapi architecture

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

- Interactive diagram: https://gitdiagram.com/giorgibokuchava/todoapi
- Repository: https://github.com/giorgibokuchava/todoapi

## Overview

TodoApi is a small ASP.NET Core REST backend for managing ToDo items. An HTTP client reaches the mapped API controllers, which perform asynchronous CRUD operations through TodoContext and return DTOs; updates include ID checks and concurrency handling. Program.cs configures the in-memory EF Core store and, in Development, OpenAPI/Swagger. The repository also includes a standalone weather-forecast endpoint. The main workflow is supported by sampled controller, model, and startup code; Swagger setup is documented in startup code, but its internal runtime is framework-provided.

Main entry points: [`TodoApi/Program.cs`](https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/Program.cs) (App startup), [`TodoApi/Controllers/TodoItemsController.cs`](https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/Controllers/TodoItemsController.cs) (ToDo controller), [`TodoApi/Models/TodoContext.cs`](https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/Models/TodoContext.cs) (EF context), [`TodoApi/Controllers/WeatherForecastController.cs`](https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/Controllers/WeatherForecastController.cs) (Weather endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hosting["API hosting"]
  node_program["App startup<br/>[Program.cs]"]
  node_swagger["Swagger UI / OpenAPI<br/>[Program.cs]"]
end

subgraph group_endpoints["API endpoints"]
  node_todo_api["ToDo controller"]
  node_weather_api["Weather endpoint"]
  node_weather_model["Forecast model<br/>[WeatherForecast.cs]"]
end

subgraph group_data["ToDo data"]
  node_context["EF context<br/>[TodoContext.cs]"]
  node_todo_item["ToDo entity<br/>[TodoItem.cs]"]
  node_todo_dto["ToDo DTO<br/>[TodoItemsDTO.cs]"]
  node_memory_db[("In-memory store")]
end

node_client(("HTTP client"))

node_client -->|"sends HTTP"| node_program
node_program -->|"maps controllers"| node_todo_api
node_program -->|"maps controllers"| node_weather_api
node_todo_api -->|"queries / saves"| node_context
node_context -->|"reads / writes"| node_memory_db
node_todo_api -->|"creates / updates"| node_todo_item
node_todo_api -->|"maps responses"| node_todo_dto
node_weather_api -->|"creates forecasts"| node_weather_model
node_program -->|"registers context"| node_context
node_program -->|"configures in Development"| node_swagger

click node_program "https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/Program.cs"
click node_todo_api "https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/Controllers/TodoItemsController.cs"
click node_weather_api "https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/Controllers/WeatherForecastController.cs"
click node_weather_model "https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/WeatherForecast.cs"
click node_context "https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/Models/TodoContext.cs"
click node_todo_item "https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/Models/TodoItem.cs"
click node_todo_dto "https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/Models/TodoItemsDTO.cs"
click node_swagger "https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/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_program,node_swagger,node_client toneBlue
class node_todo_api,node_weather_api,node_weather_model toneAmber
class node_context,node_todo_item,node_todo_dto,node_memory_db toneMint
```

## Components

### API hosting

- [App startup](https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/Program.cs): `TodoApi/Program.cs`
- [Swagger UI / OpenAPI](https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/Program.cs): `TodoApi/Program.cs`

### API endpoints

- [ToDo controller](https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/Controllers/TodoItemsController.cs): `TodoApi/Controllers/TodoItemsController.cs`
- [Weather endpoint](https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/Controllers/WeatherForecastController.cs): `TodoApi/Controllers/WeatherForecastController.cs`
- [Forecast model](https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/WeatherForecast.cs): `TodoApi/WeatherForecast.cs`

### ToDo data

- [EF context](https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/Models/TodoContext.cs): `TodoApi/Models/TodoContext.cs`
- [ToDo entity](https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/Models/TodoItem.cs): `TodoApi/Models/TodoItem.cs`
- [ToDo DTO](https://github.com/giorgibokuchava/todoapi/blob/main/TodoApi/Models/TodoItemsDTO.cs): `TodoApi/Models/TodoItemsDTO.cs`
- **In-memory store**

### Other components

- **HTTP client**

## Connections

- HTTP client → App startup: sends HTTP
- App startup → ToDo controller: maps controllers
- App startup → Weather endpoint: maps controllers
- ToDo controller → EF context: queries / saves
- EF context → In-memory store: reads / writes
- ToDo controller → ToDo entity: creates / updates
- ToDo controller → ToDo DTO: maps responses
- Weather endpoint → Forecast model: creates forecasts
- App startup → EF context: registers context
- App startup → Swagger UI / OpenAPI: configures in Development
