# ctt-gob-es/fire architecture

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

- Interactive diagram: https://gitdiagram.com/ctt-gob-es/fire
- Repository: https://github.com/ctt-gob-es/fire

## Overview

##### Main Components Overview

a. Central Component (Server-side):
- fire-signature (Core component)
- clavefirma-test-services (Cl@veFirma simulator)
- fire-admin-web (Administration application)

b. Distributed Client:
- fire-client (Integration libraries in Java, .NET, and PHP)

##### Detailed Architecture

A. Central Component:
- [Central Component]
- Core Services (fire-signature)
- Signature Service
- Authentication Service
- Document Management
- Statistics Service

- Administration (fire-admin-web)
- User Management
- Application Management
- Certificate Management
- Log Management

- Test Services (clavefirma-test-services)
- Cl@veFirma Simulator

B. Distributed Clients:
- [Client Libraries]
- Java Client
- .NET Client
- PHP Client

##### Integration Points

- Connections to external services (Cl@veFirma, FNMT)
- Database connections for persistence
- Integration with document management systems

##### Security Layer

A security layer showing:
- SSL/TLS communication
- Certificate-based authentication
- User authentication flows
- Authorization mechanisms

##### Supporting Components

Additional components:
- fire-statistics-common (Statistics handling)
- fire-log-handlers (Logging system)
- fire-upgrade (Signature upgrade services)
- fire-alarms (Monitoring and alerts)

##### Data Flow

- Client requests → Central Component
- Authentication flows
- Signature processes
- Document management
- Administrative operations

##### Deployment View

A separate section showing:
- Web container deployment
- Database servers
- Load balancers (if applicable)
- High availability configuration

##### Notes

Important notes about:
- Required external dependencies
- Configuration requirements
- Security considerations
- Scalability options

##### Integration with external services

Remember to include version information and any specific deployment requirements noted in the README, such as the need for private libraries for certain connectors (Cl@ve Firma and CloudId).

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Central["Central Component"]
        Core["Core Services"]
        Admin["Administration"]
        TestServ["Test Services"]
        
        subgraph CoreServices["Core Services Layer"]
            SignServ["Signature Service"]:::core
            AuthServ["Authentication Service"]:::core
            DocMgmt["Document Management"]:::core
            Stats["Statistics Service"]:::core
        end
        
        subgraph AdminServices["Administration Layer"]
            UserMgmt["User Management"]:::admin
            AppMgmt["Application Management"]:::admin
            CertMgmt["Certificate Management"]:::admin
            LogMgmt["Log Management"]:::admin
        end
        
        subgraph Support["Support Services"]
            StatsCommon["Statistics Handler"]:::support
            LogHandler["Logging System"]:::support
            Upgrade["Signature Upgrade"]:::support
            Alarms["Monitoring & Alerts"]:::support
        end
        
        subgraph Security["Security Layer"]
            SSL["SSL/TLS"]:::security
            CertAuth["Certificate Auth"]:::security
            UserAuth["User Auth"]:::security
            Decipher["Decipher"]:::security
            TrustMgr["Trust Manager"]:::security
        end
    end
    
    subgraph Clients["Distributed Clients"]
        JavaClient["Java Client"]:::client
        DotNetClient[".NET Client"]:::client
        PHPClient["PHP Client"]:::client
    end
    
    subgraph External["External Services"]
        ClaveFirma["Cl@veFirma"]:::external
        FNMT["FNMT"]:::external
        CloudId["CloudId"]:::external
    end
    
    %% Connections
    JavaClient --> Core
    DotNetClient --> Core
    PHPClient --> Core
    
    Core --> Security
    Security --> External
    
    Admin --> CoreServices
    TestServ --> ClaveFirma
    
    CoreServices --> Support
    
    %% Click events
    click Core "https://github.com/ctt-gob-es/fire/tree/master/fire-signature/"
    click SignServ "https://github.com/ctt-gob-es/fire/tree/master/fire-signature-connector/"
    click DocMgmt "https://github.com/ctt-gob-es/fire/tree/master/fire-signature-document/"
    click TestServ "https://github.com/ctt-gob-es/fire/tree/master/clavefirma-test-services/"
    click Admin "https://github.com/ctt-gob-es/fire/tree/master/fire-admin-web/"
    click UserMgmt "https://github.com/ctt-gob-es/fire/tree/master/fire-admin-core/"
    click LogMgmt "https://github.com/ctt-gob-es/fire/tree/master/fire-admin-persistence/"
    click JavaClient "https://github.com/ctt-gob-es/fire/tree/master/fire-client-java/"
    click DotNetClient "https://github.com/ctt-gob-es/fire/tree/master/fire-client-dotnet/"
    click PHPClient "https://github.com/ctt-gob-es/fire/tree/master/fire-client-php/"
    click StatsCommon "https://github.com/ctt-gob-es/fire/tree/master/fire-statistics-common/"
    click LogHandler "https://github.com/ctt-gob-es/fire/tree/master/fire-log-handlers/"
    click Upgrade "https://github.com/ctt-gob-es/fire/tree/master/fire-upgrade/"
    click Alarms "https://github.com/ctt-gob-es/fire/tree/master/fire-alarms/"
    click Decipher "https://github.com/ctt-gob-es/fire/tree/master/fire-signature-decipher/"
    click TrustMgr "https://github.com/ctt-gob-es/fire/tree/master/fire-trustManagerClassName/"
    
    %% Styling
    classDef core fill:#2374ab
    classDef admin fill:#48a9a6
    classDef security fill:#d64045
    classDef support fill:#4caf50
    classDef client fill:#ff9800
    classDef external fill:#9e9e9e
    
    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Admin Components"]:::admin
        L3["Security Components"]:::security
        L4["Support Services"]:::support
        L5["Client Components"]:::client
        L6["External Services"]:::external
    end
```
