# thomasbleijendaal/rapidcms architecture

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

- Interactive diagram: https://gitdiagram.com/thomasbleijendaal/rapidcms
- Repository: https://github.com/thomasbleijendaal/rapidcms

## Overview

##### Main Components

a. Client-Side Components:
- Blazor UI Layer (RapidCMS.UI)
- Core Components (Forms, Editors, Buttons, Displays)
- Client-side Authentication
- Navigation System
- State Management

b. Server-Side Components:
- API Layer (RapidCMS.Api.WebApi / RapidCMS.Api.Functions)
- Repository Layer
- Authentication/Authorization
- Core Services

c. Data Layer:
- Abstract Repository Interface
- Concrete Repository Implementations
- Data Providers
- Entity Validation

##### Architecture Pattern Representation

- Presentation Layer (UI Components)
- Business Logic Layer (Core Services)
- Data Access Layer (Repositories)
- External Services Integration

##### Key Relationships to Highlight

a. Client-Server Communication:
- API endpoints
- Authentication flow
- Data synchronization

b. Component Interactions:
- UI to Core service calls
- Repository pattern implementation
- Plugin system integration

##### Deployment Options (show as alternate configurations)

a. Server-Side Blazor:
**[Browser] <- HTTP -> [ASP.NET Core Server (Blazor Server + API + Repositories)]**

b. WebAssembly:
**[Browser (Blazor WASM + UI)] <- HTTP -> [API Server/Functions]**

##### Special Features

- Model Maker Plugin
- Custom Component Integration
- Repository Flexibility
- Authentication Options

##### Specific Implementation Details

- How EditContext flows through the application
- Repository pattern implementation
- Plugin system architecture
- Authentication flow

Key Architectural Principles to Highlight:
- Separation of concerns between UI, business logic, and data access
- Pluggable repository pattern
- Flexible authentication/authorization
- Component-based UI architecture
- Support for both server-side and client-side deployment

This will provide a clear understanding of how RapidCMS components interact while maintaining its flexible and modular nature.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        UI[Blazor UI Layer]
        click UI "https://github.com/ThomasBleijendaal/RapidCMS/tree/master/src/RapidCMS.UI/"
        
        subgraph UIComponents["Core UI Components"]
            Forms["Forms"]
            click Forms "https://github.com/ThomasBleijendaal/RapidCMS/tree/master/src/RapidCMS.UI/Components/Forms/"
            Editors["Editors"]
            click Editors "https://github.com/ThomasBleijendaal/RapidCMS/tree/master/src/RapidCMS.UI/Components/Editors/"
            Buttons["Buttons"]
            click Buttons "https://github.com/ThomasBleijendaal/RapidCMS/tree/master/src/RapidCMS.UI/Components/Buttons/"
            Displays["Displays"]
            click Displays "https://github.com/ThomasBleijendaal/RapidCMS/tree/master/src/RapidCMS.UI/Components/Displays/"
        end
        
        Nav["Navigation System"]
        click Nav "https://github.com/ThomasBleijendaal/RapidCMS/tree/master/src/RapidCMS.UI/Components/Router/"
        
        State["State Management"]
        click State "https://github.com/ThomasBleijendaal/RapidCMS/tree/master/src/RapidCMS.Core/Services/Concurrency/"
        
        ClientAuth["Client Authentication"]
        click ClientAuth "https://github.com/ThomasBleijendaal/RapidCMS/blob/master/src/RapidCMS.Core/Services/Auth/WebAssemblyAuthService.cs"
    end
    
    subgraph Server
        API["API Layer"]
        click API "https://github.com/ThomasBleijendaal/RapidCMS/tree/master/src/RapidCMS.Api.WebApi/"
        
        Functions["Azure Functions"]
        click Functions "https://github.com/ThomasBleijendaal/RapidCMS/tree/master/src/RapidCMS.Api.Functions/"
        
        ServerAuth["Server Authentication"]
        click ServerAuth "https://github.com/ThomasBleijendaal/RapidCMS/blob/master/src/RapidCMS.Core/Services/Auth/ServerSideAuthService.cs"
        
        AuthHandlers["Authorization Handlers"]
        click AuthHandlers "https://github.com/ThomasBleijendaal/RapidCMS/tree/master/examples/RapidCMS.Example.Shared/AuthorizationHandlers/"
        
        CoreServices["Core Services"]
        click CoreServices "https://github.com/ThomasBleijendaal/RapidCMS/tree/master/src/RapidCMS.Core/Services/"
    end
    
    subgraph DataLayer["Data Layer"]
        RepoInterface["Repository Interface"]
        click RepoInterface "https://github.com/ThomasBleijendaal/RapidCMS/tree/master/src/RapidCMS.Core/Abstractions/Repositories/"
        
        RepoImpl["Repository Implementation"]
        click RepoImpl "https://github.com/ThomasBleijendaal/RapidCMS/tree/master/src/RapidCMS.Repositories/"
        
        DataProviders["Data Providers"]
        click DataProviders "https://github.com/ThomasBleijendaal/RapidCMS/tree/master/src/RapidCMS.Core/Providers/"
        
        Validation["Entity Validation"]
        click Validation "https://github.com/ThomasBleijendaal/RapidCMS/tree/master/src/RapidCMS.Core/Validators/"
        
        DataModels["Data Models"]
        click DataModels "https://github.com/ThomasBleijendaal/RapidCMS/tree/master/src/RapidCMS.Core/Models/Data/"
    end
    
    subgraph Plugins
        PluginSystem["Plugin System"]
        click PluginSystem "https://github.com/ThomasBleijendaal/RapidCMS/tree/master/src/RapidCMS.Core/Abstractions/Plugins"
    end
    
    %% Relationships
    UI --> UIComponents
    UI --> Nav
    UI --> State
    UI --> ClientAuth
    
    ClientAuth --> API
    API --> ServerAuth
    ServerAuth --> AuthHandlers
    
    API --> CoreServices
    Functions --> CoreServices
    
    CoreServices --> DataLayer
    RepoInterface --> RepoImpl
    RepoImpl --> DataProviders
    DataProviders --> DataModels
    DataModels --> Validation
    
    CoreServices --> PluginSystem
    
    %% Styling
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef api fill:#f1c40f,stroke:#f39c12,color:black
    classDef repo fill:#e67e22,stroke:#d35400,color:white
    classDef auth fill:#9b59b6,stroke:#8e44ad,color:white
    classDef data fill:#95a5a6,stroke:#7f8c8d,color:white
    
    class UI,UIComponents,Forms,Editors,Buttons,Displays,Nav ui
    class CoreServices,State core
    class API,Functions api
    class RepoInterface,RepoImpl repo
    class ClientAuth,ServerAuth,AuthHandlers auth
    class DataProviders,Validation,DataModels data
```
