# sut25-avancerad-systemutveckling/lektion-1-oktober architecture

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

- Interactive diagram: https://gitdiagram.com/sut25-avancerad-systemutveckling/lektion-1-oktober
- Repository: https://github.com/sut25-avancerad-systemutveckling/lektion-1-oktober

## Overview

TodoApp is an ASP.NET Core API for listing and creating todos, backed by EF Core and PostgreSQL; it also includes a sample weather endpoint. The main todo flow is an HTTP client request routed by the application to the todos controller, which reads or writes through the database context and returns todo data. The weather endpoint generates forecasts independently. The excerpts show controller, model, context, and application setup; no README was provided.

Main entry points: [`TodoApp/TodoApp/Program.cs`](https://github.com/sut25-avancerad-systemutveckling/lektion-1-oktober/blob/main/TodoApp/TodoApp/Program.cs) (ASP.NET Host), [`TodoApp/TodoApp/Data/TodoDbContext.cs`](https://github.com/sut25-avancerad-systemutveckling/lektion-1-oktober/blob/main/TodoApp/TodoApp/Data/TodoDbContext.cs) (Todo Context), [`TodoApp/TodoApp/Controllers/TodosController.cs`](https://github.com/sut25-avancerad-systemutveckling/lektion-1-oktober/blob/main/TodoApp/TodoApp/Controllers/TodosController.cs) (Todos Controller), [`TodoApp/TodoApp/Controllers/WeatherForecastController.cs`](https://github.com/sut25-avancerad-systemutveckling/lektion-1-oktober/blob/main/TodoApp/TodoApp/Controllers/WeatherForecastController.cs) (Weather Controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_host["ASP.NET Host<br/>[Program.cs]"]
  node_todos["Todos Controller<br/>[TodosController.cs]"]
end

subgraph group_persistence["Todo Persistence"]
  node_context["Todo Context<br/>[TodoDbContext.cs]"]
  node_todo["Todo Entity<br/>[Todo.cs]"]
  node_postgres[("PostgreSQL")]
end

subgraph group_sample["Weather Sample"]
  node_weather["Weather Controller"]
  node_forecast["Forecast Model<br/>[WeatherForecast.cs]"]
end

node_client(("HTTP Client"))

node_client -->|"sends HTTP"| node_host
node_host -->|"maps controllers"| node_todos
node_todos -->|"queries and saves"| node_context
node_context -->|"models entity"| node_todo
node_host -->|"configures and creates"| node_context
node_host -->|"configures Npgsql"| node_postgres
node_client -->|"requests weather"| node_host
node_host -->|"maps controllers"| node_weather
node_weather -->|"creates forecasts"| node_forecast

click node_host "https://github.com/sut25-avancerad-systemutveckling/lektion-1-oktober/blob/main/TodoApp/TodoApp/Program.cs"
click node_todos "https://github.com/sut25-avancerad-systemutveckling/lektion-1-oktober/blob/main/TodoApp/TodoApp/Controllers/TodosController.cs"
click node_context "https://github.com/sut25-avancerad-systemutveckling/lektion-1-oktober/blob/main/TodoApp/TodoApp/Data/TodoDbContext.cs"
click node_todo "https://github.com/sut25-avancerad-systemutveckling/lektion-1-oktober/blob/main/TodoApp/TodoApp/Models/Todo.cs"
click node_weather "https://github.com/sut25-avancerad-systemutveckling/lektion-1-oktober/blob/main/TodoApp/TodoApp/Controllers/WeatherForecastController.cs"
click node_forecast "https://github.com/sut25-avancerad-systemutveckling/lektion-1-oktober/blob/main/TodoApp/TodoApp/WeatherForecast.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_host,node_todos,node_client toneBlue
class node_context,node_todo,node_postgres toneAmber
class node_weather,node_forecast toneMint
```

## Components

### HTTP API

- [ASP.NET Host](https://github.com/sut25-avancerad-systemutveckling/lektion-1-oktober/blob/main/TodoApp/TodoApp/Program.cs): `TodoApp/TodoApp/Program.cs`
- [Todos Controller](https://github.com/sut25-avancerad-systemutveckling/lektion-1-oktober/blob/main/TodoApp/TodoApp/Controllers/TodosController.cs): `TodoApp/TodoApp/Controllers/TodosController.cs`

### Todo Persistence

- [Todo Context](https://github.com/sut25-avancerad-systemutveckling/lektion-1-oktober/blob/main/TodoApp/TodoApp/Data/TodoDbContext.cs): `TodoApp/TodoApp/Data/TodoDbContext.cs`
- [Todo Entity](https://github.com/sut25-avancerad-systemutveckling/lektion-1-oktober/blob/main/TodoApp/TodoApp/Models/Todo.cs): `TodoApp/TodoApp/Models/Todo.cs`
- **PostgreSQL**

### Weather Sample

- [Weather Controller](https://github.com/sut25-avancerad-systemutveckling/lektion-1-oktober/blob/main/TodoApp/TodoApp/Controllers/WeatherForecastController.cs): `TodoApp/TodoApp/Controllers/WeatherForecastController.cs`
- [Forecast Model](https://github.com/sut25-avancerad-systemutveckling/lektion-1-oktober/blob/main/TodoApp/TodoApp/WeatherForecast.cs): `TodoApp/TodoApp/WeatherForecast.cs`

### Other components

- **HTTP Client**

## Connections

- HTTP Client → ASP.NET Host: sends HTTP
- ASP.NET Host → Todos Controller: maps controllers (evidence: `TodoApp/TodoApp/Program.cs`)
- Todos Controller → Todo Context: queries and saves (evidence: `TodoApp/TodoApp/Controllers/TodosController.cs`)
- Todo Context → Todo Entity: models entity (evidence: `TodoApp/TodoApp/Data/TodoDbContext.cs`)
- ASP.NET Host → Todo Context: configures and creates (evidence: `TodoApp/TodoApp/Program.cs`)
- ASP.NET Host → PostgreSQL: configures Npgsql (evidence: `TodoApp/TodoApp/Program.cs`)
- HTTP Client → ASP.NET Host: requests weather
- ASP.NET Host → Weather Controller: maps controllers (evidence: `TodoApp/TodoApp/Program.cs`)
- Weather Controller → Forecast Model: creates forecasts (evidence: `TodoApp/TodoApp/Controllers/WeatherForecastController.cs`)
