# openwallet-foundation-labs/eudiplo architecture

> Architecture diagram of the GitHub repository openwallet-foundation-labs/eudiplo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/openwallet-foundation-labs/eudiplo
- Repository: https://github.com/openwallet-foundation-labs/eudiplo

## Overview

##### Project type and purpose
- EUDIPLO is a backend middleware service (no UI) built with NestJS (TypeScript) that exposes HTTP APIs to integrate any backend with EUDI Wallets.
- It implements standards such as OID4VCI (credential issuance), OID4VP (presentation), SD-JWT VC, OAuth2 token status lists, and provides key management, tenant isolation, and pluggable storage.

##### File structure
- Top-level:
- src/            – NestJS application modules
- deployment/     – Docker-compose for full vs minimal setups
- docs/           – architecture, API, getting-started
- assets/         – public static files
- test/           – e2e and unit tests, including a webhook service
- Within src/: feature modules follow the NestJS pattern:
- auth, crypto, database, health, issuer, registrar, session, utils, verifier, well-known
- Configuration: .env.example, nest-cli.json, tsconfig.*, Dockerfile, docker-compose.yml
- Packaging: pnpm workspace, package.json, mkdocs.yml for docs site

##### README for additional insights
- Emphasizes HTTP integration, Docker deployment, and core features (issuing, requesting, key management).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Clients
    Client["Client Application"]:::external

    %% NestJS Application
    subgraph "NestJS App"
        direction TB
        APIGateway["API Gateway / HTTP Server"]:::api
        AuthModule["Auth Module"]:::service
        IssuerModule["Issuer Module"]:::service
        VerifierModule["Verifier Module"]:::service
        RegistrarModule["Registrar Module"]:::service
        CryptoModule["Crypto Module"]:::service
        DatabaseModule["Database Module"]:::service
        HealthModule["Health Module"]:::service
        WellKnownModule["Well-known Module"]:::service
        SessionModule["Session Module"]:::service
        UtilsLoggerModule["Utils Logger Module"]:::service
        UtilsWebhookModule["Utils Webhook Module"]:::service
    end

    %% External Systems
    subgraph "External Systems"
        direction TB
        Wallets["EUDI Wallets"]:::external
        KeyStoreFS["Local FS Key Store"]:::resource
        Vault["Vault"]:::external
        WebhookService["Optional Webhook Receiver"]:::external
    end

    %% Shared Resources
    subgraph "Shared Resources"
        direction TB
        DB["Database"]:::db
    end

    %% Flows
    Client -->|POST /auth/oauth2/token| APIGateway
    APIGateway -->|forward to| AuthModule
    APIGateway -->|forward to| IssuerModule
    APIGateway -->|forward to| VerifierModule
    APIGateway -->|forward to| RegistrarModule
    APIGateway -->|forward to| HealthModule
    APIGateway -->|forward to| WellKnownModule
    APIGateway -->|forward to| SessionModule

    AuthModule -->|issues JWT| APIGateway
    Client -.->|uses Bearer token| IssuerModule
    IssuerModule -->|"sign VC"| CryptoModule
    CryptoModule --> KeyStoreFS
    CryptoModule --> Vault
    IssuerModule -->|persist config| DB
    Client -->|request presentation| VerifierModule
    VerifierModule -->|fetch metadata| IssuerModule
    VerifierModule -->|verify VP| CryptoModule
    VerifierModule -->|log/read| DB
    RegistrarModule -->|generate SDK| APIGateway
    HealthModule -->|health check| DB
    WellKnownModule -->|serve /.well-known| APIGateway
    SessionModule -->|manage sessions| DB
    UtilsWebhookModule -->|send events| WebhookService
    UtilsLoggerModule -->|intercept| APIGateway

    %% Click Events
    click APIGateway "https://github.com/openwallet-foundation-labs/eudiplo/blob/main/src/main.ts"
    click APIGateway "https://github.com/openwallet-foundation-labs/eudiplo/blob/main/src/app.module.ts"
    click AuthModule "https://github.com/openwallet-foundation-labs/eudiplo/blob/main/src/auth/auth.module.ts"
    click IssuerModule "https://github.com/openwallet-foundation-labs/eudiplo/blob/main/src/issuer/issuer.module.ts"
    click VerifierModule "https://github.com/openwallet-foundation-labs/eudiplo/blob/main/src/verifier/verifier.module.ts"
    click RegistrarModule "https://github.com/openwallet-foundation-labs/eudiplo/blob/main/src/registrar/registrar.module.ts"
    click CryptoModule "https://github.com/openwallet-foundation-labs/eudiplo/blob/main/src/crypto/crypto.module.ts"
    click DatabaseModule "https://github.com/openwallet-foundation-labs/eudiplo/blob/main/src/database/database.module.ts"
    click HealthModule "https://github.com/openwallet-foundation-labs/eudiplo/blob/main/src/health/health.module.ts"
    click WellKnownModule "https://github.com/openwallet-foundation-labs/eudiplo/blob/main/src/well-known/well-known.controller.ts"
    click SessionModule "https://github.com/openwallet-foundation-labs/eudiplo/blob/main/src/session/session.module.ts"
    click UtilsLoggerModule "https://github.com/openwallet-foundation-labs/eudiplo/tree/main/src/utils/logger"
    click UtilsWebhookModule "https://github.com/openwallet-foundation-labs/eudiplo/blob/main/src/utils/webhook/webhook.service.ts"

    %% Styles
    classDef api fill:#D0E6F8,stroke:#0366d6,stroke-width:2px;
    classDef service fill:#ACE2B8,stroke:#2C662D,stroke-width:2px;
    classDef db fill:#A1D490,stroke:#2C662D,stroke-width:2px,stroke-dasharray: 5 5;
    classDef resource fill:#AFF8D8,stroke:#2C662D,stroke-width:2px;
    classDef external fill:#F5D0A9,stroke:#D2691E,stroke-width:2px,stroke-dasharray: 5 5;
```
