# mluker/seis630_final architecture

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

- Interactive diagram: https://gitdiagram.com/mluker/seis630_final
- Repository: https://github.com/mluker/seis630_final

## Overview

##### Project type and purpose
- This is a backend-only RESTful Weather API built in ASP.NET Core (C#).
- Purpose: collect/store weather readings by location, run trend and summary reports, expose endpoints for CRUD operations and analytics.

##### File structure
- Top-level project “WeatherApi” is a single ASP.NET Core solution (.sln).
- Subfolders:
- Data – EF Core DbContext (WeatherDbContext), seed data (DbSeedData)
- Models – POCO classes (Location, WeatherData)
- Endpoints – grouped by feature (Locations, Weather, Reports), each containing extension methods or minimal-API handlers
- Properties – launchSettings for local development
- appsettings.template – configuration template (e.g., connection strings)
- Program.cs wires up hosting, middleware, service registrations, and endpoint mappings.
- WeatherApi.csproj defines NuGet dependencies (EF Core, SQL provider, ASP.NET Core packages).

##### README for additional insights
- Confirms use of ASP.NET Core, EF Core, Azure SQL, RESTful design.
- Two main entities: Location ↔ WeatherData (1-to-many).
- Insomnia collection provided for testing.
- Intended for educational/demo use in a database class but follows real-world layering.

##### Detailed elements
- Program.cs / Startup
- Endpoint modules (LocationEndpoints, WeatherEndpoints, ReportEndpoints)
- Data folder (WeatherDbContext, DbSeedData)
- Models folder (Location, WeatherData)
- Insomnia (REST client) or placeholder “Client Apps”

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Clients" 
        Insomnia["Insomnia (REST Client)"]:::client
    end

    subgraph "Weather API Service" 
        PS["Program.cs"]:::code
        CF["appsettings.template"]:::code
        LS["launchSettings.json"]:::code

        subgraph "Endpoints"
            LE["LocationEndpoints"]:::code
            WE["WeatherEndpoints"]:::code
            RE["ReportEndpoints"]:::code
        end

        subgraph "Data Access Layer"
            DC["WeatherDbContext"]:::code
            SD["DbSeedData"]:::code
        end

        subgraph "Domain Models"
            LM["Location"]:::code
            WM["WeatherData"]:::code
        end
    end

    subgraph "Assets & Documentation"
        AED["API Endpoints Diagram"]:::doc
        DMD["Data Model Diagram"]:::doc
    end

    DB["Azure SQL Database\n(WeatherDb)"]:::db

    Insomnia -->|HTTP Request| PS
    PS --> LE
    PS --> WE
    PS --> RE
    PS --> CF
    PS --> LS

    LE -->|uses| DC
    WE -->|uses| DC
    RE -->|uses| DC

    DC -->|runs| SD
    LE -->|maps to| LM
    WE -->|maps to| WM

    DC -->|SQL Queries| DB
    DB -->|Results| DC

    Insomnia --> AED
    Insomnia --> DMD

    click PS "https://github.com/mluker/seis630_final/blob/main/WeatherApi/Program.cs"
    click CF "https://github.com/mluker/seis630_final/blob/main/WeatherApi/appsettings.template"
    click LS "https://github.com/mluker/seis630_final/blob/main/WeatherApi/Properties/launchSettings.json"
    click LE "https://github.com/mluker/seis630_final/blob/main/WeatherApi/Endpoints/Locations/LocationEndpoints.cs"
    click WE "https://github.com/mluker/seis630_final/blob/main/WeatherApi/Endpoints/Weather/WeatherEndpoints.cs"
    click RE "https://github.com/mluker/seis630_final/blob/main/WeatherApi/Endpoints/Reports/ReportEndpoints.cs"
    click DC "https://github.com/mluker/seis630_final/blob/main/WeatherApi/Data/WeatherDbContext.cs"
    click SD "https://github.com/mluker/seis630_final/blob/main/WeatherApi/Data/DbSeedData.cs"
    click LM "https://github.com/mluker/seis630_final/blob/main/WeatherApi/Models/Location.cs"
    click WM "https://github.com/mluker/seis630_final/blob/main/WeatherApi/Models/WeatherData.cs"
    click Insomnia "https://github.com/mluker/seis630_final/blob/main/WeatherApi/assets/insomnia.json"
    click AED "https://github.com/mluker/seis630_final/blob/main/WeatherApi/assets/api_endpoints_diagram.md"
    click DMD "https://github.com/mluker/seis630_final/blob/main/WeatherApi/assets/data_model_diagram.md"

    classDef client fill:#FFA500,stroke:#333,stroke-width:1px
    classDef code fill:#87CEFA,stroke:#333,stroke-width:1px
    classDef db fill:#32CD32,stroke:#333,stroke-width:1px
    classDef doc fill:#D3D3D3,stroke:#333,stroke-width:1px
```
