# charlesokoli/lagweatherproj architecture

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

- Interactive diagram: https://gitdiagram.com/charlesokoli/lagweatherproj
- Repository: https://github.com/charlesokoli/lagweatherproj

## Overview

LagWeatherProj is a small ASP.NET Core Razor Pages weather application. The main flow loads current weather for the hard-coded city Lagos from WeatherAPI, maps location fields into a report view model, and on the home page’s POST appends that model as JSON to a local text file. A separate report page also requests weather data but only extracts the location name. No README was provided; edges reflect only shown handlers and startup configuration.

Main entry points: [`LagWeatherProj/Pages/Index.cshtml.cs`](https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/Pages/Index.cshtml.cs) (Home handler), [`LagWeatherProj/Pages/ReportPage.cshtml.cs`](https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/Pages/ReportPage.cshtml.cs) (Report handler), [`LagWeatherProj/Program.cs`](https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/Program.cs) (App startup), [`LagWeatherProj/ViewModel/ReportVm.cs`](https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/ViewModel/ReportVm.cs) (Report model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Razor web app"]
  node_startup["App startup<br/>[Program.cs]"]
  node_error["Error handler<br/>[Error.cshtml.cs]"]
  node_privacy["Privacy handler<br/>[Privacy.cshtml.cs]"]
end

subgraph group_weather["Weather reporting"]
  node_home["Home handler<br/>[Index.cshtml.cs]"]
  node_report["Report handler"]
  node_model["Report model<br/>[ReportVm.cs]"]
  node_history[("Local JSON history<br/>[Index.cshtml.cs]")]
end

node_user(("Browser user"))
node_weatherapi["WeatherAPI"]

node_startup -->|"maps pages"| node_home
node_startup -->|"maps pages"| node_report
node_startup -->|"routes errors"| node_error
node_user -.->|"requests page"| node_home
node_user -.->|"requests page"| node_report
node_home -->|"fetches current weather"| node_weatherapi
node_home -->|"populates"| node_model
node_home -->|"appends JSON"| node_history
node_report -->|"fetches current weather"| node_weatherapi
node_report -->|"declares result"| node_model

click node_startup "https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/Program.cs"
click node_home "https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/Pages/Index.cshtml.cs"
click node_report "https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/Pages/ReportPage.cshtml.cs"
click node_model "https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/ViewModel/ReportVm.cs"
click node_history "https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/Pages/Index.cshtml.cs"
click node_error "https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/Pages/Error.cshtml.cs"
click node_privacy "https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/Pages/Privacy.cshtml.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_startup,node_error,node_privacy,node_user toneBlue
class node_home,node_report,node_model,node_history toneAmber
class node_weatherapi toneMint
```

## Components

### Razor web app

- [App startup](https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/Program.cs): `LagWeatherProj/Program.cs`
- [Error handler](https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/Pages/Error.cshtml.cs): `LagWeatherProj/Pages/Error.cshtml.cs`
- [Privacy handler](https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/Pages/Privacy.cshtml.cs): `LagWeatherProj/Pages/Privacy.cshtml.cs`

### Weather reporting

- [Home handler](https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/Pages/Index.cshtml.cs): `LagWeatherProj/Pages/Index.cshtml.cs`
- [Report handler](https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/Pages/ReportPage.cshtml.cs): `LagWeatherProj/Pages/ReportPage.cshtml.cs`
- [Report model](https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/ViewModel/ReportVm.cs): `LagWeatherProj/ViewModel/ReportVm.cs`
- [Local JSON history](https://github.com/charlesokoli/lagweatherproj/blob/master/LagWeatherProj/Pages/Index.cshtml.cs): `LagWeatherProj/Pages/Index.cshtml.cs`

### Other components

- **Browser user**
- **WeatherAPI**

## Connections

- App startup → Home handler: maps pages (evidence: `LagWeatherProj/Program.cs`)
- App startup → Report handler: maps pages (evidence: `LagWeatherProj/Program.cs`)
- App startup → Error handler: routes errors (evidence: `LagWeatherProj/Program.cs`)
- Browser user → Home handler: requests page
- Browser user → Report handler: requests page
- Home handler → WeatherAPI: fetches current weather (evidence: `LagWeatherProj/Pages/Index.cshtml.cs`)
- Home handler → Report model: populates (evidence: `LagWeatherProj/Pages/Index.cshtml.cs`)
- Home handler → Local JSON history: appends JSON (evidence: `LagWeatherProj/Pages/Index.cshtml.cs`)
- Report handler → WeatherAPI: fetches current weather (evidence: `LagWeatherProj/Pages/ReportPage.cshtml.cs`)
- Report handler → Report model: declares result (evidence: `LagWeatherProj/Pages/ReportPage.cshtml.cs`)
