# michaelkc/hydro-passwords architecture

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

- Interactive diagram: https://gitdiagram.com/michaelkc/hydro-passwords
- Repository: https://github.com/michaelkc/hydro-passwords

## Overview

##### Project type and purpose
- This is a minimal full-stack web application built with ASP.NET Core Razor Pages.
- Purpose: a “tech sample” for Hydro that exposes a password-generation UI and demonstrates styling with TailwindCSS, server‐side hosting, and a custom build pipeline using Nuke.

##### File structure
- Top‐level:
- .github/workflows/ci.yml → CI pipeline definition
- .nuke/ → Nuke build framework schema and parameters
- build.cmd/ps1/sh & build/Build.cs → custom build orchestration (Nuke)
- src/Host/ → Razor Pages web host
- hydro-passwords.sln → Visual Studio/.NET solution
- src/Host contains:
- Pages/ → Razor Pages (UI, components)
- Utils/TailwindHostedService.cs → background service to watch/build Tailwind CSS
- wwwroot/ → static assets (CSS, JS, images)
- Program.cs & appsettings.json → host configuration and startup

##### README
- Only describes “Tech sample for Hydro.” No deeper architecture info. We infer from code: it’s a demonstration web UI, styled with Tailwind, built and tested via Nuke and GitHub Actions.

##### Detail
- Every directory of note in the web host (Pages, Utils, wwwroot).
- How build scripts (.cmd/.sh/.ps1) tie into the Nuke project.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Runtime Environment
    subgraph "Runtime Environment" 
        direction TB
        Browser["Browser Client"]:::runtime
        subgraph "ASP.NET Core Web Host"
            direction TB
            WebHost["Web Host"]:::runtime
            subgraph "Razor Pages"
                direction TB
                Index["Home/Index.cshtml & Index.cshtml.cs"]:::runtime
                Passwords["Home/Passwords.cshtml & Passwords.cshtml.cs"]:::runtime
                PasswordGen["Components/PasswordGenerator.cshtml & PasswordGenerator.cshtml.cs"]:::runtime
                Layout["_Layout.cshtml"]:::runtime
                Error["Error.cshtml & Error.cshtml.cs"]:::runtime
                ViewImports["_ViewImports.cshtml"]:::runtime
                ViewStart["_ViewStart.cshtml"]:::runtime
            end
            subgraph "TailwindHostedService"
                direction TB
                THS["TailwindHostedService.cs"]:::runtime
                TConf["tailwind.config.js"]:::runtime
            end
            StaticMiddleware["Static File Middleware"]:::runtime
            Program["Program.cs"]:::runtime
            AppSettings["appsettings.json"]:::runtime
            HostProj["Host.csproj"]:::runtime
        end
        Browser -->|HTTPS:443| WebHost
        WebHost -->|"invoke CSS build/watch"| THS
        Browser -->|"GET CSS/JS from wwwroot"| StaticMiddleware
    end

    %% Build & CI Pipeline
    subgraph "Build & CI Pipeline"
        direction TB
        Dev["Developer"]:::build
        GH["GitHub Actions CI"]:::ci
        subgraph "Nuke Build"
            direction TB
            Schema[".nuke/build.schema.json"]:::build
            Params[".nuke/parameters.json"]:::build
            BuildCS["build/Build.cs"]:::build
            ConfigCS["build/Configuration.cs"]:::build
            DirProps["build/Directory.Build.props"]:::build
            DirTargets["build/Directory.Build.targets"]:::build
            BuildProj["_build.csproj"]:::build
            BuildCmd["build.cmd"]:::build
            BuildPs["build.ps1"]:::build
            BuildSh["build.sh"]:::build
        end
        Artifacts["Build Artifacts"]:::build
        Dev -->|"commit code"| GH
        GH -->|"runs CI workflow"| Schema
        Schema --> Params
        Params --> BuildCS
        BuildCS --> ConfigCS
        ConfigCS --> DirProps
        DirProps --> DirTargets
        DirTargets --> BuildProj
        BuildProj --> BuildCmd
        BuildCmd --> BuildPs
        BuildPs --> BuildSh
        BuildSh --> Artifacts
        Artifacts -->|"deploy artifacts"| WebHost
    end

    %% Click Events
    click Browser "https://github.com/michaelkc/hydro-passwords/tree/main/src/Host/wwwroot/"
    click Index "https://github.com/michaelkc/hydro-passwords/blob/main/src/Host/Pages/Home/Index.cshtml"
    click Passwords "https://github.com/michaelkc/hydro-passwords/blob/main/src/Host/Pages/Home/Passwords.cshtml"
    click PasswordGen "https://github.com/michaelkc/hydro-passwords/blob/main/src/Host/Pages/Home/Components/PasswordGenerator.cshtml"
    click Layout "https://github.com/michaelkc/hydro-passwords/blob/main/src/Host/Pages/Shared/_Layout.cshtml"
    click Error "https://github.com/michaelkc/hydro-passwords/blob/main/src/Host/Pages/Error.cshtml"
    click ViewImports "https://github.com/michaelkc/hydro-passwords/blob/main/src/Host/Pages/_ViewImports.cshtml"
    click ViewStart "https://github.com/michaelkc/hydro-passwords/blob/main/src/Host/Pages/_ViewStart.cshtml"
    click THS "https://github.com/michaelkc/hydro-passwords/blob/main/src/Host/Utils/TailwindHostedService.cs"
    click TConf "https://github.com/michaelkc/hydro-passwords/blob/main/src/Host/tailwind.config.js"
    click Program "https://github.com/michaelkc/hydro-passwords/blob/main/src/Host/Program.cs"
    click AppSettings "https://github.com/michaelkc/hydro-passwords/blob/main/src/Host/appsettings.json"
    click HostProj "https://github.com/michaelkc/hydro-passwords/blob/main/src/Host/Host.csproj"
    click Schema "https://github.com/michaelkc/hydro-passwords/blob/main/.nuke/build.schema.json"
    click Params "https://github.com/michaelkc/hydro-passwords/blob/main/.nuke/parameters.json"
    click BuildCS "https://github.com/michaelkc/hydro-passwords/blob/main/build/Build.cs"
    click ConfigCS "https://github.com/michaelkc/hydro-passwords/blob/main/build/Configuration.cs"
    click DirProps "https://github.com/michaelkc/hydro-passwords/blob/main/build/Directory.Build.props"
    click DirTargets "https://github.com/michaelkc/hydro-passwords/blob/main/build/Directory.Build.targets"
    click BuildProj "https://github.com/michaelkc/hydro-passwords/blob/main/build/_build.csproj"
    click BuildCmd "https://github.com/michaelkc/hydro-passwords/blob/main/build.cmd"
    click BuildPs "https://github.com/michaelkc/hydro-passwords/blob/main/build.ps1"
    click BuildSh "https://github.com/michaelkc/hydro-passwords/blob/main/build.sh"
    click GH "https://github.com/michaelkc/hydro-passwords/blob/main/.github/workflows/ci.yml"

    %% Styles
    classDef runtime fill:#cef,stroke:#036,stroke-width:1px
    classDef build fill:#cfc,stroke:#060,stroke-width:1px
    classDef ci fill:#eec,stroke:#930,stroke-width:1px
```
