# baptoastgit/db-visualizer-model architecture

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

- Interactive diagram: https://gitdiagram.com/baptoastgit/db-visualizer-model
- Repository: https://github.com/baptoastgit/db-visualizer-model

## Overview

Model.BO is an internal Razor Pages application for viewing and modifying business databases. Users authenticate through Windows Authentication, receive page-level reader/editor/admin rights, then browse data tables with configurable columns and filtering; the sampled Accounts handler authorizes reads and delegates sorting/filtering to TableDataService. The domain spans accounts, users, messages, orders, products, and prices. The README also documents configurable table layouts and filters. Several page and configuration paths are included from the tree and README, but their runtime wiring was not sampled, so those links are marked unverified.

Main entry points: [`Model.BO.Data/Model/ModelDbContext.cs`](https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO.Data/Model/ModelDbContext.cs) (Entity Framework context), [`Model.BO/Program.cs`](https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/Program.cs) (Razor Pages host), [`Model.BO/Pages/UserData/Accounts.cshtml.cs`](https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/Pages/UserData/Accounts.cshtml.cs) (Accounts table), [`Model.BO.Data/Security/AccessRights.cs`](https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO.Data/Security/AccessRights.cs) (Access-right mapping)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_razor["Razor Pages host<br/>[Program.cs]"]
  node_accounts["Accounts table<br/>[Accounts.cshtml.cs]"]
  node_messages["Message detail"]
  node_userdetail["User detail"]
end

subgraph group_security["Identity and rights"]
  node_auth["Windows authentication<br/>[Program.cs]"]
  node_rights["Access-right mapping<br/>[AccessRights.cs]"]
  node_rightsjson["CRUD rights<br/>[CRUDrights.json]"]
end

subgraph group_data["Data access and domain"]
  node_tabledata["Sort and filter"]
  node_dbcontext["Entity Framework context<br/>[ModelDbContext.cs]"]
  node_entities["Business entities<br/>[Model]"]
  node_database[("Configured database")]
  node_demoseed["Demo data seeding<br/>[DemoDb.cs]"]
end

subgraph group_config["Table configuration"]
  node_layout["Table layouts<br/>[pagesLayout.json]"]
  node_filterconfig["Filter options<br/>[data.json]"]
end

node_user(("Business user"))

node_user -->|"uses"| node_razor
node_razor -->|"configures"| node_auth
node_razor -->|"loads policies"| node_rights
node_rights -->|"reads"| node_rightsjson
node_razor -->|"routes pages"| node_accounts
node_accounts -->|"requests filtered rows"| node_tabledata
node_tabledata -->|"queries"| node_dbcontext
node_accounts -->|"injects context"| node_dbcontext
node_messages -->|"queries"| node_dbcontext
node_userdetail -->|"queries"| node_dbcontext
node_dbcontext -->|"maps entities"| node_entities
node_razor -->|"configures provider"| node_dbcontext
node_dbcontext -.->|"persists data"| node_database
node_razor -->|"seeds demo data"| node_demoseed
node_demoseed -->|"populates"| node_dbcontext
node_accounts -.->|"uses table settings"| node_layout
node_accounts -.->|"uses filter options"| node_filterconfig

click node_razor "https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/Program.cs"
click node_accounts "https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/Pages/UserData/Accounts.cshtml.cs"
click node_messages "https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/Pages/Messages/MessagesDetail.cshtml.cs"
click node_userdetail "https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/Pages/UserData/UserDetail.cshtml.cs"
click node_auth "https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/Program.cs"
click node_rights "https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO.Data/Security/AccessRights.cs"
click node_rightsjson "https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/wwwroot/data/CRUDrights.json"
click node_tabledata "https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO.Service/TableDataService.cs"
click node_dbcontext "https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO.Data/Model/ModelDbContext.cs"
click node_entities "https://github.com/baptoastgit/db-visualizer-model/tree/main/Model.BO.Data/Model"
click node_demoseed "https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO.Data/Model/DemoDb/DemoDb.cs"
click node_layout "https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/wwwroot/data/pagesLayout.json"
click node_filterconfig "https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/wwwroot/data/data.json"

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_razor,node_accounts,node_messages,node_userdetail,node_user toneBlue
class node_auth,node_rights,node_rightsjson toneAmber
class node_tabledata,node_dbcontext,node_entities,node_database,node_demoseed toneMint
class node_layout,node_filterconfig toneRose
```

## Components

### Web application

- [Razor Pages host](https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/Program.cs): `Model.BO/Program.cs`
- [Accounts table](https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/Pages/UserData/Accounts.cshtml.cs): `Model.BO/Pages/UserData/Accounts.cshtml.cs`
- [Message detail](https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/Pages/Messages/MessagesDetail.cshtml.cs): `Model.BO/Pages/Messages/MessagesDetail.cshtml.cs`
- [User detail](https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/Pages/UserData/UserDetail.cshtml.cs): `Model.BO/Pages/UserData/UserDetail.cshtml.cs`

### Identity and rights

- [Windows authentication](https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/Program.cs): `Model.BO/Program.cs`
- [Access-right mapping](https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO.Data/Security/AccessRights.cs): `Model.BO.Data/Security/AccessRights.cs`
- [CRUD rights](https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/wwwroot/data/CRUDrights.json): `Model.BO/wwwroot/data/CRUDrights.json`

### Data access and domain

- [Sort and filter](https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO.Service/TableDataService.cs): `Model.BO.Service/TableDataService.cs`
- [Entity Framework context](https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO.Data/Model/ModelDbContext.cs): `Model.BO.Data/Model/ModelDbContext.cs`
- [Business entities](https://github.com/baptoastgit/db-visualizer-model/tree/main/Model.BO.Data/Model): `Model.BO.Data/Model`
- **Configured database**
- [Demo data seeding](https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO.Data/Model/DemoDb/DemoDb.cs): `Model.BO.Data/Model/DemoDb/DemoDb.cs`

### Table configuration

- [Table layouts](https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/wwwroot/data/pagesLayout.json): `Model.BO/wwwroot/data/pagesLayout.json`
- [Filter options](https://github.com/baptoastgit/db-visualizer-model/blob/main/Model.BO/wwwroot/data/data.json): `Model.BO/wwwroot/data/data.json`

### Other components

- **Business user**

## Connections

- Business user → Razor Pages host: uses (evidence: `Model.BO/Program.cs`)
- Razor Pages host → Windows authentication: configures (evidence: `Model.BO/Program.cs`)
- Razor Pages host → Access-right mapping: loads policies (evidence: `Model.BO/Program.cs`)
- Access-right mapping → CRUD rights: reads (evidence: `Model.BO.Data/Security/AccessRights.cs`)
- Razor Pages host → Accounts table: routes pages (evidence: `Model.BO/Program.cs`)
- Accounts table → Sort and filter: requests filtered rows (evidence: `Model.BO/Pages/UserData/Accounts.cshtml.cs`)
- Sort and filter → Entity Framework context: queries (evidence: `Model.BO.Service/TableDataService.cs`)
- Accounts table → Entity Framework context: injects context (evidence: `Model.BO/Pages/UserData/Accounts.cshtml.cs`)
- Message detail → Entity Framework context: queries (evidence: `Model.BO/Pages/Messages/MessagesDetail.cshtml.cs`)
- User detail → Entity Framework context: queries (evidence: `Model.BO/Pages/UserData/UserDetail.cshtml.cs`)
- Entity Framework context → Business entities: maps entities (evidence: `Model.BO.Data/Model/ModelDbContext.cs`)
- Razor Pages host → Entity Framework context: configures provider (evidence: `Model.BO/Program.cs`)
- Entity Framework context → Configured database: persists data
- Razor Pages host → Demo data seeding: seeds demo data (evidence: `Model.BO/Program.cs`)
- Demo data seeding → Entity Framework context: populates (evidence: `Model.BO.Data/Model/DemoDb/DemoDb.cs`)
- Accounts table → Table layouts: uses table settings (evidence: `README.md`)
- Accounts table → Filter options: uses filter options (evidence: `README.md`)
