# mc-freelance/mangos-studios architecture

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

- Interactive diagram: https://gitdiagram.com/mc-freelance/mangos-studios
- Repository: https://github.com/mc-freelance/mangos-studios

## Overview

MaNGOS Database Studio is a desktop-only workbench for managing getMaNGOS MySQL/MariaDB databases. The principal flow is a desktop user entering the private local UI, selecting a saved connection, exploring schema and world data, then editing records or applying SQL-oriented changes. The graph also preserves documented account administration, field-data catalogs, database updates, and SQL import/export. Relationship evidence is limited to the README, SOURCE INDEX references, and the provided excerpts; unsampled feature links are omitted where their callers are not shown.

Main entry points: [`src/MangosDatabaseStudio.App/Controllers/StudioController.cs`](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Controllers/StudioController.cs) (Studio interface), [`src/MangosDatabaseStudio.App/Controllers/WorldEditorController.cs`](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Controllers/WorldEditorController.cs) (World editor), [`src/MangosDatabaseStudio.Infrastructure.MySql/Internal/MySqlConnectionFactory.cs`](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.Infrastructure.MySql/Internal/MySqlConnectionFactory.cs) (MySQL connection factory), [`src/MangosDatabaseStudio.App/Program.cs`](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Program.cs) (Desktop host)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop and UI"]
  node_host["Desktop host<br/>[Program.cs]"]
  node_studio["Studio interface"]
end

subgraph group_accounts["Accounts and state"]
  node_accounts_ui["Account and role admin<br/>[UsersController.cs]"]
  node_user_store[("Local user store")]
  node_app_db[("Local application state")]
end

subgraph group_database["Database access"]
  node_conn["Connection profiles"]
  node_profile["Connection profile"]
  node_schema["Schema explorer"]
  node_schema_service["MySQL schema service"]
  node_table_service["Generic table access"]
  node_mysql["MySQL connection factory"]
end

subgraph group_world["World data tools"]
  node_world_editor["World editor"]
  node_world_viewers["World viewers"]
  node_field_data[("Field data catalog<br/>[FieldData]")]
  node_schema_catalog["MaNGOS schema catalog"]
end

subgraph group_sql["SQL and change workflows"]
  node_change_ui["Change Storage"]
  node_change_store[("Stored database changes<br/>[ChangeStorage.cs]")]
  node_sql_console["Guarded SQL console"]
  node_sql_import_export["SQL import and export"]
  node_updates["Database updates"]
end

node_user(("Desktop user"))
node_mysql_server[("MySQL / MariaDB")]

node_user -->|"launches"| node_host
node_host -->|"serves private UI"| node_studio
node_user -->|"uses"| node_studio
node_studio -.->|"selects connection"| node_conn
node_conn -.->|"manages"| node_profile
node_studio -.->|"explores schema"| node_schema
node_schema -->|"requests metadata"| node_schema_service
node_schema -.->|"browses records"| node_table_service
node_schema_service -.->|"creates connections"| node_mysql
node_table_service -.->|"creates connections"| node_mysql
node_mysql -->|"connects"| node_mysql_server
node_studio -.->|"manages accounts"| node_accounts_ui
node_host -->|"registers services"| node_user_store
node_user_store -.->|"persists users"| node_app_db
node_studio -.->|"opens editor"| node_world_editor
node_world_editor -->|"requests viewer data"| node_world_viewers
node_world_editor -.->|"uses schema metadata"| node_schema_catalog
node_world_editor -.->|"uses field definitions"| node_field_data
node_world_viewers -->|"queries database"| node_mysql
node_studio -.->|"reviews changes"| node_change_ui
node_change_ui -.->|"searches and updates"| node_change_store
node_user -.->|"executes guarded SQL"| node_sql_console
node_user -->|"imports or exports"| node_sql_import_export
node_user -->|"applies database updates"| node_updates
node_change_ui -->|"reverts selected changes"| node_mysql_server

click node_host "https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Program.cs"
click node_studio "https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Controllers/StudioController.cs"
click node_conn "https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Controllers/ConnectionsController.cs"
click node_profile "https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.Domain/Connections/ConnectionProfile.cs"
click node_schema "https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Controllers/DatabaseAdminController.cs"
click node_schema_service "https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.Infrastructure.MySql/MySqlSchemaService.cs"
click node_table_service "https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.Infrastructure.MySql/GenericTableService.cs"
click node_mysql "https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.Infrastructure.MySql/Internal/MySqlConnectionFactory.cs"
click node_accounts_ui "https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Controllers/UsersController.cs"
click node_user_store "https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Services/SqliteApplicationUserStore.cs"
click node_app_db "https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Services/ApplicationDatabase.cs"
click node_world_editor "https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Controllers/WorldEditorController.cs"
click node_world_viewers "https://github.com/mc-freelance/mangos-studios/tree/master/src/MangosDatabaseStudio.Infrastructure.MySql"
click node_field_data "https://github.com/mc-freelance/mangos-studios/tree/master/src/MangosDatabaseStudio.App/Services/FieldData"
click node_schema_catalog "https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.Schema/MangosSchemaCatalog.cs"
click node_change_ui "https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Controllers/ChangeStorageController.cs"
click node_change_store "https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Services/ChangeStorage.cs"
click node_sql_console "https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Controllers/SqlConsoleController.cs"
click node_sql_import_export "https://github.com/mc-freelance/mangos-studios/tree/master/src/MangosDatabaseStudio.Infrastructure.MySql"
click node_updates "https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.Infrastructure.MySql/MangosDatabaseUpdateService.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_host,node_studio,node_user toneBlue
class node_accounts_ui,node_user_store,node_app_db,node_mysql_server toneAmber
class node_conn,node_profile,node_schema,node_schema_service,node_table_service,node_mysql toneMint
class node_world_editor,node_world_viewers,node_field_data,node_schema_catalog toneRose
class node_change_ui,node_change_store,node_sql_console,node_sql_import_export,node_updates toneIndigo
```

## Components

### Desktop and UI

- [Desktop host](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Program.cs): `src/MangosDatabaseStudio.App/Program.cs`
- [Studio interface](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Controllers/StudioController.cs): `src/MangosDatabaseStudio.App/Controllers/StudioController.cs`

### Accounts and state

- [Account and role admin](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Controllers/UsersController.cs): `src/MangosDatabaseStudio.App/Controllers/UsersController.cs`
- [Local user store](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Services/SqliteApplicationUserStore.cs): `src/MangosDatabaseStudio.App/Services/SqliteApplicationUserStore.cs`
- [Local application state](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Services/ApplicationDatabase.cs): `src/MangosDatabaseStudio.App/Services/ApplicationDatabase.cs`

### Database access

- [Connection profiles](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Controllers/ConnectionsController.cs): `src/MangosDatabaseStudio.App/Controllers/ConnectionsController.cs`
- [Connection profile](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.Domain/Connections/ConnectionProfile.cs): `src/MangosDatabaseStudio.Domain/Connections/ConnectionProfile.cs`
- [Schema explorer](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Controllers/DatabaseAdminController.cs): `src/MangosDatabaseStudio.App/Controllers/DatabaseAdminController.cs`
- [MySQL schema service](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.Infrastructure.MySql/MySqlSchemaService.cs): `src/MangosDatabaseStudio.Infrastructure.MySql/MySqlSchemaService.cs`
- [Generic table access](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.Infrastructure.MySql/GenericTableService.cs): `src/MangosDatabaseStudio.Infrastructure.MySql/GenericTableService.cs`
- [MySQL connection factory](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.Infrastructure.MySql/Internal/MySqlConnectionFactory.cs): `src/MangosDatabaseStudio.Infrastructure.MySql/Internal/MySqlConnectionFactory.cs`

### World data tools

- [World editor](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Controllers/WorldEditorController.cs): `src/MangosDatabaseStudio.App/Controllers/WorldEditorController.cs`
- [World viewers](https://github.com/mc-freelance/mangos-studios/tree/master/src/MangosDatabaseStudio.Infrastructure.MySql): `src/MangosDatabaseStudio.Infrastructure.MySql`
- [Field data catalog](https://github.com/mc-freelance/mangos-studios/tree/master/src/MangosDatabaseStudio.App/Services/FieldData): `src/MangosDatabaseStudio.App/Services/FieldData`
- [MaNGOS schema catalog](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.Schema/MangosSchemaCatalog.cs): `src/MangosDatabaseStudio.Schema/MangosSchemaCatalog.cs`

### SQL and change workflows

- [Change Storage](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Controllers/ChangeStorageController.cs): `src/MangosDatabaseStudio.App/Controllers/ChangeStorageController.cs`
- [Stored database changes](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Services/ChangeStorage.cs): `src/MangosDatabaseStudio.App/Services/ChangeStorage.cs`
- [Guarded SQL console](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.App/Controllers/SqlConsoleController.cs): `src/MangosDatabaseStudio.App/Controllers/SqlConsoleController.cs`
- [SQL import and export](https://github.com/mc-freelance/mangos-studios/tree/master/src/MangosDatabaseStudio.Infrastructure.MySql): `src/MangosDatabaseStudio.Infrastructure.MySql`
- [Database updates](https://github.com/mc-freelance/mangos-studios/blob/master/src/MangosDatabaseStudio.Infrastructure.MySql/MangosDatabaseUpdateService.cs): `src/MangosDatabaseStudio.Infrastructure.MySql/MangosDatabaseUpdateService.cs`

### Other components

- **Desktop user**
- **MySQL / MariaDB**

## Connections

- Desktop user → Desktop host: launches (evidence: `README.md`)
- Desktop host → Studio interface: serves private UI (evidence: `README.md`)
- Desktop user → Studio interface: uses (evidence: `README.md`)
- Studio interface → Connection profiles: selects connection
- Connection profiles → Connection profile: manages
- Studio interface → Schema explorer: explores schema (evidence: `src/MangosDatabaseStudio.App/Controllers/DatabaseAdminController.cs`)
- Schema explorer → MySQL schema service: requests metadata (evidence: `src/MangosDatabaseStudio.App/Controllers/DatabaseAdminController.cs`)
- Schema explorer → Generic table access: browses records
- MySQL schema service → MySQL connection factory: creates connections
- Generic table access → MySQL connection factory: creates connections
- MySQL connection factory → MySQL / MariaDB: connects (evidence: `README.md`)
- Studio interface → Account and role admin: manages accounts
- Desktop host → Local user store: registers services (evidence: `src/MangosDatabaseStudio.App/Program.cs`)
- Local user store → Local application state: persists users
- Studio interface → World editor: opens editor (evidence: `src/MangosDatabaseStudio.App/Controllers/WorldEditorController.cs`)
- World editor → World viewers: requests viewer data (evidence: `src/MangosDatabaseStudio.App/Controllers/WorldEditorController.cs`)
- World editor → MaNGOS schema catalog: uses schema metadata
- World editor → Field data catalog: uses field definitions
- World viewers → MySQL connection factory: queries database (evidence: `src/MangosDatabaseStudio.Infrastructure.MySql/GossipViewerService.cs`)
- Studio interface → Change Storage: reviews changes (evidence: `src/MangosDatabaseStudio.App/Controllers/ChangeStorageController.cs`)
- Change Storage → Stored database changes: searches and updates
- Desktop user → Guarded SQL console: executes guarded SQL
- Desktop user → SQL import and export: imports or exports (evidence: `README.md`)
- Desktop user → Database updates: applies database updates (evidence: `README.md`)
- Change Storage → MySQL / MariaDB: reverts selected changes (evidence: `src/MangosDatabaseStudio.App/Controllers/ChangeStorageController.cs`)
