# nghiadang1982/verifiable-credential-wallet architecture

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

- Interactive diagram: https://gitdiagram.com/nghiadang1982/verifiable-credential-wallet
- Repository: https://github.com/nghiadang1982/verifiable-credential-wallet

## Overview

##### Project type and purpose
- This is a full-stack web application called “Verifiable Credential Wallet.”
- Frontend: React single-page application that lets users issue and verify credentials.
- Backend: Node.js + Express REST API that handles credential issuance and verification logic.
- Containerized for local or Docker Compose deployment.

##### File structure
- Top-level directories:
- backend/ – contains the Express server, controllers, services, package files, and its Dockerfile.
- frontend/ – contains the React app, components, public assets, package files, and its Dockerfile.
- docker-compose.yml – orchestrates frontend and backend containers.
- backend/src/ organized into app.js (entry point), controllers (HTTP handlers), services (business logic), and routes.js.
- frontend/src/ contains index.js (React entry), App.js, and components for listing, issuing, and verifying credentials.

##### README for additional insights
- Launch sequence: run backend on port 5000, frontend on port 3000, or both via Docker Compose.
- No explicit database is defined, implying ephemeral or in-memory storage, or it could be extended with a database microservice.

## Diagram (Mermaid)

```mermaid
graph TB
    %% External entities
    User["User"]:::external
    Browser["Web Browser"]:::external

    %% Docker Compose layer
    subgraph "Docker Compose"
        direction TB
        FrontendContainer["React SPA Container\n(port 3000)"]:::container
        BackendContainer["Express API Container\n(port 5000)"]:::container
    end

    %% Frontend internals
    subgraph "Frontend Container" 
        direction TB
        Entry["index.js"]:::frontend
        AppComp["App.js"]:::frontend
        CredList["CredentialList Component"]:::frontend
        IssueForm["IssueCredentialForm Component"]:::frontend
        VerifyUI["VerifyCredential Component"]:::frontend
    end

    %% Backend internals
    subgraph "Backend Container"
        direction TB
        appEntry["app.js (Entry)"]:::backendApi
        APILayer["API Layer (routes.js)"]:::backendApi
        Controller["CredentialController"]:::backendApi
        Service["CredentialService"]:::businessLogic
    end

    %% Optional/future components
    DataStore["DataStore (future)"]:::external
    Ledger["External VC Ledger (optional)"]:::external

    %% Connections
    User --> Browser
    Browser --> FrontendContainer
    FrontendContainer --> BackendContainer
    Entry --> AppComp
    AppComp --> CredList
    AppComp --> IssueForm
    AppComp --> VerifyUI
    FrontendContainer -->|"REST API calls"| APILayer
    BackendContainer --> appEntry
    appEntry --> APILayer
    APILayer --> Controller
    Controller --> Service
    Service --> DataStore
    Service --> Ledger

    %% Click Events
    click FrontendContainer "https://github.com/nghiadang1982/verifiable-credential-wallet/tree/main/frontend/Dockerfile"
    click Entry "https://github.com/nghiadang1982/verifiable-credential-wallet/blob/main/frontend/src/index.js"
    click AppComp "https://github.com/nghiadang1982/verifiable-credential-wallet/blob/main/frontend/src/App.js"
    click CredList "https://github.com/nghiadang1982/verifiable-credential-wallet/blob/main/frontend/src/components/CredentialList.js"
    click IssueForm "https://github.com/nghiadang1982/verifiable-credential-wallet/blob/main/frontend/src/components/IssueCredentialForm.js"
    click VerifyUI "https://github.com/nghiadang1982/verifiable-credential-wallet/blob/main/frontend/src/components/VerifyCredential.js"
    click BackendContainer "https://github.com/nghiadang1982/verifiable-credential-wallet/tree/main/backend/Dockerfile"
    click appEntry "https://github.com/nghiadang1982/verifiable-credential-wallet/blob/main/backend/src/app.js"
    click APILayer "https://github.com/nghiadang1982/verifiable-credential-wallet/blob/main/backend/src/routes.js"
    click Controller "https://github.com/nghiadang1982/verifiable-credential-wallet/blob/main/backend/src/controllers/credentialController.js"
    click Service "https://github.com/nghiadang1982/verifiable-credential-wallet/blob/main/backend/src/services/credentialService.js"
    click DockerCompose "https://github.com/nghiadang1982/verifiable-credential-wallet/blob/main/docker-compose.yml"

    %% Styles
    classDef frontend fill:#BBDEFB,stroke:#1E88E5,stroke-width:1px
    classDef backendApi fill:#C8E6C9,stroke:#43A047,stroke-width:1px
    classDef businessLogic fill:#FFF9C4,stroke:#F9A825,stroke-width:1px
    classDef external fill:#ECEFF1,stroke:#90A4AE,stroke-dasharray:5 5
    classDef container fill:#FFFFFF,stroke:#000000,stroke-width:2px,stroke-dasharray:0
    class DockerCompose external
```
