# webprofusion/certify architecture

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

- Interactive diagram: https://gitdiagram.com/webprofusion/certify
- Repository: https://github.com/webprofusion/certify

## Overview

##### Main Components
- UI/Client Layer:
– Projects: Certify.UI, Certify.UI.Desktop, Certify.UI.Shared.
– Function: Provides the graphical interface (and some user-interactive dialogs) for certificate management.
- Business Logic/Core Layer:
– Projects: Certify.Core, Certify.Models, Certify.Shared.
– Function: Contains business logic such as certificate request management, challenge processing, renewal logic, configuration management, and core data models.
- API/Service Layer:
– Projects: Certify.Server (with its various subprojects like Certify.Server.Core, Certify.Server.Hub.Api, and Certify.Server.HubService) and Certify.Service.
– Function: Exposes HTTP endpoints (REST APIs) and background service interfaces (SignalR hubs, OWIN services) that handle client requests, orchestrate certificate requests, and perform backend tasks.
- Plugin/Provider Layer:
– Projects: Certify.Providers and Certify.Shared.Extensions.
– Function: Implements integration with external certificate authorities (via ACME) and DNS challenge providers, as well as providing deployment and other extension points.
- CLI Tool:
– Project: Certify.CLI.
– Function: Offers command-line functionality to perform tasks (certificate activation, import/export, deployment) that complement the UI.
- Supporting & Testing Components:
– Projects: Certify.Tests (unit and integration tests) and associated scripts (in the scripts folder) for builds, deployment automation, and packaging (e.g., Chocolatey scripts).

##### Relationships and Interactions
- The UI layer communicates with the API/Service layer (via HTTP, SignalR, and possibly other IPC mechanisms) to trigger certificate requests, renewals, and status updates.
- The API/Service layer calls into the core business logic (Certify.Core and Certify.Models) to process certificate requests and facilitate deployments.
- The Plugin/Provider layer interfaces with external services – for example, ACME certificate authorities (Let's Encrypt, BuyPass, ZeroSSL, etc.) and different DNS APIs – to conduct validation challenges.
- The CLI tool provides an alternative entry point that interacts with the API and business logic; in deployment scenarios, it may be used to script or automate certificate management.
- Background services (such as the Windows background service in Certify.Server.Core and Certify.Server.HubService) automatically handle renewals and updates, ensuring the certificates remain valid.

##### Architectural Patterns and Design Principles
- Layered Architecture: Separation between presentation (UI), business logic (Core/Models), and API/service layers.
- Plugin Architecture: Clearly separated providers and shared extensions that enable integration with multiple ACME and DNS providers.
- Service-Oriented/RESTful API Interfaces: The server components expose REST endpoints and use SignalR hubs for real-time updates.
- Modularity: The project is broken into multiple small, purpose-specific projects (CLI, Server, UI, Providers, etc.) to enhance maintainability and extensibility.
- Automated Testing/CI: Presence of GitHub workflows (YAML under .github/workflows) and extensive test projects show a commitment to continuous integration and testing.

##### Relevant Technologies and Frameworks
- .NET Core/Framework (C#) is the primary language and platform.
- SignalR for real-time communication between the UI and service.
- Docker (as seen in .dockerignore and test Dockerfiles) for containerized testing.
- Windows Data Protection API for credential storage.
- Various configuration and deployment tools (including PowerShell scripts and Chocolatey packaging scripts).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI/Client Layer
    subgraph "UI/Client Layer"
        UI["Certify.UI"]:::UI
        UIDesktop["Certify.UI.Desktop"]:::UI
        UIShared["Certify.UI.Shared"]:::UI
    end

    %% API/Service Layer
    subgraph "API/Service Layer"
        ServerCore["Certify.Server.Core"]:::API
        ServerHubApi["Certify.Server.Hub.Api"]:::API
        ServerHubService["Certify.Server.HubService"]:::API
        Service["Certify.Service"]:::API
    end

    %% Business Logic/Core Layer
    subgraph "Business Logic/Core Layer"
        Core["Certify.Core"]:::Business
        Models["Certify.Models"]:::Business
        Shared["Certify.Shared"]:::Business
    end

    %% Plugin/Provider Layer
    subgraph "Plugin/Provider Layer"
        Providers["Certify.Providers"]:::Plugin
        SharedExtensions["Certify.Shared.Extensions"]:::Plugin
    end

    %% CLI Tool
    subgraph "CLI Tool"
        CLI["Certify.CLI"]:::CLI
    end

    %% Supporting & Testing Components
    subgraph "Supporting & Testing"
        Tests["Certify.Tests"]:::Testing
        BuildScripts["Build & Packaging Scripts"]:::Testing
    end

    %% External Entities
    ExACME["ACME Certificate Authorities"]:::External
    ExDNS["DNS Providers"]:::External
    ExIIS["Windows IIS/Other Services"]:::External

    %% Connections between layers
    UI -->|"triggers"| ServerHubApi
    ServerHubApi -->|"calls"| Core
    ServerCore -->|"processes data"| Models
    Service -->|"utilizes"| Core
    ServerHubService -->|"real-time updates"| UI
    ServerHubService -->|"auto-renews"| ExIIS

    Core -->|"delegates"| Providers
    Core -->|"delegates"| SharedExtensions

    Providers -->|"validates via"| ExACME
    Providers -->|"handles DNS"| ExDNS

    CLI -->|"executes commands"| Core

    Tests -->|"tests"| Core
    Tests -->|"tests"| ServerHubApi

    %% Styling classes
    classDef UI fill:#ffcc00,stroke:#333,stroke-width:2px;
    classDef Business fill:#aaddff,stroke:#333,stroke-width:2px;
    classDef API fill:#ccffcc,stroke:#333,stroke-width:2px;
    classDef Plugin fill:#ffddbb,stroke:#333,stroke-width:2px;
    classDef CLI fill:#ffbbbb,stroke:#333,stroke-width:2px;
    classDef Testing fill:#dddddd,stroke:#333,stroke-width:2px;
    classDef External fill:#f2b3e5,stroke:#333,stroke-width:2px;

    %% Click Events
    click UI "https://github.com/webprofusion/certify/blob/development/src/Certify.UI"
    click UIDesktop "https://github.com/webprofusion/certify/blob/development/src/Certify.UI.Desktop"
    click UIShared "https://github.com/webprofusion/certify/blob/development/src/Certify.UI.Shared"
    click Core "https://github.com/webprofusion/certify/blob/development/src/Certify.Core"
    click Models "https://github.com/webprofusion/certify/blob/development/src/Certify.Models"
    click Shared "https://github.com/webprofusion/certify/blob/development/src/Certify.Shared"
    click ServerCore "https://github.com/webprofusion/certify/blob/development/src/Certify.Server/Certify.Server.Core"
    click ServerHubApi "https://github.com/webprofusion/certify/blob/development/src/Certify.Server/Certify.Server.Hub.Api"
    click ServerHubService "https://github.com/webprofusion/certify/blob/development/src/Certify.Server/Certify.Server.HubService"
    click Service "https://github.com/webprofusion/certify/blob/development/src/Certify.Service"
    click Providers "https://github.com/webprofusion/certify/blob/development/src/Certify.Providers"
    click SharedExtensions "https://github.com/webprofusion/certify/blob/development/src/Certify.Shared.Extensions"
    click CLI "https://github.com/webprofusion/certify/blob/development/src/Certify.CLI"
    click Tests "https://github.com/webprofusion/certify/blob/development/src/Certify.Tests"
    click BuildScripts "https://github.com/webprofusion/certify/tree/development/scripts/chocolatey"
```
