# oqtane/oqtane.framework architecture

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

- Interactive diagram: https://gitdiagram.com/oqtane/oqtane.framework
- Repository: https://github.com/oqtane/oqtane.framework

## Overview

##### Main Components

a. Client Layer:
- Blazor Client Application (Oqtane.Client)
- Modules (Admin, HtmlText, etc.)
- Themes
- UI Components
- Client Services

b. Server Layer:
- ASP.NET Core Host (Oqtane.Server)
- API Controllers
- Server Services
- Infrastructure Components
- Security Services
- Database Access Layer

c. Shared Layer:
- Models
- Interfaces
- Enums
- Shared Constants

d. Database Layer:
- Multiple Database Support
- SQL Server
- SQLite
- MySQL
- PostgreSQL

##### Component Relationships

**[Client Layer]**
- ↕ HTTP/SignalR
**[Server Layer]**
- ↕ Entity Framework
**[Database Layer]**

##### Detailed Component Breakdown

a. Client Layer Components:
- Module System
- Admin Modules
- Content Modules
- Custom Modules
- Theme System
- Theme Controls
- Containers
- UI Components
- Pages
- Controls
- Forms

b. Server Layer Components:
- Infrastructure
- Installation Manager
- Tenant Manager
- Sync Manager
- Security Manager
- Services
- User Services
- File Services
- Module Services
- Theme Services

##### Key Features to Highlight

- Multi-tenancy support
- Modular architecture
- Theme system
- Authentication/Authorization
- File management
- Dynamic page composition
- Database abstraction

##### Interaction Flows

Following key flows:
**User Request → Client Module → API Controller → Service → Repository → Database**
**Authentication → Identity Provider → Security Services → User Management**
**Module Loading → Module Definition → Dynamic Loading → Page Composition**

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        BC[Blazor Client]:::client
        click BC "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Client/"
        
        subgraph Modules
            AM[Admin Modules]:::module
            click AM "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Client/Modules/Admin/"
            CM[Content Modules]:::module
            CUM[Custom Modules]:::module
        end
        
        subgraph UI
            UI[UI Components]:::ui
            click UI "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Client/UI/"
            TH[Theme System]:::ui
            click TH "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Client/Themes/"
        end
        
        CS[Client Services]:::service
        click CS "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Client/Services/"
        
        IM[Installation Manager]:::infra
        click IM "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Client/Installer/"
        
        AS[Authentication System]:::security
        click AS "https://github.com/oqtane/oqtane.framework/blob/dev/Oqtane.Client/Providers/IdentityAuthenticationStateProvider.cs"
    end
    
    subgraph Server
        SH[ASP.NET Core Host]:::server
        
        subgraph API
            AC[API Controllers]:::api
            click AC "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Server/Controllers/"
        end
        
        subgraph Services
            SS[Server Services]:::service
            click SS "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Server/Services/"
            SEC[Security Services]:::security
            click SEC "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Server/Security/"
        end
        
        subgraph Infrastructure
            TM[Tenant Manager]:::infra
            click TM "https://github.com/oqtane/oqtane.framework/blob/dev/Oqtane.Server/Infrastructure/TenantManager.cs"
            CM1[Config Manager]:::infra
            click CM1 "https://github.com/oqtane/oqtane.framework/blob/dev/Oqtane.Server/Infrastructure/ConfigManager.cs"
            LM[Log Manager]:::infra
            click LM "https://github.com/oqtane/oqtane.framework/blob/dev/Oqtane.Server/Infrastructure/LogManager.cs"
            EDS[Event Distributor]:::infra
            click EDS "https://github.com/oqtane/oqtane.framework/blob/dev/Oqtane.Server/Infrastructure/HostedServices/EventDistributorHostedService.cs"
        end
        
        DAL[Database Access Layer]:::data
        click DAL "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Server/Repository/"
        
        MIG[Migration System]:::infra
        click MIG "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Server/Migrations/"
    end
    
    subgraph Shared
        MOD[Models]:::shared
        click MOD "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Shared/Models/"
        INT[Interfaces]:::shared
        click INT "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Shared/Interfaces/"
        EN[Enums]:::shared
        click EN "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Shared/Enums/"
    end
    
    subgraph Database
        SQLS["SQL Server"]:::database
        click SQLS "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Database.SqlServer/"
        LITE["SQLite"]:::database
        click LITE "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Database.Sqlite/"
        MYSQL["MySQL"]:::database
        click MYSQL "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Database.MySQL/"
        PGSQL["PostgreSQL"]:::database
        click PGSQL "https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Database.PostgreSQL/"
    end
    
    %% Connections
    BC --> AC
    AC --> SS
    SS --> DAL
    DAL --> SQLS & LITE & MYSQL & PGSQL
    BC --> AS
    AS --> SEC
    
    %% Styles
    classDef client fill:#2196F3,color:white
    classDef server fill:#4CAF50,color:white
    classDef module fill:#9C27B0,color:white
    classDef ui fill:#00BCD4,color:white
    classDef service fill:#FF9800,color:white
    classDef api fill:#F44336,color:white
    classDef security fill:#795548,color:white
    classDef data fill:#607D8B,color:white
    classDef database fill:#FFC107,color:black
    classDef infra fill:#9E9E9E,color:white
    classDef shared fill:#E91E63,color:white
```
