# vladislavsaltanov/paages architecture

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

- Interactive diagram: https://gitdiagram.com/vladislavsaltanov/paages
- Repository: https://github.com/vladislavsaltanov/paages

## Overview

Paages is a Blazor Server notes product with a separate JWT/PAT API over shared SQLite storage. The main user workflow is authenticated note and folder management in the web UI, backed by user-scoped services, with optional publication by public slug. The README documents rich editor, tree, tabs, and account capabilities; the supplied source excerpts do not expose their component-level wiring, so those branches are represented at subsystem level. Edges cite only documented or indexed relationships.

Main entry points: [`Paages.Api/Program.cs`](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Api/Program.cs) (JWT and PAT API), [`Paages.Web/Program.cs`](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Web/Program.cs) (Web host and cookie auth), [`Paages.Infrastructure/Data/PaagesDbContext.cs`](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Data/PaagesDbContext.cs) (SQLite database), [`Paages.Infrastructure/Services/NoteService.cs`](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Services/NoteService.cs) (Note and folder operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webui["Blazor notes UI<br/>[Paages.Web]"]
  node_tree_ui["Folder tree and editor<br/>[Paages.Web]"]
  node_tabs_ui["Tabs and navigation"]
  node_ui_state["UI state<br/>[UIController.cs]"]
  node_webhost["Web host and cookie auth<br/>[Program.cs]"]
end

subgraph group_api["API access"]
  node_api_host["JWT and PAT API<br/>[Program.cs]"]
  node_api_auth["API authentication"]
  node_api_routes["API endpoints<br/>[Endpoints]"]
end

subgraph group_identity["Identity and accounts"]
  node_account_service["User accounts"]
  node_auth_service["Token lifecycle<br/>[AuthService.cs]"]
  node_account_tokens["Email account tokens"]
  node_email_sender["SMTP email<br/>[SmtpEmailSender.cs]"]
  node_google_oauth["Google OAuth"]
end

subgraph group_content["Notes and publishing"]
  node_note_service["Note and folder operations<br/>[NoteService.cs]"]
  node_app_state["Tree change state<br/>[AppState.cs]"]
  node_publication_service["Publications"]
end

subgraph group_persistence["Shared persistence"]
  node_domain_entities["Domain model<br/>[Entities]"]
  node_database[("SQLite database<br/>[PaagesDbContext.cs]")]
  node_db_setup["SQLite configuration"]
end

node_user(("User"))
node_api_client(("API client"))
node_public_reader(("Public note reader"))

node_user -->|"uses"| node_webui
node_webui -->|"served by"| node_webhost
node_webui -.->|"edits notes"| node_tree_ui
node_webui -->|"navigates via"| node_tabs_ui
node_tabs_ui -->|"queries folders"| node_note_service
node_tabs_ui -->|"expands folders"| node_ui_state
node_webhost -->|"resolves Google user"| node_account_service
node_webhost -->|"handles account links"| node_account_tokens
node_webhost -->|"registers sender"| node_email_sender
node_webhost -->|"registers service"| node_note_service
node_webhost -->|"registers service"| node_publication_service
node_google_oauth -->|"authenticates via"| node_webhost
node_api_client -->|"calls"| node_api_host
node_api_host -->|"maps endpoints"| node_api_routes
node_api_host -->|"configures"| node_api_auth
node_api_host -->|"registers service"| node_account_service
node_api_host -->|"registers service"| node_auth_service
node_api_host -->|"registers service"| node_note_service
node_api_host -->|"registers service"| node_publication_service
node_api_auth -->|"validates PAT"| node_api_host
node_api_routes -->|"handles auth"| node_auth_service
node_auth_service -->|"validates credentials"| node_account_service
node_note_service -->|"reads and writes"| node_database
node_note_service -->|"notifies tree changes"| node_app_state
node_publication_service -->|"reads and writes"| node_database
node_account_service -->|"reads and writes"| node_database
node_auth_service -->|"rotates refresh tokens"| node_database
node_account_tokens -->|"sends account mail"| node_email_sender
node_public_reader -.->|"fetches by slug"| node_publication_service
node_database -->|"stores entities"| node_domain_entities
node_db_setup -->|"configures"| node_database
node_webhost -->|"configures database"| node_db_setup
node_api_host -.->|"configures database"| node_db_setup

click node_webui "https://github.com/vladislavsaltanov/paages/tree/main/Paages.Web"
click node_tree_ui "https://github.com/vladislavsaltanov/paages/tree/main/Paages.Web"
click node_tabs_ui "https://github.com/vladislavsaltanov/paages/blob/main/Paages.Web/Services/NavigationController.cs"
click node_ui_state "https://github.com/vladislavsaltanov/paages/blob/main/Paages.Web/Services/UIController.cs"
click node_webhost "https://github.com/vladislavsaltanov/paages/blob/main/Paages.Web/Program.cs"
click node_api_host "https://github.com/vladislavsaltanov/paages/blob/main/Paages.Api/Program.cs"
click node_api_auth "https://github.com/vladislavsaltanov/paages/blob/main/Paages.Api/Auth/ApiTokenAuthHandler.cs"
click node_api_routes "https://github.com/vladislavsaltanov/paages/tree/main/Paages.Api/Endpoints"
click node_account_service "https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Services/UserAccountService.cs"
click node_auth_service "https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Services/AuthService.cs"
click node_account_tokens "https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Services/AccountTokenService.cs"
click node_email_sender "https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Email/SmtpEmailSender.cs"
click node_note_service "https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Services/NoteService.cs"
click node_app_state "https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Services/AppState.cs"
click node_publication_service "https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Services/PublicationService.cs"
click node_domain_entities "https://github.com/vladislavsaltanov/paages/tree/main/Paages.Domain/Entities"
click node_database "https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Data/PaagesDbContext.cs"
click node_db_setup "https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Data/DatabaseServiceCollectionExtensions.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_webui,node_tree_ui,node_tabs_ui,node_ui_state,node_webhost,node_user,node_api_client toneBlue
class node_api_host,node_api_auth,node_api_routes toneAmber
class node_account_service,node_auth_service,node_account_tokens,node_email_sender,node_google_oauth toneMint
class node_note_service,node_app_state,node_publication_service toneRose
class node_domain_entities,node_database,node_db_setup,node_public_reader toneIndigo
```

## Components

### Web experience

- [Blazor notes UI](https://github.com/vladislavsaltanov/paages/tree/main/Paages.Web): `Paages.Web`
- [Folder tree and editor](https://github.com/vladislavsaltanov/paages/tree/main/Paages.Web): `Paages.Web`
- [Tabs and navigation](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Web/Services/NavigationController.cs): `Paages.Web/Services/NavigationController.cs`
- [UI state](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Web/Services/UIController.cs): `Paages.Web/Services/UIController.cs`
- [Web host and cookie auth](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Web/Program.cs): `Paages.Web/Program.cs`

### API access

- [JWT and PAT API](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Api/Program.cs): `Paages.Api/Program.cs`
- [API authentication](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Api/Auth/ApiTokenAuthHandler.cs): `Paages.Api/Auth/ApiTokenAuthHandler.cs`
- [API endpoints](https://github.com/vladislavsaltanov/paages/tree/main/Paages.Api/Endpoints): `Paages.Api/Endpoints`

### Identity and accounts

- [User accounts](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Services/UserAccountService.cs): `Paages.Infrastructure/Services/UserAccountService.cs`
- [Token lifecycle](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Services/AuthService.cs): `Paages.Infrastructure/Services/AuthService.cs`
- [Email account tokens](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Services/AccountTokenService.cs): `Paages.Infrastructure/Services/AccountTokenService.cs`
- [SMTP email](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Email/SmtpEmailSender.cs): `Paages.Infrastructure/Email/SmtpEmailSender.cs`
- **Google OAuth**

### Notes and publishing

- [Note and folder operations](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Services/NoteService.cs): `Paages.Infrastructure/Services/NoteService.cs`
- [Tree change state](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Services/AppState.cs): `Paages.Infrastructure/Services/AppState.cs`
- [Publications](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Services/PublicationService.cs): `Paages.Infrastructure/Services/PublicationService.cs`

### Shared persistence

- [Domain model](https://github.com/vladislavsaltanov/paages/tree/main/Paages.Domain/Entities): `Paages.Domain/Entities`
- [SQLite database](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Data/PaagesDbContext.cs): `Paages.Infrastructure/Data/PaagesDbContext.cs`
- [SQLite configuration](https://github.com/vladislavsaltanov/paages/blob/main/Paages.Infrastructure/Data/DatabaseServiceCollectionExtensions.cs): `Paages.Infrastructure/Data/DatabaseServiceCollectionExtensions.cs`

### Other components

- **User**
- **API client**
- **Public note reader**

## Connections

- User → Blazor notes UI: uses (evidence: `README.md`)
- Blazor notes UI → Web host and cookie auth: served by (evidence: `Paages.Web/Program.cs`)
- Blazor notes UI → Folder tree and editor: edits notes
- Blazor notes UI → Tabs and navigation: navigates via (evidence: `Paages.Web/Services/NavigationController.cs`)
- Tabs and navigation → Note and folder operations: queries folders (evidence: `Paages.Web/Services/NavigationController.cs`)
- Tabs and navigation → UI state: expands folders (evidence: `Paages.Web/Services/NavigationController.cs`)
- Web host and cookie auth → User accounts: resolves Google user (evidence: `Paages.Web/Program.cs`)
- Web host and cookie auth → Email account tokens: handles account links (evidence: `Paages.Web/Program.cs`)
- Web host and cookie auth → SMTP email: registers sender (evidence: `Paages.Web/Program.cs`)
- Web host and cookie auth → Note and folder operations: registers service (evidence: `Paages.Web/Program.cs`)
- Web host and cookie auth → Publications: registers service (evidence: `Paages.Web/Program.cs`)
- Google OAuth → Web host and cookie auth: authenticates via (evidence: `Paages.Web/Program.cs`)
- API client → JWT and PAT API: calls (evidence: `README.md`)
- JWT and PAT API → API endpoints: maps endpoints (evidence: `Paages.Api/Program.cs`)
- JWT and PAT API → API authentication: configures (evidence: `Paages.Api/Program.cs`)
- JWT and PAT API → User accounts: registers service (evidence: `Paages.Api/Program.cs`)
- JWT and PAT API → Token lifecycle: registers service (evidence: `Paages.Api/Program.cs`)
- JWT and PAT API → Note and folder operations: registers service (evidence: `Paages.Api/Program.cs`)
- JWT and PAT API → Publications: registers service (evidence: `Paages.Api/Program.cs`)
- API authentication → JWT and PAT API: validates PAT (evidence: `Paages.Api/Auth/ApiTokenAuthHandler.cs`)
- API endpoints → Token lifecycle: handles auth (evidence: `Paages.Api/Endpoints/AuthEndpoints.cs`)
- Token lifecycle → User accounts: validates credentials (evidence: `Paages.Infrastructure/Services/AuthService.cs`)
- Note and folder operations → SQLite database: reads and writes (evidence: `Paages.Infrastructure/Services/NoteService.cs`)
- Note and folder operations → Tree change state: notifies tree changes (evidence: `Paages.Infrastructure/Services/NoteService.cs`)
- Publications → SQLite database: reads and writes (evidence: `Paages.Infrastructure/Services/PublicationService.cs`)
- User accounts → SQLite database: reads and writes (evidence: `Paages.Infrastructure/Services/UserAccountService.cs`)
- Token lifecycle → SQLite database: rotates refresh tokens (evidence: `Paages.Infrastructure/Services/AuthService.cs`)
- Email account tokens → SMTP email: sends account mail (evidence: `Paages.Infrastructure/Services/AccountTokenService.cs`)
- Public note reader → Publications: fetches by slug
- SQLite database → Domain model: stores entities (evidence: `Paages.Infrastructure/Data/PaagesDbContext.cs`)
- SQLite configuration → SQLite database: configures (evidence: `Paages.Infrastructure/Data/DatabaseServiceCollectionExtensions.cs`)
- Web host and cookie auth → SQLite configuration: configures database (evidence: `Paages.Web/Program.cs`)
- JWT and PAT API → SQLite configuration: configures database
