# bearstech/acme architecture

> Architecture diagram of the GitHub repository bearstech/acme, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bearstech/acme
- Repository: https://github.com/bearstech/acme

## Overview

##### Main Components

a) Core Components:
- ACME Client Engine (acme.sh main script)
- Certificate Management System
- DNS API Integration Layer
- Deployment System
- Notification System

b) External Interfaces:
- Certificate Authorities (ZeroSSL, Let's Encrypt, etc.)
- DNS Providers
- Web Servers (Apache, Nginx, etc.)
- Notification Services

**┌─────────────────────────────────────────────────────────────┐**
- Client Interface                        │
- (Command Line Interface / Docker Container Interface)      │
- ┤
- Core Services                           │
- ┬──────────────┬──────────────┬──────────────┤
- Certificate │    ACME      │     DNS      │  Deployment  │
- Management  │  Protocol    │    API       │   System     │
- System    │   Client     │  Interface   │             │
- ┴──────────────┴──────────────┴──────────────┤
- Integration Layer                        │
- ┬──────────────┬──────────────┬──────────────┤
- Web Server │     DNS      │ Notification │  Storage     │
- Integrations│   Providers  │   Services   │  System      │
- ┴──────────────┴──────────────┴──────────────┘

##### Component Details

a) Certificate Management System:
- Issue certificates
- Renew certificates
- Revoke certificates
- Key management
- Certificate storage

b) DNS API Interface:
- To 100+ DNS providers
- DNS record management
- DNS verification

c) Deployment System:
- Apache deployment
- Nginx deployment
- Custom server deployment
- Automatic reload handlers

d) Notification System:
- Email notifications
- Messaging services
- Custom notification hooks

##### Data Flow Indicators

- Certificate request flow
- DNS verification flow
- Deployment process flow
- Notification triggers

##### Integration Points

Connections to:
- Multiple CA servers
- DNS provider APIs
- Web server configurations
- Storage systems

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Client Interface Layer"
        CLI["Command Line Interface"]
        Docker["Docker Container Interface"]
    end

    subgraph "Core Services Layer"
        ACME["ACME Client Engine"]:::core
        CertMgmt["Certificate Management System"]:::core
        DNSInt["DNS API Integration Layer"]:::core
        Deploy["Deployment System"]:::core
    end

    subgraph "Integration Layer"
        WebInt["Web Server Integrations"]:::integration
        DNSProv["DNS Providers"]:::integration
        Notify["Notification System"]:::integration
        Storage["Storage System"]:::integration
    end

    subgraph "External Services"
        CAs["Certificate Authorities"]:::external
        DNS["DNS Services"]:::external
        WebServers["Web Servers"]:::external
        NotifyServ["Notification Services"]:::external
    end

    %% Connections
    CLI --> ACME
    Docker --> ACME
    ACME --> CertMgmt
    ACME --> DNSInt
    ACME --> Deploy
    
    CertMgmt --> Storage
    CertMgmt --> CAs
    DNSInt --> DNSProv
    DNSProv --> DNS
    Deploy --> WebInt
    WebInt --> WebServers
    Deploy --> Notify
    Notify --> NotifyServ

    %% Component Mappings with Click Events
    click ACME "https://github.com/bearstech/acme/blob/master/acme.sh"
    click DNSInt "https://github.com/bearstech/acme/tree/master/dnsapi/"
    click Deploy "https://github.com/bearstech/acme/tree/master/deploy/"
    click Notify "https://github.com/bearstech/acme/tree/master/notify/"
    
    %% DNS Provider Examples
    click DNSProv "https://github.com/bearstech/acme/blob/master/dnsapi/dns_cf.sh"
    
    %% Web Server Integration Examples
    click WebInt "https://github.com/bearstech/acme/blob/master/deploy/apache.sh"
    
    %% Notification Examples
    click NotifyServ "https://github.com/bearstech/acme/blob/master/notify/mail.sh"

    %% Styles
    classDef core fill:#2374ab,stroke:#000,stroke-width:2px,color:white
    classDef integration fill:#47b39c,stroke:#000,stroke-width:2px
    classDef external fill:#ec9a29,stroke:#000,stroke-width:2px
    classDef support fill:#666666,stroke:#000,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["Core Component"]:::core
        L2["Integration Interface"]:::integration
        L3["External Service"]:::external
        L4["Support System"]:::support
    end
```
