# maikho/myhomepage architecture

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

- Interactive diagram: https://gitdiagram.com/maikho/myhomepage
- Repository: https://github.com/maikho/myhomepage

## Overview

#### Purpose and Runtime
MaikHo is a personal .NET 10 modular-monolith platform for a public Markdown portfolio/blog and an authenticated single-user workspace. It runs as an ASP.NET Core Blazor Web App with Interactive Server Rendering; Radzen supports private management UI. The executable composition root is `src/MaikHo.Web/Program.cs`, with Razor routing rooted in `src/MaikHo.Web/Components/Routes.razor`.

#### Layered Modular Monolith
The intended dependency flow is Web → Application → Domain/Contracts, with Infrastructure implementing Application ports. Core projects are `src/MaikHo.Domain/MaikHo.Domain.csproj`, `src/MaikHo.Application/MaikHo.Application.csproj`, and `src/MaikHo.Infrastructure/MaikHo.Infrastructure.csproj`. Application services own use cases and depend on repository/storage abstractions rather than SQLite, filesystems, or HTTP directly.

#### Public Portfolio Content Pipeline
Public routes render Markdown-backed pages, projects, and blog content through Razor pages such as `src/MaikHo.Web/Components/Pages/Blog.razor` and `src/MaikHo.Web/Components/Pages/BlogPost.razor`. Content is read from repository-shipped `content/` but may be overlaid by a configured published-content root. Markdown parsing, target selection, link policy, and filesystem publishing sit in `src/MaikHo.Infrastructure/Portfolio/MarkdownPublicContentRepository.cs` and `src/MaikHo.Infrastructure/Portfolio/MarkdownPublicContentPublisher.cs`.

#### Private Authentication Boundary
`/setup`, `/login`, and `/app` establish a closed single-user browser experience. The web-facing sign-in behavior is in `src/MaikHo.Web/Authentication/PrivateSignInService.cs`; persistent user lookup/setup is isolated behind `src/MaikHo.Application/Authentication/IPrivateUserStore.cs` and implemented by `src/MaikHo.Infrastructure/Authentication/SqlitePrivateUserStore.cs`. Private pages and file actions must be server-authorized; no public registration is intended.

#### Private Workspace Modules
Notes, todos, startpage links, documents, and public-content authoring are separate application modules with service-centered use cases:
- Notes: `src/MaikHo.Application/Notes/NoteService.cs`, UI in `src/MaikHo.Web/Components/Pages/Notes.razor`.
- Todos: `src/MaikHo.Application/Todos/TodoService.cs`, UI in `src/MaikHo.Web/Components/Pages/Todos.razor`.
- Startpage: `src/MaikHo.Application/Startpage/StartpageService.cs`, UI in `src/MaikHo.Web/Components/Pages/Startpage.razor`.
- Content publication: `src/MaikHo.Application/Portfolio/PublicContentPublisherService.cs`, UI in `src/MaikHo.Web/Components/Pages/PublicContentPublisher.razor`.

#### Persistence, Files, and External HTTP
SQLite repositories use handwritten parameterized SQL, including `src/MaikHo.Infrastructure/Notes/SqliteNoteRepository.cs`, `src/MaikHo.Infrastructure/Todos/SqliteTodoRepository.cs`, and `src/MaikHo.Infrastructure/Documents/SqliteDocumentRepository.cs`. PDFs are validated and modeled by the Documents application module, then stored outside web root via `src/MaikHo.Infrastructure/Documents/LocalPrivateDocumentFileStore.cs`; download/view flows originate in `src/MaikHo.Web/Components/Pages/DocumentViewer.razor`. Startpage metadata retrieval is an outbound HTTP boundary in `src/MaikHo.Infrastructure/Startpage/HttpStartpageLinkMetadataReader.cs`.

#### Deployment and Future Boundary
Production is planned as Kestrel bound to localhost behind Caddy on Ubuntu, managed by systemd; deployment contracts are captured in `docs/deployment/ubuntu-server.md` and `docs/decisions/ADR-0007-caddy-reverse-proxy.md`. SQLite, private document objects, published-content overlay, and data-protection keys are host-managed persistent paths. A versioned `/api/v1` and Avalonia client are explicitly future work; current browser authentication must remain distinct from the future OIDC/PKCE-native API boundary.

Main entry points: [`src/MaikHo.Web/Program.cs`](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Web/Program.cs) (ASP.NET Core composition), [`docs/deployment/ubuntu-server.md`](https://github.com/maikho/myhomepage/blob/main/docs/deployment/ubuntu-server.md) (Ubuntu reverse-proxy deployment), [`src/MaikHo.Web/Components/Routes.razor`](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Web/Components/Routes.razor) (Razor routes), [`src/MaikHo.Infrastructure/Portfolio/MarkdownPublicContentRepository.cs`](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Infrastructure/Portfolio/MarkdownPublicContentRepository.cs) (Markdown public content)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web host &amp; UI"]
  node_program{{"ASP.NET Core composition<br/>web host<br/>[Program.cs]"}}
  node_routes["Razor routes<br/>routing<br/>[Routes.razor]"]
  node_public_pages["Public blog pages<br/>Razor pages<br/>[Blog.razor]"]
  node_blog_post["Blog post page<br/>Razor page<br/>[BlogPost.razor]"]
  node_private_signin["Private sign-in<br/>auth service"]
  node_workspace_ui["Private workspace UI<br/>Razor pages"]
  node_document_viewer["Document viewer<br/>Razor page"]
end

subgraph group_application["Application &amp; domain"]
  node_domain["Domain model<br/>domain project"]
  node_application["Application layer<br/>application project"]
  node_private_user_port["Private user store port<br/>application port"]
  node_notes_service["Notes use cases<br/>application service<br/>[NoteService.cs]"]
  node_todos_service["Todo use cases<br/>application service<br/>[TodoService.cs]"]
  node_startpage_service["Startpage use cases<br/>application service"]
  node_publication_service["Content publication use cases<br/>application service"]
  node_documents_module["Documents use cases<br/>application module"]
end

subgraph group_infrastructure["Infrastructure"]
  node_markdown_repository["Markdown public content<br/>content repository"]
  node_markdown_publisher["Markdown publisher<br/>filesystem publisher"]
  node_sqlite_user_store[("SQLite private user store<br/>port adapter")]
  node_sqlite_workspace[("SQLite workspace repositories<br/>SQL repositories")]
  node_private_file_store["Private document file store"]
  node_link_metadata_http["Link metadata HTTP<br/>HTTP adapter"]
end

subgraph group_operations["Host operations"]
  node_deployment["Ubuntu reverse-proxy deployment<br/>deployment contract<br/>[ubuntu-server.md]"]
end

node_program -->|"hosts"| node_routes
node_program -->|"composes"| node_application
node_program -->|"registers"| node_markdown_repository
node_program -->|"registers"| node_sqlite_user_store
node_routes -->|"public routes"| node_public_pages
node_routes -->|"/setup, /login"| node_private_signin
node_routes -->|"/app"| node_workspace_ui
node_public_pages -->|"navigates to"| node_blog_post
node_public_pages -->|"reads content"| node_markdown_repository
node_blog_post -->|"reads Markdown"| node_markdown_repository
node_private_signin -->|"uses"| node_private_user_port
node_private_user_port -.->|"implemented by"| node_sqlite_user_store
node_workspace_ui -->|"notes"| node_notes_service
node_workspace_ui -->|"todos"| node_todos_service
node_workspace_ui -->|"startpage"| node_startpage_service
node_workspace_ui -->|"authoring"| node_publication_service
node_document_viewer -->|"views and downloads"| node_documents_module
node_application -->|"depends on"| node_domain
node_notes_service -->|"persists"| node_sqlite_workspace
node_todos_service -->|"persists"| node_sqlite_workspace
node_documents_module -->|"stores metadata"| node_sqlite_workspace
node_documents_module -->|"stores PDFs"| node_private_file_store
node_startpage_service -->|"retrieves metadata"| node_link_metadata_http
node_publication_service -->|"publishes"| node_markdown_publisher
node_markdown_publisher -->|"writes overlay read by"| node_markdown_repository
node_deployment -->|"runs Kestrel"| node_program
node_deployment -.->|"hosts persistent data"| node_sqlite_workspace
node_deployment -.->|"hosts persistent files"| node_private_file_store
node_deployment -.->|"hosts content overlay"| node_markdown_publisher

click node_program "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Web/Program.cs"
click node_routes "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Web/Components/Routes.razor"
click node_public_pages "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Web/Components/Pages/Blog.razor"
click node_blog_post "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Web/Components/Pages/BlogPost.razor"
click node_private_signin "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Web/Authentication/PrivateSignInService.cs"
click node_document_viewer "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Web/Components/Pages/DocumentViewer.razor"
click node_domain "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Domain/MaikHo.Domain.csproj"
click node_application "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Application/MaikHo.Application.csproj"
click node_private_user_port "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Application/Authentication/IPrivateUserStore.cs"
click node_notes_service "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Application/Notes/NoteService.cs"
click node_todos_service "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Application/Todos/TodoService.cs"
click node_startpage_service "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Application/Startpage/StartpageService.cs"
click node_publication_service "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Application/Portfolio/PublicContentPublisherService.cs"
click node_markdown_repository "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Infrastructure/Portfolio/MarkdownPublicContentRepository.cs"
click node_markdown_publisher "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Infrastructure/Portfolio/MarkdownPublicContentPublisher.cs"
click node_sqlite_user_store "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Infrastructure/Authentication/SqlitePrivateUserStore.cs"
click node_sqlite_workspace "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Infrastructure/Notes/SqliteNoteRepository.cs"
click node_private_file_store "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Infrastructure/Documents/LocalPrivateDocumentFileStore.cs"
click node_link_metadata_http "https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Infrastructure/Startpage/HttpStartpageLinkMetadataReader.cs"
click node_deployment "https://github.com/maikho/myhomepage/blob/main/docs/deployment/ubuntu-server.md"

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_routes,node_public_pages,node_blog_post,node_private_signin,node_workspace_ui,node_document_viewer toneBlue
class node_domain,node_application,node_private_user_port,node_notes_service,node_todos_service,node_startpage_service,node_publication_service,node_documents_module toneAmber
class node_markdown_repository,node_markdown_publisher,node_sqlite_user_store,node_sqlite_workspace,node_private_file_store,node_link_metadata_http toneMint
class node_deployment toneRose
```

## Components

### Web host & UI

- [ASP.NET Core composition](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Web/Program.cs): web host · Blazor Interactive Server host and dependency composition root. · `src/MaikHo.Web/Program.cs`
- [Razor routes](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Web/Components/Routes.razor): routing · `src/MaikHo.Web/Components/Routes.razor`
- [Public blog pages](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Web/Components/Pages/Blog.razor): Razor pages · `src/MaikHo.Web/Components/Pages/Blog.razor`
- [Blog post page](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Web/Components/Pages/BlogPost.razor): Razor page · `src/MaikHo.Web/Components/Pages/BlogPost.razor`
- [Private sign-in](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Web/Authentication/PrivateSignInService.cs): auth service · Establishes the closed single-user browser session. · `src/MaikHo.Web/Authentication/PrivateSignInService.cs`
- **Private workspace UI**: Razor pages · Server-authorized management pages for private modules.
- [Document viewer](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Web/Components/Pages/DocumentViewer.razor): Razor page · `src/MaikHo.Web/Components/Pages/DocumentViewer.razor`

### Application & domain

- [Domain model](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Domain/MaikHo.Domain.csproj): domain project · `src/MaikHo.Domain/MaikHo.Domain.csproj`
- [Application layer](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Application/MaikHo.Application.csproj): application project · Use cases depend on domain contracts and ports. · `src/MaikHo.Application/MaikHo.Application.csproj`
- [Private user store port](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Application/Authentication/IPrivateUserStore.cs): application port · `src/MaikHo.Application/Authentication/IPrivateUserStore.cs`
- [Notes use cases](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Application/Notes/NoteService.cs): application service · `src/MaikHo.Application/Notes/NoteService.cs`
- [Todo use cases](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Application/Todos/TodoService.cs): application service · `src/MaikHo.Application/Todos/TodoService.cs`
- [Startpage use cases](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Application/Startpage/StartpageService.cs): application service · `src/MaikHo.Application/Startpage/StartpageService.cs`
- [Content publication use cases](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Application/Portfolio/PublicContentPublisherService.cs): application service · `src/MaikHo.Application/Portfolio/PublicContentPublisherService.cs`
- **Documents use cases**: application module · Validates and models private PDF documents.

### Infrastructure

- [Markdown public content](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Infrastructure/Portfolio/MarkdownPublicContentRepository.cs): content repository · Reads repository content and the published-content overlay. · `src/MaikHo.Infrastructure/Portfolio/MarkdownPublicContentRepository.cs`
- [Markdown publisher](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Infrastructure/Portfolio/MarkdownPublicContentPublisher.cs): filesystem publisher · Selects targets, applies link policy, and publishes content files. · `src/MaikHo.Infrastructure/Portfolio/MarkdownPublicContentPublisher.cs`
- [SQLite private user store](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Infrastructure/Authentication/SqlitePrivateUserStore.cs): port adapter · `src/MaikHo.Infrastructure/Authentication/SqlitePrivateUserStore.cs`
- [SQLite workspace repositories](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Infrastructure/Notes/SqliteNoteRepository.cs): SQL repositories · Handwritten parameterized SQL persists notes, todos, and document metadata. · `src/MaikHo.Infrastructure/Notes/SqliteNoteRepository.cs`
- [Private document file store](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Infrastructure/Documents/LocalPrivateDocumentFileStore.cs): file store · Stores PDFs outside the web root. · `src/MaikHo.Infrastructure/Documents/LocalPrivateDocumentFileStore.cs`
- [Link metadata HTTP](https://github.com/maikho/myhomepage/blob/main/src/MaikHo.Infrastructure/Startpage/HttpStartpageLinkMetadataReader.cs): HTTP adapter · `src/MaikHo.Infrastructure/Startpage/HttpStartpageLinkMetadataReader.cs`

### Host operations

- [Ubuntu reverse-proxy deployment](https://github.com/maikho/myhomepage/blob/main/docs/deployment/ubuntu-server.md): deployment contract · Kestrel on localhost behind Caddy and systemd; persistent paths are host-managed. · `docs/deployment/ubuntu-server.md`

## Connections

- ASP.NET Core composition → Razor routes: hosts
- ASP.NET Core composition → Application layer: composes
- ASP.NET Core composition → Markdown public content: registers
- ASP.NET Core composition → SQLite private user store: registers
- Razor routes → Public blog pages: public routes
- Razor routes → Private sign-in: /setup, /login
- Razor routes → Private workspace UI: /app
- Public blog pages → Blog post page: navigates to
- Public blog pages → Markdown public content: reads content
- Blog post page → Markdown public content: reads Markdown
- Private sign-in → Private user store port: uses
- Private user store port → SQLite private user store: implemented by
- Private workspace UI → Notes use cases: notes
- Private workspace UI → Todo use cases: todos
- Private workspace UI → Startpage use cases: startpage
- Private workspace UI → Content publication use cases: authoring
- Document viewer → Documents use cases: views and downloads
- Application layer → Domain model: depends on
- Notes use cases → SQLite workspace repositories: persists
- Todo use cases → SQLite workspace repositories: persists
- Documents use cases → SQLite workspace repositories: stores metadata
- Documents use cases → Private document file store: stores PDFs
- Startpage use cases → Link metadata HTTP: retrieves metadata
- Content publication use cases → Markdown publisher: publishes
- Markdown publisher → Markdown public content: writes overlay read by
- Ubuntu reverse-proxy deployment → ASP.NET Core composition: runs Kestrel
- Ubuntu reverse-proxy deployment → SQLite workspace repositories: hosts persistent data
- Ubuntu reverse-proxy deployment → Private document file store: hosts persistent files
- Ubuntu reverse-proxy deployment → Markdown publisher: hosts content overlay
